index.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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.3.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. let outline = '<ul>';
  229. let headings = Array.from(doc.querySelectorAll('h1, h2, h3, h4, h5, h6'));
  230. let stack = [];
  231. headings.forEach(heading => {
  232. let level = parseInt(heading.tagName.charAt(1));
  233. // 设置 id 属性以便链接跳转
  234. heading.setAttribute('id', heading.textContent);
  235. while (stack.length > 0 && stack[stack.length - 1].level >= level) {
  236. stack.pop();
  237. outline += '</ul></li>';
  238. }
  239. if (stack.length === 0 || stack[stack.length - 1].level < level) {
  240. outline += '<li><ul>';
  241. } else {
  242. outline += '</li><li>';
  243. }
  244. outline += `<a href="#${heading.textContent}">${heading.textContent}</a>`;
  245. stack.push({ level: level });
  246. });
  247. while (stack.length > 0) {
  248. outline += '</ul></li>';
  249. stack.pop();
  250. }
  251. outline += '</ul>';
  252. return outline;
  253. }
  254. if (!response) {
  255. response = await fetch(mdPath);
  256. if (!response.ok) {
  257. throw new Error('请求失败:' + mdPath + ',' + response.status + ',' + response.statusText);
  258. }
  259. }
  260. var content = marked.parse(await response.text());
  261. content = `<details class="outline"><summary><code>${decodeURIComponent(mdPath)}</code></summary></details><hr>${content}`;
  262. const parser = new DOMParser();
  263. const doc = parser.parseFromString(content, 'text/html');
  264. const outline = generateOutline(doc);
  265. doc.querySelector('.outline').innerHTML += outline;
  266. const links = doc.querySelectorAll('a[href$=".md"]');
  267. const pValue = await getPValue()
  268. links.forEach(link => {
  269. var href = link.getAttribute('href');
  270. /*
  271. 如果 href 是相对路径,则在其前加上当前读取的文档的绝对路径;
  272. 如果不存在当前读取的文档(默认读取的 index.md 或 README.md),
  273. 则在其前加上 markdown.html 的绝对路径。
  274. */
  275. if (isRelativePath(href)) {
  276. if (pValue) {
  277. href = getDirectory(mdPath) + href;
  278. } else {
  279. href = getPath() + href;
  280. }
  281. const absoluteHref = new URL(href, 'http://example.com').pathname;
  282. link.setAttribute('href', `${window.location.pathname}?p=${absoluteHref}`);
  283. } else if (href.startsWith('/')) {
  284. link.setAttribute('href', `${window.location.pathname}?p=${href}`);
  285. }
  286. });
  287. return doc.body.innerHTML;
  288. };
  289. // 初始化自定义 PJAX
  290. function initCustomPJAX() {
  291. // 覆写 PJAX 处理响应的函数,在内容插入页面之前实现 markdown 的渲染
  292. PJAX._handleResponse = PJAX.handleResponse;
  293. PJAX.handleResponse = async function (responseText, request, href, options) {
  294. if (request.responseText.startsWith('<!doctype html>\n<html>\n<!-- 作者:PJ568 -->')) {
  295. await showMarkdown(await decodeMDPath(href));
  296. } else {
  297. PJAX._handleResponse(responseText, request, href, options);
  298. }
  299. }
  300. // 监听自定义链接的点击事件
  301. if (existPushState) {
  302. document.querySelector('.markdown-body').addEventListener('click', async function (event) {
  303. const link = event.target.closest('a[href$=".md"]');
  304. if (link) {
  305. try {
  306. event.preventDefault();
  307. startLoad();
  308. await showMarkdown(await decodeMDPath(link.href));
  309. } catch (e) {
  310. console.error('自定义 PJAX 出错:' + e);
  311. }
  312. }
  313. });
  314. }
  315. }
  316. // 自定义推送状态
  317. function customPushState(url = window.location.href) {
  318. if (existPushState) {
  319. if (level > lastLevel) {
  320. history.pushState({ url: url, title: document.title, uid: level }, null, url);
  321. lastLevel = level++;
  322. } else {
  323. lastLevel = level - 1;
  324. }
  325. }
  326. }
  327. // 初始化内容
  328. const initContent = async () => {
  329. try {
  330. await showMarkdown(await getPValue());
  331. } catch (error) {
  332. handleError('初始化内容时出错:', error);
  333. }
  334. };
  335. // 初始化返回首页按钮
  336. function initHomeBtn() {
  337. const homeBtn = document.querySelector('.to-home');
  338. homeBtn.href = window.location.pathname;
  339. }
  340. // 初始化
  341. function initialize() {
  342. initDarkmode(); //// 初始化深色模式
  343. initHomeBtn(); //// 初始化返回首页按钮
  344. initContent(); //// 初始化内容
  345. initTranslate(); //// 初始化页面翻译
  346. initPJAX(); //// 初始化 PJAX
  347. initCustomPJAX(); //// 初始化自定义 PJAX
  348. }
  349. // 触发器
  350. //// 网页加载完毕后触发初始化
  351. window.addEventListener('DOMContentLoaded', () => initialize());
  352. //// 翻译执行完成后触发
  353. // translate.listener.renderTaskFinish = function (_task) {
  354. // }
  355. //// PJAX 开始时执行的函数
  356. document.addEventListener('pjax:send', function () {
  357. startLoad();
  358. });
  359. //// 监听 PJAX 完成后,重新加载
  360. document.addEventListener('pjax:complete', function () {
  361. initCustomPJAX(); //// 初始化自定义 PJAX
  362. });
  363. //// 点击事件委托
  364. document.addEventListener('click', function (event) {
  365. if (event.target.closest('.back-btn')) {
  366. window.history.back();
  367. } else if (event.target.closest('.refresh-btn')) {
  368. window.location.reload();
  369. } else if (event.target.closest('.dark-btn')) {
  370. darkmode.toggle();
  371. } else if (event.target.closest('.translate-switch')) {
  372. translate.changeLanguage(translate.language.getLocal());
  373. }
  374. });
  375. //// 文档内容加载完毕时触发
  376. function showMarkdownEnded() {
  377. refreshTranslate();
  378. infoTranslate(); //// 检查并提示翻译
  379. translate.execute(); //// 手动触发翻译,但是理论上 translate-js 会监听页面变化
  380. endLoad();
  381. document.querySelector('html').classList.add('loaded'); //// 防止缓存的页面被自定义 PJAX 中覆写的处理响应的函数捕获
  382. window.scrollTo({
  383. top: 0,
  384. behavior: 'smooth'
  385. });
  386. }
  387. //// 浏览器返回时触发
  388. window.onpopstate = function (event) {
  389. if (level > 1) {
  390. --level;
  391. }
  392. };
  393. })();
  394. </script>
  395. <title>加载中</title>
  396. <style>
  397. /* 全局 */
  398. * {
  399. font-family: 'Exo', sans-serif;
  400. text-decoration: none;
  401. }
  402. :root {
  403. background-color: #e6e6e6;
  404. }
  405. ::selection {
  406. background-color: #DCEDC8;
  407. }
  408. body {
  409. margin: 0;
  410. }
  411. a {
  412. color: #66BB6A;
  413. cursor: pointer;
  414. text-decoration: none;
  415. }
  416. a:hover {
  417. color: #2E7D32;
  418. }
  419. /* 背景 */
  420. .background {
  421. position: fixed;
  422. left: 0;
  423. top: 0;
  424. height: 100%;
  425. width: 100%;
  426. z-index: -1;
  427. background-color: #e6e6e6;
  428. }
  429. /* 导航栏 */
  430. nav {
  431. position: fixed;
  432. top: 0;
  433. right: 0;
  434. width: min-content;
  435. background-color: #616161;
  436. display: flex;
  437. justify-content: space-between;
  438. align-items: center;
  439. }
  440. nav a {
  441. color: #FAFAFA;
  442. padding: .3rem;
  443. transition:
  444. color .2s,
  445. background-color .2s;
  446. }
  447. nav a:hover {
  448. color: #FFF;
  449. background-color: #212121;
  450. }
  451. /* 主要内容 */
  452. .markdown-body {
  453. margin: 3rem auto;
  454. width: 100%;
  455. max-width: 950px;
  456. min-height: 300px;
  457. background-color: #FAFAFA;
  458. color: #212121;
  459. box-sizing: border-box;
  460. overflow-x: hidden;
  461. padding: 30px;
  462. box-shadow: 0 2px 6px rgba(100, 100, 100, .3);
  463. }
  464. .markdown-body img,
  465. .markdown-body video,
  466. .markdown-body iframe,
  467. .markdown-body object,
  468. .markdown-body embed,
  469. .markdown-body svg,
  470. .markdown-body canvas,
  471. .markdown-body audio {
  472. max-width: 100%;
  473. }
  474. /* Markdown 样式 */
  475. .markdown-body a {
  476. transition:
  477. color .2s,
  478. background-color .2s;
  479. }
  480. .markdown-body a:hover {
  481. background-color: rgba(255, 255, 255, 0.1);
  482. }
  483. .markdown-body ul,
  484. .markdown-body ol {
  485. padding-left: 2rem;
  486. }
  487. .markdown-body pre {
  488. background-color: rgba(0, 0, 0, 0.05);
  489. padding: .4rem;
  490. border-radius: .1rem;
  491. overflow-y: scroll;
  492. }
  493. .markdown-body code {
  494. font-family: "cousine nerd font mono", monospace;
  495. }
  496. .markdown-body p code {
  497. background-color: rgba(0, 0, 0, 0.05);
  498. font-size: small;
  499. padding: .2rem;
  500. border-radius: .1rem;
  501. }
  502. .markdown-body blockquote {
  503. background-color: rgba(0, 0, 0, 0.05);
  504. font-size: small;
  505. padding: .4rem;
  506. margin: .5rem 2rem;
  507. border-left: 5px solid rgba(0, 0, 0, 0.1);
  508. }
  509. .markdown-body details {
  510. border: 1px solid rgba(0, 0, 0, 0.1);
  511. border-radius: .1rem;
  512. }
  513. .markdown-body summary {
  514. cursor: pointer;
  515. background-color: rgba(0, 0, 0, 0.05);
  516. padding: .4rem;
  517. font-weight: bold;
  518. }
  519. .markdown-body summary code {
  520. cursor: text;
  521. }
  522. .markdown-body details a {
  523. margin-left: -2rem;
  524. }
  525. .markdown-body table {
  526. border-spacing: 0;
  527. border-radius: .1rem;
  528. width: 100%;
  529. border-collapse: separate;
  530. border: .1rem solid rgba(0, 0, 0, 0.05);
  531. }
  532. .markdown-body table td,
  533. .markdown-body table th {
  534. border-right: .1rem solid rgba(0, 0, 0, 0.05);
  535. }
  536. .markdown-body table td,
  537. .markdown-body table th {
  538. border-top: .1rem solid rgba(0, 0, 0, 0.05);
  539. }
  540. .markdown-body table td:last-child,
  541. .markdown-body th:last-child {
  542. border-right-color: transparent;
  543. }
  544. .markdown-body table thead tr:first-child>* {
  545. border-top: .1rem solid transparent;
  546. }
  547. /* 加载进度条 */
  548. .loading-bar {
  549. position: fixed;
  550. top: 0;
  551. left: 0;
  552. z-index: 99999;
  553. opacity: 0;
  554. transition: opacity .4s linear;
  555. .progress {
  556. position: fixed;
  557. top: 0;
  558. left: 0;
  559. width: 0;
  560. height: 4px;
  561. background-color: #FFF;
  562. box-shadow: 0 0 10px rgba(102, 187, 106, .7);
  563. }
  564. &.loading {
  565. opacity: 1;
  566. transition: none;
  567. .progress {
  568. transition: width .4s ease;
  569. }
  570. }
  571. }
  572. /* 翻译按钮相关 */
  573. .translateSelectLanguage {
  574. background-color: #616161;
  575. color: inherit;
  576. z-index: 10;
  577. width: 17%;
  578. height: 100%;
  579. opacity: 0;
  580. cursor: pointer;
  581. position: absolute;
  582. top: 0;
  583. left: 50%;
  584. }
  585. /* 深色模式相关 */
  586. .darkmode--activated .markdown-body img,
  587. .darkmode--activated .markdown-body svg {
  588. isolation: isolate;
  589. mix-blend-mode: difference
  590. }
  591. .darkmode-layer,
  592. .darkmode-toggle {
  593. z-index: 2
  594. }
  595. /* 小屏响应式优化 */
  596. @media only screen and (max-width: 950px) {
  597. html,
  598. body,
  599. .markdown-body {
  600. height: 100%;
  601. }
  602. .markdown-body {
  603. overflow-y: scroll;
  604. min-width: 256px;
  605. top: 0;
  606. margin: 0 0;
  607. }
  608. }
  609. </style>
  610. </head>
  611. <body>
  612. <!-- 导航栏 -->
  613. <nav>
  614. <a title="返回" class="back-btn">
  615. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  616. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  617. class="icon icon-tabler icons-tabler-outline icon-tabler-arrow-back">
  618. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  619. <path d="M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1" />
  620. </svg>
  621. </a>
  622. <a title="刷新" class="refresh-btn" href="">
  623. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  624. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  625. class="icon icon-tabler icons-tabler-outline icon-tabler-refresh">
  626. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  627. <path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" />
  628. <path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" />
  629. </svg>
  630. </a>
  631. <a title="主页" class="to-home">
  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-home">
  635. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  636. <path d="M5 12l-2 0l9 -9l9 9l-2 0" />
  637. <path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
  638. <path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" />
  639. </svg>
  640. </a>
  641. <a title="更改语言" id="translate">
  642. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  643. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  644. class="icon icon-tabler icons-tabler-outline icon-tabler-language">
  645. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  646. <path d="M4 5h7" />
  647. <path d="M9 3v2c0 4.418 -2.239 8 -5 8" />
  648. <path d="M5 9c0 2.144 2.952 3.908 6.7 4" />
  649. <path d="M12 20l4 -9l4 9" />
  650. <path d="M19.1 18h-6.2" />
  651. </svg>
  652. </a>
  653. <a title="切换显示模式" class="dark-btn" href="javascript:;">
  654. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  655. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  656. class="icon icon-tabler icons-tabler-outline icon-tabler-brightness">
  657. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  658. <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
  659. <path d="M12 3l0 18" />
  660. <path d="M12 9l4.65 -4.65" />
  661. <path d="M12 14.3l7.37 -7.37" />
  662. <path d="M12 19.6l8.85 -8.85" />
  663. </svg>
  664. </a>
  665. <a title="关于" href="https://github.com/PJ-568/markdown.html/">
  666. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
  667. stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
  668. class="icon icon-tabler icons-tabler-outline icon-tabler-info-circle">
  669. <path stroke="none" d="M0 0h24v24H0z" fill="none" />
  670. <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0" />
  671. <path d="M12 9h.01" />
  672. <path d="M11 12h1v4h1" />
  673. </svg>
  674. </a>
  675. </nav>
  676. <!-- 内容主体 -->
  677. <div class="markdown-body">
  678. <h1>加载中……</h1>
  679. <p>请稍等。</p>
  680. </div>
  681. <!-- 加载动画 -->
  682. <div class="loading-bar">
  683. <div class="progress"></div>
  684. </div>
  685. <div class="background"></div>
  686. <script src="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/instant.page/5.1.0/instantpage.min.js"
  687. type="text/javascript"></script>
  688. </body>
  689. </html>