1
0

index.html 24 KB

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