index.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. <!doctype html>
  2. <html>
  3. <!-- 作者:PJ568 -->
  4. <!-- 项目地址:https://github.com/PJ-568/markdown.html/ -->
  5. <!-- 本项目遵循 CC BY-SA 4.0 International 许可协议 -->
  6. <!-- v 1.4.0 -->
  7. <head>
  8. <meta charset="utf-8">
  9. <meta name="description" content="HTML read markdown">
  10. <meta name="viewport" content="width=256, initial-scale=1">
  11. <script defer src="//lib.baomitu.com/marked/4.0.2/marked.min.js" type="text/javascript"></script>
  12. <script src="//lib.baomitu.com/pjax/0.2.8/pjax.min.js" type="text/javascript"></script>
  13. <script src="//lib.baomitu.com/translate.js/3.7.2/translate.js" type="text/javascript"></script>
  14. <script src="//lib.baomitu.com/Darkmode.js/1.5.7/darkmode-js.min.js" type="text/javascript"></script>
  15. <script>
  16. // 使用 IIFE 包裹以避免全局变量污染
  17. (function () {
  18. // 加载动画相关
  19. var timer = null;
  20. // 文档解析功能相关
  21. var notExistIndexPage = null; // 是否不存在索引页
  22. async function getPValue() {
  23. return await decodeMDPath(window.location.href);
  24. }
  25. // PJAX 相关
  26. let PJAX;
  27. // 深色模式相关
  28. let darkmode;
  29. // 自定义 PJAX 相关
  30. const existPushState = (history && history.pushState);
  31. var level = 1; // 当前页面的层级
  32. var lastLevel = 0;
  33. // 开始加载动画
  34. function startLoad() {
  35. const loadingBar = document.querySelector('.loading-bar');
  36. const progress = document.querySelector('.loading-bar .progress');
  37. var loadingBarWidth = 20;
  38. var MAX_LOADING_WIDTH = 95;
  39. loadingBar.classList.add('loading');
  40. progress.style.width = loadingBarWidth + '%';
  41. clearInterval(timer);
  42. timer = setInterval(function () {
  43. loadingBarWidth += 3;
  44. if (loadingBarWidth > MAX_LOADING_WIDTH) {
  45. loadingBarWidth = MAX_LOADING_WIDTH;
  46. }
  47. progress.style.width = loadingBarWidth + '%';
  48. }, 500);
  49. }
  50. // 停止加载动画
  51. function endLoad() {
  52. const loadingBar = document.querySelector('.loading-bar');
  53. const progress = document.querySelector('.loading-bar .progress');
  54. clearInterval(timer);
  55. progress.style.width = '100%';
  56. loadingBar.classList.remove('loading');
  57. setTimeout(function () {
  58. progress.style.width = 0;
  59. }, 400);
  60. }
  61. // 初始化 PJAX
  62. function initPJAX() {
  63. try {
  64. const Pjax = window.Pjax || function () { };
  65. PJAX = new Pjax({
  66. selectors: [
  67. 'head title',
  68. '.markdown-body',
  69. '.pjax-reload'
  70. ],
  71. cacheBust: false
  72. });
  73. } catch (e) {
  74. console.error('PJAX 初始化出错:' + e);
  75. }
  76. }
  77. // translate-js 翻译系统
  78. //// 初始化翻译系统
  79. function initTranslate() {
  80. try {
  81. translate.service.use('client.edge');
  82. translate.request.listener.start();
  83. translate.setAutoDiscriminateLocalLanguage();
  84. translate.language.setUrlParamControl();
  85. translate.ignore.class.push('notTranslate');
  86. translate.execute();
  87. } catch (e) {
  88. console.error('翻译系统出错:' + e);
  89. }
  90. }
  91. // Darkmode.js 深色模式
  92. function initDarkmode() {
  93. try {
  94. const Darkmode = window.Darkmode || function () {
  95. console.warn('Darkmode.js 不存在?');
  96. return;
  97. };
  98. darkmode = new Darkmode();
  99. } catch (e) {
  100. console.error('初始化 Darkmode.js 出错:' + e);
  101. }
  102. }
  103. //// 检查并提示翻译
  104. function infoTranslate() {
  105. try {
  106. var currentLang = translate.language.getCurrent();
  107. var originalLang = translate.language.getLocal();
  108. if (currentLang !== originalLang) {
  109. const translateInfo = document.querySelectorAll('.translate-info');
  110. if (translateInfo) {
  111. translateInfo.forEach(function (item) {
  112. item.remove();
  113. })
  114. }
  115. // 获取 .markdown-body 元素
  116. var mainElements = document.querySelector('.markdown-body');
  117. var bq = document.createElement('blockquote');
  118. bq.classList.add('translate-info');
  119. var infoBody = document.createElement('p');
  120. infoBody.innerText = '当前页面已翻译。您可以:';
  121. var msgBody = document.createElement('p');
  122. var switchButton = document.createElement('a');
  123. switchButton.classList.add('translate-switch');
  124. switchButton.href = 'javascript:;';
  125. switchButton.title = '切换到原语言';
  126. switchButton.innerText = '切换到文章原本的语言';
  127. bq.appendChild(infoBody);
  128. bq.appendChild(switchButton);
  129. mainElements.insertBefore(bq, mainElements.children[1]);
  130. }
  131. } catch (e) {
  132. console.error('检查并提示翻译出错:' + e);
  133. }
  134. }
  135. //// 刷新翻译
  136. function refreshTranslate() {
  137. try {
  138. translate.selectLanguageTag.refreshRender();
  139. } catch (e) {
  140. console.error('刷新翻译出错:' + e);
  141. }
  142. }
  143. // 获取文件所在目录
  144. function getDirectory(path) {
  145. path = new URL(path, 'http://example.com').pathname;
  146. const lastSlashIndex = path.lastIndexOf('/');
  147. return path.substring(0, lastSlashIndex + 1);
  148. }
  149. // 获取 markdown.html 的当前路径
  150. function getPath() {
  151. return getDirectory(window.location);
  152. }
  153. // 将 ?p= 后面的值转换为绝对路径
  154. /*
  155. 输出的值是 /path/to/file.md
  156. 当其为 null 时,根据是否存在 index.md 文件来决定返回的值
  157. */
  158. async function decodeMDPath(path) {
  159. const url = new URL(path);
  160. const params = new URLSearchParams(url.search);
  161. path = formatMDPath(params.get('p'));
  162. // 如果 path 为 null
  163. if (!path) {
  164. const currentDir = getPath();
  165. // 如果存在 index.md 文件,则返回 index.md,否则返回 README.md
  166. if (notExistIndexPage) {
  167. path = currentDir + 'README.md';
  168. } else if (notExistIndexPage === false) {
  169. path = currentDir + 'index.md';
  170. } else {
  171. const response = await fetch(currentDir + 'index.md');
  172. if (response.ok) {
  173. notExistIndexPage = false;
  174. path = currentDir + 'index.md';
  175. } else {
  176. notExistIndexPage = true;
  177. path = currentDir + 'README.md';
  178. }
  179. }
  180. }
  181. return path;
  182. }
  183. // 格式化路径
  184. /*
  185. 如果 mdPath 为 null,则返回 null,如果 mdPath 是路径,则返回该路径下 /index.md
  186. return: 返回格式化后的文件路径,一定是绝对路径,或者 null
  187. */
  188. function formatMDPath(mdPath) {
  189. if (mdPath) {
  190. mdPath = new URL(mdPath, 'http://example.com').pathname;
  191. if (!mdPath.endsWith('.md')) {
  192. if (!mdPath.endsWith('/')) {
  193. mdPath += '/';
  194. }
  195. mdPath += 'index.md';
  196. }
  197. }
  198. return mdPath;
  199. }
  200. // 判断路径是否为相对路径
  201. const isRelativePath = (path) => !path.startsWith('/');
  202. // 处理错误
  203. async function handleError(errorMessage) {
  204. document.title = '加载失败'
  205. document.querySelector('.markdown-body').innerHTML = `<h1>加载失败</h1><p>加载文档<code>${await getPValue()}</code>时出错:<code>${errorMessage}</code>。您可以尝试<a class="refresh-btn" href="">重新加载</a>或<a class="back-btn">返回</a>。</p>`;
  206. }
  207. // 更新页面的 markdown 内容
  208. /*
  209. path: 要加载的 markdown 文件路径,最好是带主机名的绝对路径(要用于 fetch())
  210. response: fetch() 的返回值,用于防止二次访问
  211. */
  212. const showMarkdown = async (mdPath, response = null) => {
  213. try {
  214. const content = await getMarkdown(mdPath, response);
  215. document.querySelector('.markdown-body').innerHTML = content;
  216. const firstH1 = document.querySelector('h1');
  217. document.title = firstH1 ? firstH1.textContent : mdPath;
  218. showMarkdownEnded();
  219. customPushState(window.location.origin + getPath() + '?p=' + mdPath);
  220. } catch (error) {
  221. handleError(error)
  222. }
  223. }
  224. // 读取并解析指定文件
  225. const getMarkdown = async (mdPath, response = null) => {
  226. // 生成目录
  227. function generateOutline(doc) {
  228. var outline = '<ul>';
  229. const headings = Array.from(doc.querySelectorAll('h1, h2, h3, h4, h5, h6'));
  230. var stack = [];
  231. headings.forEach(heading => {
  232. const level = parseInt(heading.tagName.charAt(1));
  233. const id = heading.textContent.toLowerCase()
  234. .replace(/ /g, '-') // 将空格替换为连字符
  235. .replace(/[^\w\u4e00-\u9fa5-]/g, ''); // 保留字母、数字、下划线、中文字符和连字符
  236. // 设置 id 属性以便链接跳转
  237. heading.setAttribute('id', id);
  238. while (stack.length > 0 && stack[stack.length - 1].level >= level) {
  239. stack.pop();
  240. outline += '</ul></li>';
  241. }
  242. if (stack.length === 0 || stack[stack.length - 1].level < level) {
  243. outline += '<li><ul>';
  244. } else {
  245. outline += '</li><li>';
  246. }
  247. outline += `<a href="#${id}">${heading.textContent}</a>`;
  248. stack.push({ level: level });
  249. });
  250. while (stack.length > 0) {
  251. outline += '</ul></li>';
  252. stack.pop();
  253. }
  254. outline += '</ul>';
  255. return outline;
  256. }
  257. if (!response) {
  258. response = await fetch(mdPath);
  259. if (!response.ok) {
  260. throw new Error('请求失败:' + mdPath + ',' + response.status + ',' + response.statusText);
  261. }
  262. }
  263. var content = marked.parse(await response.text());
  264. content = `<details class="outline"><summary><code>${decodeURIComponent(mdPath)}</code></summary></details><hr>${content}`;
  265. const parser = new DOMParser();
  266. const doc = parser.parseFromString(content, 'text/html');
  267. const outline = generateOutline(doc);
  268. doc.querySelector('.outline').innerHTML += outline;
  269. const links = doc.querySelectorAll('a[href$=".md"]');
  270. const pValue = await getPValue()
  271. links.forEach(link => {
  272. var href = link.getAttribute('href');
  273. /*
  274. 如果 href 是相对路径,则在其前加上当前读取的文档的绝对路径;
  275. 如果不存在当前读取的文档(默认读取的 index.md 或 README.md),
  276. 则在其前加上 markdown.html 的绝对路径。
  277. */
  278. if (isRelativePath(href)) {
  279. if (pValue) {
  280. href = getDirectory(mdPath) + href;
  281. } else {
  282. href = getPath() + href;
  283. }
  284. const absoluteHref = new URL(href, 'http://example.com').pathname;
  285. link.setAttribute('href', `${window.location.pathname}?p=${absoluteHref}`);
  286. } else if (href.startsWith('/')) {
  287. link.setAttribute('href', `${window.location.pathname}?p=${href}`);
  288. }
  289. });
  290. return doc.body.innerHTML;
  291. };
  292. // 初始化自定义 PJAX
  293. function initCustomPJAX() {
  294. // 覆写 PJAX 处理响应的函数,在内容插入页面之前实现 markdown 的渲染
  295. PJAX._handleResponse = PJAX.handleResponse;
  296. PJAX.handleResponse = async function (responseText, request, href, options) {
  297. if (request.responseText.startsWith('<!doctype html>\n<html>\n<!-- 作者:PJ568 -->')) {
  298. await showMarkdown(await decodeMDPath(href));
  299. } else {
  300. PJAX._handleResponse(responseText, request, href, options);
  301. }
  302. }
  303. // 监听自定义链接的点击事件
  304. if (existPushState) {
  305. document.querySelector('.markdown-body').addEventListener('click', async function (event) {
  306. const link = event.target.closest('a[href$=".md"]');
  307. if (link) {
  308. try {
  309. event.preventDefault();
  310. startLoad();
  311. await showMarkdown(await decodeMDPath(link.href));
  312. } catch (e) {
  313. console.error('自定义 PJAX 出错:' + e);
  314. }
  315. }
  316. });
  317. }
  318. }
  319. // 自定义推送状态
  320. function customPushState(url = window.location.href) {
  321. if (existPushState) {
  322. if (level > lastLevel) {
  323. history.pushState({ url: url, title: document.title, uid: level }, null, url);
  324. lastLevel = level++;
  325. } else {
  326. lastLevel = level - 1;
  327. }
  328. }
  329. }
  330. // 初始化内容
  331. const initContent = async () => {
  332. try {
  333. await showMarkdown(await getPValue());
  334. } catch (error) {
  335. handleError('初始化内容时出错:', error);
  336. }
  337. };
  338. // 初始化返回首页按钮
  339. function initHomeBtn() {
  340. const homeBtn = document.querySelector('.to-home');
  341. homeBtn.href = window.location.pathname;
  342. }
  343. // 初始化
  344. function initialize() {
  345. initDarkmode(); //// 初始化深色模式
  346. initHomeBtn(); //// 初始化返回首页按钮
  347. initContent(); //// 初始化内容
  348. initTranslate(); //// 初始化页面翻译
  349. initPJAX(); //// 初始化 PJAX
  350. initCustomPJAX(); //// 初始化自定义 PJAX
  351. }
  352. // 触发器
  353. //// 网页加载完毕后触发初始化
  354. window.addEventListener('DOMContentLoaded', () => initialize());
  355. //// 翻译执行完成后触发
  356. // translate.listener.renderTaskFinish = function (_task) {
  357. // }
  358. //// PJAX 开始时执行的函数
  359. document.addEventListener('pjax:send', function () {
  360. startLoad();
  361. });
  362. //// 监听 PJAX 完成后,重新加载
  363. document.addEventListener('pjax:complete', function () {
  364. initCustomPJAX(); //// 初始化自定义 PJAX
  365. });
  366. //// 点击事件委托
  367. document.addEventListener('click', function (event) {
  368. if (event.target.closest('.back-btn')) {
  369. window.history.back();
  370. } else if (event.target.closest('.refresh-btn')) {
  371. window.location.reload();
  372. } else if (event.target.closest('.dark-btn')) {
  373. darkmode.toggle();
  374. } else if (event.target.closest('.translate-switch')) {
  375. translate.changeLanguage(translate.language.getLocal());
  376. } else if (event.target.closest('.outline a[href]')) {
  377. // 目录平滑移动
  378. const href = event.target.getAttribute('href');
  379. if (href !== '#' && href.startsWith('#')) {
  380. event.preventDefault();
  381. const targetElement = document.querySelector(href);
  382. if (targetElement) {
  383. targetElement.scrollIntoView({
  384. behavior: 'smooth'
  385. });
  386. } else {
  387. console.error(`ID 为 ${targetId} 的元素不存在。`);
  388. }
  389. }
  390. }
  391. });
  392. //// 文档内容加载完毕时触发
  393. function showMarkdownEnded() {
  394. refreshTranslate();
  395. infoTranslate(); //// 检查并提示翻译
  396. translate.execute(); //// 手动触发翻译,但是理论上 translate-js 会监听页面变化
  397. endLoad();
  398. document.querySelector('html').classList.add('loaded'); //// 防止缓存的页面被自定义 PJAX 中覆写的处理响应的函数捕获
  399. window.scrollTo({
  400. top: 0,
  401. behavior: 'smooth'
  402. });
  403. }
  404. //// 浏览器返回时触发
  405. window.onpopstate = function (event) {
  406. if (level > 1) {
  407. --level;
  408. }
  409. };
  410. })();
  411. </script>
  412. <title>加载中</title>
  413. <style>
  414. /* 全局 */
  415. * {
  416. font-family: 'Exo', sans-serif;
  417. text-decoration: none;
  418. }
  419. :root {
  420. background-color: #e6e6e6;
  421. }
  422. ::selection {
  423. background-color: #DCEDC8;
  424. }
  425. body {
  426. margin: 0;
  427. }
  428. a {
  429. color: #66BB6A;
  430. cursor: pointer;
  431. text-decoration: none;
  432. }
  433. a:hover {
  434. color: #2E7D32;
  435. }
  436. /* 背景 */
  437. .background {
  438. position: fixed;
  439. left: 0;
  440. top: 0;
  441. height: 100%;
  442. width: 100%;
  443. z-index: -1;
  444. background-color: #e6e6e6;
  445. }
  446. /* 导航栏 */
  447. nav {
  448. position: fixed;
  449. top: 0;
  450. right: 0;
  451. width: min-content;
  452. background-color: #616161;
  453. display: flex;
  454. justify-content: space-between;
  455. align-items: center;
  456. }
  457. nav a {
  458. color: #FAFAFA;
  459. padding: .3rem;
  460. transition:
  461. color .2s,
  462. background-color .2s;
  463. }
  464. nav a:hover {
  465. color: #FFF;
  466. background-color: #212121;
  467. }
  468. /* 主要内容 */
  469. .markdown-body {
  470. margin: 3rem auto;
  471. width: 100%;
  472. max-width: 950px;
  473. min-height: 300px;
  474. background-color: #FAFAFA;
  475. color: #212121;
  476. box-sizing: border-box;
  477. overflow-x: hidden;
  478. padding: 30px;
  479. box-shadow: 0 2px 6px rgba(100, 100, 100, .3);
  480. }
  481. .markdown-body img,
  482. .markdown-body video,
  483. .markdown-body iframe,
  484. .markdown-body object,
  485. .markdown-body embed,
  486. .markdown-body svg,
  487. .markdown-body canvas,
  488. .markdown-body audio {
  489. max-width: 100%;
  490. }
  491. /* Markdown 样式 */
  492. .markdown-body a {
  493. transition:
  494. color .2s,
  495. background-color .2s;
  496. }
  497. .markdown-body a:hover {
  498. background-color: rgba(255, 255, 255, 0.1);
  499. }
  500. .markdown-body ul,
  501. .markdown-body ol {
  502. padding-left: 2rem;
  503. }
  504. .markdown-body pre {
  505. background-color: rgba(0, 0, 0, 0.05);
  506. padding: .4rem;
  507. border-radius: .1rem;
  508. overflow-y: scroll;
  509. }
  510. .markdown-body code {
  511. font-family: "cousine nerd font mono", monospace;
  512. }
  513. .markdown-body p code {
  514. background-color: rgba(0, 0, 0, 0.05);
  515. font-size: small;
  516. padding: .2rem;
  517. border-radius: .1rem;
  518. }
  519. .markdown-body blockquote {
  520. background-color: rgba(0, 0, 0, 0.05);
  521. font-size: small;
  522. padding: .4rem;
  523. margin: .5rem 2rem;
  524. border-left: 5px solid rgba(0, 0, 0, 0.1);
  525. }
  526. .markdown-body details {
  527. border: 1px solid rgba(0, 0, 0, 0.1);
  528. border-radius: .1rem;
  529. }
  530. .markdown-body summary {
  531. cursor: pointer;
  532. background-color: rgba(0, 0, 0, 0.05);
  533. padding: .4rem;
  534. font-weight: bold;
  535. }
  536. .markdown-body summary code {
  537. cursor: text;
  538. }
  539. .markdown-body details a {
  540. margin-left: -2rem;
  541. }
  542. .markdown-body table {
  543. border-spacing: 0;
  544. border-radius: .1rem;
  545. width: 100%;
  546. border-collapse: separate;
  547. border: .1rem solid rgba(0, 0, 0, 0.05);
  548. }
  549. .markdown-body table td,
  550. .markdown-body table th {
  551. border-right: .1rem solid rgba(0, 0, 0, 0.05);
  552. }
  553. .markdown-body table td,
  554. .markdown-body table th {
  555. border-top: .1rem solid rgba(0, 0, 0, 0.05);
  556. }
  557. .markdown-body table td:last-child,
  558. .markdown-body th:last-child {
  559. border-right-color: transparent;
  560. }
  561. .markdown-body table thead tr:first-child>* {
  562. border-top: .1rem solid transparent;
  563. }
  564. /* 加载进度条 */
  565. .loading-bar {
  566. position: fixed;
  567. top: 0;
  568. left: 0;
  569. z-index: 99999;
  570. opacity: 0;
  571. transition: opacity .4s linear;
  572. .progress {
  573. position: fixed;
  574. top: 0;
  575. left: 0;
  576. width: 0;
  577. height: 4px;
  578. background-color: #FFF;
  579. box-shadow: 0 0 10px rgba(102, 187, 106, .7);
  580. }
  581. &.loading {
  582. opacity: 1;
  583. transition: none;
  584. .progress {
  585. transition: width .4s ease;
  586. }
  587. }
  588. }
  589. /* 翻译按钮相关 */
  590. .translateSelectLanguage {
  591. background-color: #616161;
  592. color: inherit;
  593. z-index: 10;
  594. width: 17%;
  595. height: 100%;
  596. opacity: 0;
  597. cursor: pointer;
  598. position: absolute;
  599. top: 0;
  600. left: 50%;
  601. }
  602. /* 深色模式相关 */
  603. .darkmode--activated .markdown-body img,
  604. .darkmode--activated .markdown-body svg {
  605. isolation: isolate;
  606. mix-blend-mode: difference
  607. }
  608. .darkmode-layer,
  609. .darkmode-toggle {
  610. z-index: 2
  611. }
  612. /* 小屏响应式优化 */
  613. @media only screen and (max-width: 950px) {
  614. html,
  615. body,
  616. .markdown-body {
  617. height: 100%;
  618. }
  619. .markdown-body {
  620. overflow-y: scroll;
  621. min-width: 256px;
  622. top: 0;
  623. margin: 0 0;
  624. }
  625. }
  626. </style>
  627. </head>
  628. <body>
  629. <!-- 导航栏 -->
  630. <nav>
  631. <a title="返回" class="back-btn">
  632. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  633. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  634. class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-back">
  635. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  636. <path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1" />
  637. </svg>
  638. </a>
  639. <a title="刷新" class="refresh-btn" href="">
  640. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  641. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  642. class="icon icon-tabler icons-tabler-outline icon-tabler-refresh">
  643. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  644. <path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
  645. <path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
  646. </svg>
  647. </a>
  648. <a title="主页" class="to-home">
  649. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  650. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  651. class="icon icon-tabler icons-tabler-outline icon-tabler-home">
  652. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  653. <path d="M5 12l-2 0l9 -9l9 9l-2 0" />
  654. <path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
  655. <path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" />
  656. </svg>
  657. </a>
  658. <a title="更改语言" id="translate">
  659. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  660. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  661. class="icon icon-tabler icons-tabler-outline icon-tabler-language">
  662. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  663. <path d="M4 5h7" />
  664. <path d="M9 3v2c0 4.418 -2.239 8 -5 8" />
  665. <path d="M5 9c0 2.144 2.952 3.908 6.7 4" />
  666. <path d="M12 20l4 -9l4 9" />
  667. <path d="M19.1 18h-6.2" />
  668. </svg>
  669. </a>
  670. <a title="切换显示模式" class="dark-btn" href="javascript:;">
  671. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  672. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  673. class="icon icon-tabler icons-tabler-outline icon-tabler-brightness">
  674. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  675. <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
  676. <path d="M12 3l0 18" />
  677. <path d="M12 9l4.65 -4.65" />
  678. <path d="M12 14.3l7.37 -7.37" />
  679. <path d="M12 19.6l8.85 -8.85" />
  680. </svg>
  681. </a>
  682. <a title="关于" href="https://github.com/PJ-568/markdown.html/">
  683. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  684. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  685. class="icon icon-tabler icons-tabler-outline icon-tabler-info-circle">
  686. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  687. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  688. <path d="M12 9h.01" />
  689. <path d="M11 12h1v4h1" />
  690. </svg>
  691. </a>
  692. </nav>
  693. <!-- 内容主体 -->
  694. <div class="markdown-body">
  695. <h1>加载中……</h1>
  696. <p>请稍等。</p>
  697. </div>
  698. <!-- 加载动画 -->
  699. <div class="loading-bar">
  700. <div class="progress"></div>
  701. </div>
  702. <div class="background"></div>
  703. <script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/instant.page/5.1.0/instantpage.min.js"
  704. type="text/javascript"></script>
  705. </body>
  706. </html>