diff --git a/README.md b/README.md index 29f67e6c..11edeaac 100644 --- a/README.md +++ b/README.md @@ -81,4 +81,4 @@ Check out the [Documentation](https://solitude.js.org/) for more information. ## License -[MIT](./LICENSE) License © 2023-PRESENT [Ever Fu](https://github.com/everfu) \ No newline at end of file +[MIT](./LICENSE) License © 2023-PRESENT [Ever Fu](https://github.com/everfu) diff --git a/README_zh-Hant.md b/README_zh-Hant.md index 8d42483e..0eeb4db6 100644 --- a/README_zh-Hant.md +++ b/README_zh-Hant.md @@ -79,4 +79,4 @@ ## 版權 -[MIT](./LICENSE) License © 2023-至今 [Efu](https://github.com/everfu) \ No newline at end of file +[MIT](./LICENSE) License © 2023-至今 [Efu](https://github.com/everfu) diff --git a/layout/includes/inject/body.pug b/layout/includes/inject/body.pug index 07e09eb3..60b05299 100644 --- a/layout/includes/inject/body.pug +++ b/layout/includes/inject/body.pug @@ -16,12 +16,12 @@ div script(src=url_for(theme.cdn.waterfall)) script(src=url_for(theme.cdn.pjax)) - if theme.mermaid - script(src=url_for(theme.cdn.mermaid_js)) - if theme.post.share.enable && theme.post.share.list && theme.post.share.list.includes('qrcode') script(src=url_for(theme.cdn.qrcode)) + if theme.mermaid + script(src=url_for(theme.cdn.mermaid_js)) + if theme.display_mode.universe script(src=url_for(theme.cdn.universe_js)) script. @@ -115,4 +115,4 @@ if theme.footer.randomlink include ../body/mode // google adsense -include ../body/gadsense \ No newline at end of file +include ../body/gadsense diff --git a/layout/includes/loading.pug b/layout/includes/loading.pug index 8af5e47b..4ad56975 100644 --- a/layout/includes/loading.pug +++ b/layout/includes/loading.pug @@ -4,22 +4,34 @@ div(id="loading-box" onclick="preloader.endLoading();" style="zoom:1") script. const preloader = { + isLoaded: false, endLoading: () => { - document.getElementById('loading-box').classList.toggle('loaded'); + if (!preloader.isLoaded) { + document.getElementById('loading-box').classList.add('loaded'); + preloader.isLoaded = true; + } }, initLoading: () => { document.getElementById('loading-box').classList.remove('loaded'); + preloader.isLoaded = false; }, removePaceDone: () => { document.getElementById('body').classList = 'pace-done'; } } + window.addEventListener('load', () => { preloader.endLoading(); }); + window.addEventListener('pjax:send', () => { preloader.initLoading(); }); + document.addEventListener('pjax:complete', () => { preloader.endLoading(); - }); \ No newline at end of file + }); + + setTimeout(() => { + preloader.endLoading(); + }, 5000); diff --git a/package.json b/package.json index acfcdb0c..c1dafdba 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-solitude", - "version": "2.0.4", + "version": "2.0.5", "description": "A beautiful, powerful, and efficient Hexo theme developed by EverFu.", "main": "package.json", "scripts": { @@ -19,8 +19,8 @@ "url": "https://github.com/everfu/hexo-theme-solitude" }, "dependencies": { - "hexo-renderer-stylus": "^3.0.0", - "hexo-renderer-pug": "^3.0.0" + "hexo-renderer-pug": "^3.0.0", + "hexo-renderer-stylus": "^3.0.0" }, "bugs": { "url": "https://github.com/everfu/hexo-theme-solitude/issues", @@ -28,5 +28,8 @@ }, "homepage": "https://everfu.github.io/Solitude/", "author": "Hexo-Theme-Solitude", - "license": "MIT" -} \ No newline at end of file + "license": "MIT", + "devDependencies": { + "@types/node": "^22.0.0" + } +} diff --git a/scripts/helper/stylus.js b/scripts/helper/stylus.js index 6b5c90aa..33646729 100644 --- a/scripts/helper/stylus.js +++ b/scripts/helper/stylus.js @@ -22,4 +22,4 @@ hexo.extend.filter.register('stylus:renderer', function (style) { style.define('$prismjs_enable', prismjsEnable) style.define('$prismjs_line_number', prismjsLineNumber) style.define('$language', config.language) -}); \ No newline at end of file +}); diff --git a/scripts/tags/btns.js b/scripts/tags/btns.js deleted file mode 100644 index 3ac6ce05..00000000 --- a/scripts/tags/btns.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -function postBtns(args, content) { - return `
- ${content} -
`; -} - -function postCell(args, content) { - args = args.join(" ").split(","); - let text = args[0] || ""; - let url = args[1] || ""; - text = text.trim(); - url = url.trim(); - if (url.length > 0) { - url = "href='" + url + "'"; - } - let icon = ""; - let img = "https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus/lib/assets/default.svg"; - if (args.length > 2) { - if (args[2].indexOf(" solitude") > -1) { - icon = args[2].trim(); - } else { - img = args[2].trim(); - } - } - if (icon.length > 0) { - return `${text}`; - } else { - return `${text}`; - } -} - -hexo.extend.tag.register("btns", postBtns, { ends: true }); -hexo.extend.tag.register("cell", postCell); \ No newline at end of file diff --git a/scripts/tags/button.js b/scripts/tags/button.js deleted file mode 100644 index 84cb905f..00000000 --- a/scripts/tags/button.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; - -const urlFor = require("hexo-util").url_for.bind(hexo); - -function btn(args) { - args = args.join(" ").split(","); - let url = args[0] || ""; - let text = args[1] || ""; - let icon = args[2] || ""; - let option = args[3] || ""; - - url = url.trim(); - text = text.trim(); - icon = icon.trim(); - option = option.trim(); - - return ``; -} - -hexo.extend.tag.register("btn", btn, { ends: false }); \ No newline at end of file diff --git a/scripts/tags/bvideo.js b/scripts/tags/bvideo.js deleted file mode 100644 index 1cc7cf4b..00000000 --- a/scripts/tags/bvideo.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict' - -function bilibili(args) { - return `` -} - -hexo.extend.tag.register('bvideo', bilibili, {ends: false}) diff --git a/scripts/tags/checkbox.js b/scripts/tags/checkbox.js deleted file mode 100644 index 555746dc..00000000 --- a/scripts/tags/checkbox.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -function postCheckbox(args) { - args = args.join(' ').split(',') - var cls = '' - var text = '' - var checked = false - if (args.length > 1) { - cls = (args[0] || '').trim() - if (cls.length > 0) { - cls = ' ' + cls - } - if (cls.indexOf('checked') > -1) { - checked = true - } - text = (args[1] || '').trim() - } else if (args.length > 0) { - text = (args[0] || '').trim() - } - if (text.length > 0) { - return `
- ${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')} -
` - } -} -function postRadio(args) { - args = args.join(' ').split(',') - var cls = '' - var text = '' - var checked = false - if (args.length > 1) { - cls = (args[0] || '').trim() - if (cls.length > 0) { - cls = ' ' + cls - } - if (cls.indexOf('checked') > -1) { - checked = true - } - text = (args[1] || '').trim() - } else if (args.length > 0) { - text = (args[0] || '').trim() - } - if (text.length > 0) { - return `
- ${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')} -
` - } -} - -hexo.extend.tag.register('checkbox', postCheckbox); -hexo.extend.tag.register('radio', postRadio); \ No newline at end of file diff --git a/scripts/tags/fold.js b/scripts/tags/fold.js deleted file mode 100644 index c4db6756..00000000 --- a/scripts/tags/fold.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' - -function postTabs(args, content) { - const title = args[0] ? args[0] : "" - const open = args[1] ? args[1] : "" - - return `
${title}
${hexo.render.renderSync({ - text: content, - engine: 'markdown' - })}
` -} - -hexo.extend.tag.register('fold', postTabs, {ends: true}) diff --git a/scripts/tags/image.js b/scripts/tags/image.js deleted file mode 100644 index f2e26e1c..00000000 --- a/scripts/tags/image.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -hexo.extend.tag.register('image', function(args) { - args = args.join(' ').split(','); - let url = args[0].trim(); - let alt = ''; - let bg = ''; - let style = ''; - if (args.length > 1) { - for (let i = 1; i < args.length; i++) { - let tmp = args[i].trim(); - if (tmp.includes('alt=')) { - alt = tmp.substring(4, tmp.length); - } else if (tmp.includes('width=')) { - style += 'width:' + tmp.substring(6, tmp.length) + ';'; - } else if (tmp.includes('height=')) { - style += 'height:' + tmp.substring(7, tmp.length) + ';'; - } else if (tmp.includes('bg=')) { - bg = tmp.substring(3, tmp.length); - } - } - } - function img(url, alt, style) { - let img = ''; - img += ' 0) { - img += ' alt="' + alt + '"'; - } - if (style.length > 0) { - img += ' style="' + style + '"'; - } - img += '/>'; - return img; - } - - let ret = ''; - ret += '
'; - ret += '
0) { - ret += ' style="background:' + bg + '"'; - } - ret += '>'; - ret += img(url, alt, style); - ret += '
'; - - if (alt.length > 0) { - ret += '' + alt + ''; - } - - ret += '
'; - return ret; -}); - -hexo.extend.tag.register('inlineimage', function(args) { - args = args.join(' ').split(', '); - let url = args[0].trim(); - let ret = ''; - ret += ' 1) { - for (let i = 1; i < args.length; i++) { - let tmp = args[i].trim(); - if (tmp.includes('height=')) { - style += 'height:' + tmp.substring(7, tmp.length) + ';'; - } - } - } - if (style.length > 0) { - ret += ' style="' + style + '"'; - } else { - ret += ' style="height:1.5em"'; - } - ret += '/>'; - return ret; -}); diff --git a/scripts/tags/inline-image.js b/scripts/tags/inline-image.js deleted file mode 100644 index f8c7e0ec..00000000 --- a/scripts/tags/inline-image.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const urlFor = require('hexo-util').url_for.bind(hexo) - -function inlineImg (args) { - const img = args[0] - const height = args[1] ? `style="height:${args[1]}"` : '' - - return `` -} - -hexo.extend.tag.register('inlineimage', inlineImg, { ends: false }) \ No newline at end of file diff --git a/scripts/tags/label.js b/scripts/tags/label.js deleted file mode 100644 index 1aa19373..00000000 --- a/scripts/tags/label.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -function addLabel (args, content) { - const text = args[0] - const className = args[1] || 'default' - - return ` ` -} - -hexo.extend.tag.register('label', addLabel, { ends: false }) \ No newline at end of file diff --git a/scripts/tags/link.js b/scripts/tags/link.js deleted file mode 100644 index 6251e175..00000000 --- a/scripts/tags/link.js +++ /dev/null @@ -1,50 +0,0 @@ -const urlFor = require("hexo-util").url_for.bind(hexo); -function link(args) { - const themeConfig = hexo.theme.config; - args = args.join(" ").split(","); - let title = args[0]; - let sitename = args[1]; - let link = args[2]; - let imgUrl = args[3] || ""; - let favicon = themeConfig.site.siteIcon; - let insideStation = false; - - link = link.trim(); - imgUrl = imgUrl.trim(); - favicon = favicon.trim(); - - try { - new URL(link); - insideStation = false; - } catch (err) { - insideStation = true; - } - - if ((imgUrl === "") && (insideStation === false)) { - let domain = new URL(link).hostname - if (domain) { - imgUrl_online = "https://api.iowen.cn/favicon/" + domain + ".png"; - } - } - - return ` - - - `; -} - -hexo.extend.tag.register("link", link, { ends: false }); \ No newline at end of file diff --git a/scripts/tags/media.js b/scripts/tags/media.js deleted file mode 100644 index e4cfdc09..00000000 --- a/scripts/tags/media.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -function postAudio(args) { - let src = args[0].trim() - return `
`; -} - -function postVideo(args) { - let src = args[0].trim() - return `
`; -} - -function postVideos(args, content) { - args = args.join(' ').split(',') - var cls = args[0] - if (cls.length > 0) { - cls = ' ' + cls - } - var col = Number(args[1]) || 0; - if (col > 0) { - return `
${content}
` - } else { - return `
${content}
` - } -} - -hexo.extend.tag.register('audio', postAudio); -hexo.extend.tag.register('video', postVideo); -hexo.extend.tag.register('videos', postVideos, {ends: true}); \ No newline at end of file diff --git a/scripts/tags/mermaid.js b/scripts/tags/mermaid.js index 21c4d82d..5f5e8683 100644 --- a/scripts/tags/mermaid.js +++ b/scripts/tags/mermaid.js @@ -6,4 +6,4 @@ function postMermaid(args, content) { return `
${escapeHTML(content)}
`; } -hexo.extend.tag.register('mermaid', postMermaid, {ends: true}); \ No newline at end of file +hexo.extend.tag.register('mermaid', postMermaid, {ends: true}); diff --git a/scripts/tags/note.js b/scripts/tags/note.js deleted file mode 100644 index 9ca6316b..00000000 --- a/scripts/tags/note.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * note.js - * transplant from hexo-theme-next - * modified by @efu - */ - -hexo.extend.tag.register('note', function (types, content) { - let type = "" - for (let i = 0; i < types.length; i++) { - type += " " + types[i] - } - return `
${hexo.render.renderSync({text: content, engine: 'markdown'})}
` -}, {ends: true}); \ No newline at end of file diff --git a/scripts/tags/span.js b/scripts/tags/span.js deleted file mode 100644 index 45ead4ac..00000000 --- a/scripts/tags/span.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -function postP(args) { - args = args.join(' ').split(',') - let p0 = args[0].trim() - let p1 = args[1].trim() - return `

${p1}

`; -} -function postSpan(args) { - args = args.join(' ').split(',') - let p0 = args[0].trim() - let p1 = args[1].trim() - return `${p1}`; -} - -hexo.extend.tag.register('p', postP); -hexo.extend.tag.register('span', postSpan); \ No newline at end of file diff --git a/scripts/tags/tabs.js b/scripts/tags/tabs.js index 3202aecd..77a892e1 100644 --- a/scripts/tags/tabs.js +++ b/scripts/tags/tabs.js @@ -5,20 +5,18 @@ 'use strict' -function postTabs (args, content) { +function postTabs ([name, active], content) { const tabBlock = /\n([\w\W\s\S]*?)/g - args = args.join(' ').split(',') - const tabName = args[0] - const tabActive = Number(args[1]) || 0 - const matches = [] let match let tabId = 0 let tabNav = '' let tabContent = '' - !tabName && hexo.log.warn('Tabs block must have unique name!') + if (typeof active === 'undefined') { + active = 0 + } while ((match = tabBlock.exec(content)) !== null) { matches.push(match[1]) @@ -33,29 +31,27 @@ function postTabs (args, content) { let tabHref = '' postContent = hexo.render.renderSync({ text: postContent, engine: 'markdown' }).trim() + tabHref = (name + ' ' + tabId).toLowerCase().split(' ').join('-'); - tabId += 1 - tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-'); - - ((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId) + ((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = name + ' ' + tabId) const isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? ' style="text-align: center;"' : '' const icon = tabIcon.trim() tabIcon.length > 0 && (tabIcon = ``) - const toTop = '' - - const isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : '' + const toTop = '' + const isActive = active === tabId ? ' active' : '' tabNav += `
  • ` tabContent += `
    ${postContent + toTop}
    ` + tabId += 1 } tabNav = `` tabContent = `
    ${tabContent}
    ` - return `
    ${tabNav + tabContent}
    ` + return `
    ${tabNav + tabContent}
    ` } hexo.extend.tag.register('tabs', postTabs, { ends: true }) hexo.extend.tag.register('subtabs', postTabs, { ends: true }) -hexo.extend.tag.register('subsubtabs', postTabs, { ends: true }) \ No newline at end of file +hexo.extend.tag.register('subsubtabs', postTabs, { ends: true }) diff --git a/scripts/tags/timeline.js b/scripts/tags/timeline.js deleted file mode 100644 index cd41d7bc..00000000 --- a/scripts/tags/timeline.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict" - -function postTimeline(args, content) { - if (args.length > 0) { - return `

    ${args}

    ${content}
    `; - } else { - return `
    ${content}
    `; - } -} - -function postTimenode(args, content) { - args = args.join(" ").split(","); - var time = args[0]; - return `

    ${time}

    ${hexo.render - .renderSync({ text: content, engine: "markdown" }) - .split("\n") - .join("")}
    `; -} - -hexo.extend.tag.register("timeline", postTimeline, { ends: true }); - -hexo.extend.tag.register("timenode", postTimenode, { ends: true }); \ No newline at end of file diff --git a/source/css/_tags/btns.styl b/source/css/_tags/btns.styl deleted file mode 100644 index 1a45b703..00000000 --- a/source/css/_tags/btns.styl +++ /dev/null @@ -1,212 +0,0 @@ -[data-theme="dark"] - div - &.btns - filter brightness(0.7) - a - background 0 0 -div - &.btns - margin 0 -8px - display flex - flex-wrap wrap - align-items flex-start - overflow visible - line-height 1.8 - b - font-size 0.875rem - &.wide - & > a - padding-left 32px - padding-right 32px - &.fill - & > a - flex-grow 1 - width auto - &.around - justify-content space-around - &.center - justify-content center - &.grid2 - & > a - width calc(100% / 2 - 16px) - &.grid3 - & > a - width calc(100% / 3 - 16px) - &.grid4 - & > a - width calc(100% / 4 - 16px) - &.grid5 - & > a - width calc(100% / 5 - 16px) - a - transition all 0.28s ease - -moz-transition all 0.28s ease - -webkit-transition all 0.28s ease - -o-transition all 0.28s ease - margin 8px - margin-top calc(1.25 * 16px + 32px) - min-width 120px - font-weight bold - display flex - justify-content flex-start - align-content center - align-items center - flex-direction column - padding 8px - text-align center - background #f6f6f6 - border-radius 4px - border-bottom none!important - & > i - background #2196f3!important - &:first-child - color #fff - background #2196f3 - b - font-weight bold - line-height 1.3 - img - margin 0.4em auto !important - &:not([href]) - cursor default - color inherit - a[href]:hover - background: var(--efu-main) - color: var(--efu-white) !important - & > i - &:first-child - background: var(--efu-main) - -div.btns, -div.btns p, -div.btns a - font-size 0.8125rem - color #555 - -@media screen and (max-width: 1200px) - div - &.btns - &.grid2 - & > a - width calc(100% / 2 - 16px) - -@media screen and (max-width: 768px) - div - &.btns - &.grid2 - & > a - width calc(100% / 2 - 16px) - -@media screen and (max-width: 500px) - div - &.btns - &.grid2 - & > a - width calc(100% / 1 - 16px) - -@media screen and (max-width: 1200px) - div - &.btns - &.grid3 - & > a - width calc(100% / 3 - 16px) - -@media screen and (max-width: 768px) - div - &.btns - &.grid3 - & > a - width calc(100% / 3 - 16px) - -@media screen and (max-width: 500px) - div - &.btns - &.grid3 - & > a - width calc(100% / 1 - 16px) - -@media screen and (max-width: 1200px) - div - &.btns - &.grid4 - & > a - width calc(100% / 3 - 16px) - -@media screen and (max-width: 768px) - div - &.btns - &.grid4 - & > a - width calc(100% / 3 - 16px) - -@media screen and (max-width: 500px) - div - &.btns - &.grid4 - & > a - width calc(100% / 2 - 16px) - -@media screen and (max-width: 1200px) - div - &.btns - &.grid5 - & > a - width calc(100% / 4 - 16px) - -@media screen and (max-width: 768px) - div - &.btns - &.grid5 - & > a - width calc(100% / 3 - 16px) - -@media screen and (max-width: 500px) - div - &.btns - &.grid5 - & > a - width calc(100% / 2 - 16px) - -div.btns a > img:first-child, -div.btns a > i:first-child - transition all 0.28s ease - -moz-transition all 0.28s ease - -webkit-transition all 0.28s ease - -o-transition all 0.28s ease - height 64px - width 64px - box-shadow 0 1px 2px 0 rgba(0, 0, 0, 0.1) - margin 16px 8px 4px 8px - margin-top calc(-1.25 * 16px - 32px) - border 2px solid #fff - background #fff - line-height 60px - font-size 28px - -div.btns a > img:first-child.auto, -div.btns a > i:first-child.auto - width auto - -div.btns a p, -div.btns a b - margin 0.25em - font-weight normal - line-height 1.25 - word-wrap break-word - -div.btns a[href]:hover, -div.btns a[href]:hover b - color #ff5722 - -div.btns a[href]:hover > img:first-child, -div.btns a[href]:hover > i:first-child - transform scale(1.1) translateY(-8px) - box-shadow 0 4px 8px 0 rgba(0, 0, 0, 0.1) - -div.btns.circle a > img:first-child, -div.btns.circle a > i:first-child - border-radius 32px - -div.btns.rounded a > img:first-child, -div.btns.rounded a > i:first-child - border-radius 16px \ No newline at end of file diff --git a/source/css/_tags/button.styl b/source/css/_tags/button.styl deleted file mode 100644 index 36784177..00000000 --- a/source/css/_tags/button.styl +++ /dev/null @@ -1,40 +0,0 @@ -#article-container - .btn-sco - position relative - padding 8px 15px - text-transform uppercase - border var(--style-border) - border-radius 10px - overflow hidden - transition all 0.3s - display inline-flex - justify-content center - align-items center - - &.outline - background var(--efu-white) - color var(--efu-main) - border-color var(--efu-main) - - &:hover - background var(--efu-main) - color var(--efu-white) - border-color var(--efu-main) - - i - transition all 0.3s - padding-right 8px - - span - transition all 0.3s - - &:hover - background var(--efu-main) - - span - transform all 0.3s ease-in-out - color var(--efu-white) - - i - transform all 0.3s ease-in-out - color var(--efu-white) \ No newline at end of file diff --git a/source/css/_tags/checkbox.styl b/source/css/_tags/checkbox.styl deleted file mode 100644 index bc7b4ed0..00000000 --- a/source/css/_tags/checkbox.styl +++ /dev/null @@ -1,204 +0,0 @@ -.checkbox - display flex - align-items center - - input - appearance none - position relative - height 16px - width 16px - transition all .15s ease-out 0s - cursor pointer - display inline-block - outline 0 - border-radius 2px - flex-shrink 0 - margin-right 8px - border 2px solid #2196f3 - pointer-events none - - &[type=checkbox] - &:before - left 1px - top 5px - width 0 - height 2px - transition all .2s ease-in - transform rotate(45deg) - - &:after - right 7px - bottom 3px - width 2px - height 0 - transition all .2s ease-out - transform rotate(40deg) - transition-delay .25s - - &:checked - background #2196f3 - - &:checked:before - left 0 - top 7px - width 6px - height 2px - - &:checked:after - right 3px - bottom 1px - width 2px - height 10px - - &.minus - input[type=checkbox]:before - transform rotate(0) - left 1px - top 5px - width 0 - height 2px - - input[type=checkbox]:after - transform rotate(0) - left 1px - top 5px - width 0 - height 2px - - input[type=checkbox]:checked:before - left 1px - top 5px - width 10px - height 2px - - input[type=checkbox]:checked:after - left 1px - top 5px - width 10px - height 2px - - &.plus - input[type=checkbox]:before - transform rotate(0) - left 1px - top 5px - width 0 - height 2px - - input[type=checkbox]:after - transform rotate(0) - left 5px - top 1px - width 2px - height 0 - - input[type=checkbox]:checked:before - left 1px - top 5px - width 10px - height 2px - - input[type=checkbox]:checked:after - left 5px - top 1px - width 2px - height 10px - - &.times - input[type=checkbox]:before - transform rotate(45deg) - left 3px - top 1px - width 0 - height 2px - - input[type=checkbox]:after - transform rotate(135deg) - right 3px - top 1px - width 0 - height 2px - - input[type=checkbox]:checked:before - left 1px - top 5px - width 10px - height 2px - - input[type=checkbox]:checked:after - right 1px - top 5px - width 10px - height 2px - - input[type=radio] - border-radius 50% - - &:before - content "" - display block - width 8px - height 8px - border-radius 50% - margin 2px - transform scale(0) - transition all .25s ease-out - - &:checked:before - transform scale(1) - background var(--text-bg-hover) - - &.red input - border-color #fe5f58 - - &[type=checkbox]:checked - background #fe5f58 - - &[type=radio]:checked:before - background #fe5f58 - - &.green input - border-color #3dc550 - - &[type=checkbox]:checked - background #3dc550 - - &[type=radio]:checked:before - background #3dc550 - - &.yellow input - border-color #ffbd2b - - &[type=checkbox]:checked - background #ffbd2b - - &[type=radio]:checked:before - background #ffbd2b - - &.cyan input - border-color #1bcdfc - - &[type=checkbox]:checked - background #1bcdfc - - &[type=radio]:checked:before - background #1bcdfc - - &.blue input - border-color #2196f3 - - &[type=checkbox]:checked - background #2196f3 - - &[type=radio]:checked:before - background #2196f3 - - p - display: inline-block - margin-top 2px !important - margin-bottom 0 !important - - input[type=checkbox]:after, input[type=checkbox]:before - position absolute - content "" - background #fff diff --git a/source/css/_tags/fold.styl b/source/css/_tags/fold.styl deleted file mode 100644 index 020f216e..00000000 --- a/source/css/_tags/fold.styl +++ /dev/null @@ -1,65 +0,0 @@ -details - display: block - position: relative - margin-bottom: 1rem - min-height: 54px - overflow: hidden - border-radius: 12px - border: var(--style-border) - transition: border .3s -details:hover - border: var(--style-border-hover-always) -details summary - position: absolute - padding: .5rem 1rem - background: var(--efu-card-bg) - margin: 0 - transition: .3s - box-shadow: var(--efu-shadow-border) - left: 0 - width: 100% - font-weight: 700 - white-space: nowrap - overflow: hidden - text-overflow: ellipsis -details>:nth-child(2) - margin-top: calc(54px + 1rem)!important -details[open] summary - background: var(--efu-lighttext) - color: var(--efu-card-bg) -details summary::before - content: '' - padding: 4px -details summary:hover - cursor: pointer - background: var(--efu-lighttext) - color: var(--efu-card-bg) - transition: .3s - box-shadow: var(--efu-shadow-main) -details summary:focus - outline: 0 -details summary::marker - color: var(--efu-lighttext) - transition: .3s -details[open] summary::marker - color: var(--efu-card-bg) -details summary:hover::marker - color: var(--efu-card-bg) -details[open] - border-radius: 12px - border: var(--style-border-hover-always) - padding: 0 1.5rem - background: var(--efu-card-bg) -details summary:hover:after - position: absolute - content: '+' - text-align: center - top: calc(50% - 2px) - transform: translateY(-50%) - right: 16px - line-height: 1 -details[open]>summary:hover:after - content: '-' -@media screen and (max-width: 768px) - details[open] - padding:0 16px \ No newline at end of file diff --git a/source/css/_tags/image.styl b/source/css/_tags/image.styl deleted file mode 100644 index 24098036..00000000 --- a/source/css/_tags/image.styl +++ /dev/null @@ -1,4 +0,0 @@ -#article-container - .inline-img - display inline-block - margin 0 \ No newline at end of file diff --git a/source/css/_tags/index.styl b/source/css/_tags/index.styl deleted file mode 100644 index 345932eb..00000000 --- a/source/css/_tags/index.styl +++ /dev/null @@ -1,63 +0,0 @@ -.red - color var(--efu-red) - -.green - color var(--efu-green) - -.blue - color var(--efu-blue) - -.yellow - color var(--efu-yellow) - -.pink - color var(--efu-pink) - -.purple - color var(--efu-purple) - -.orange - color var(--efu-orange) - -.bg-red - background-color var(--efu-red) - color var(--efu-white) - -.bg-green - background-color var(--efu-green) - color var(--efu-white) - -.bg-blue - background-color var(--efu-blue) - color var(--efu-white) - -.bg-yellow - background-color var(--efu-yellow) - -.bg-pink - background-color var(--efu-pink) - color var(--efu-white) - -.bg-purple - background-color var(--efu-purple) - color var(--efu-white) - -.bg-orange - background-color var(--efu-orange) - color var(--efu-white) - -.block - display block - -.center - margin 0 auto - -.right - margin-left auto - -.larger - font-size 1.5rem - margin 5px - - i - transform scale(1.5) \ No newline at end of file diff --git a/source/css/_tags/label.styl b/source/css/_tags/label.styl deleted file mode 100644 index 26a3df86..00000000 --- a/source/css/_tags/label.styl +++ /dev/null @@ -1,4 +0,0 @@ -#article-container - .hl-label - padding 2px 4px - border-radius 3px \ No newline at end of file diff --git a/source/css/_tags/link.styl b/source/css/_tags/link.styl deleted file mode 100644 index ce6b8e3b..00000000 --- a/source/css/_tags/link.styl +++ /dev/null @@ -1,59 +0,0 @@ -#article-container - a.tag-link - background var(--efu-secondbg) - border-radius 8px !important - display flex - border var(--style-border) - flex-direction column - padding 0.5rem 1rem - border-width 1px - margin 1rem 0 - - &:hover - background var(--efu-main) - border var(--style-border-hover) !important - - .tag-link-tips - color var(--efu-white) - - i - opacity 1 - - i - transition .3s - margin-left auto - opacity .6 - - .tag-link-bottom - display flex - margin-top 0.5rem - align-items center - justify-content space-around - - .tag-link-left - width 60px - min-width 60px - height 60px - background-size cover - border-radius 8px - background-color var(--efu-card-bg) - display flex - align-items center - justify-content center - - i - padding 0 - margin auto - font-size 24px - color var(--efu-fontcolor) - - .tag-link-right - margin-left 1rem - max-width calc(100% - 76px - 1rem) - - .tag-link-tips - border-bottom var(--style-border) - padding-bottom 4px - font-size 12px - color var(--efu-gray) - font-weight 400 \ No newline at end of file diff --git a/source/css/_tags/media.styl b/source/css/_tags/media.styl deleted file mode 100644 index fb7bc881..00000000 --- a/source/css/_tags/media.styl +++ /dev/null @@ -1,57 +0,0 @@ -trans($time = 0.28s) - transition: all $time ease - -moz-transition: all $time ease - -webkit-transition: all $time ease - -o-transition: all $time ease - -audio,video - border-radius: 4px - max-width: 100% -video - z-index: 1 - trans() - &:hover - box-shadow: 0 4px 8px 0px rgba(0, 0, 0, 0.24), 0 8px 16px 0px rgba(0, 0, 0, 0.24) - -div.video - line-height: 0 - text-align: center - -div.videos - max-width: "calc(100% + 2 * %s)" % 4px - display: flex - flex-wrap: wrap - justify-content: flex-start - align-items: flex-end - margin: 1em 0 - 4px - .video,iframe - width: 100% - margin: 4px - - iframe - border-radius: 4px - width: 100% - min-height: 300px - &.left - justify-content: flex-start - &.center - justify-content: center - &.right - justify-content: flex-end - &.stretch - align-items: stretch - &[col='1'] - .video,iframe - width: 100% - &[col='2'] - .video,iframe - width: "calc(50% - 2 * %s)" % 4px - &[col='3'] - .video,iframe - width: "calc(33.33% - 2 * %s)" % 4px - &[col='4'] - .video,iframe - width: "calc(25% - 2 * %s)" % 4px -[data-theme="dark"] - audio,video - filter brightness(0.7) diff --git a/source/css/_tags/mermaid.styl b/source/css/_tags/mermaid.styl index a8984f81..3d05d6f5 100644 --- a/source/css/_tags/mermaid.styl +++ b/source/css/_tags/mermaid.styl @@ -3,4 +3,4 @@ justify-content center text - fill var(--efu-fontcolor) !important \ No newline at end of file + fill var(--efu-fontcolor) !important diff --git a/source/css/_tags/note.styl b/source/css/_tags/note.styl deleted file mode 100644 index 2e83e10f..00000000 --- a/source/css/_tags/note.styl +++ /dev/null @@ -1,104 +0,0 @@ -$colors = { - info: #428bca, - danger: #d9534f, - primary: #6f42c1, - warning: #f0ad4e, - success: #5cb85c, - default: #777 -} - -.note - position relative - margin .5rem 0 - padding 15px - border-radius 3px - - &.default:not(.no-icon)::before - content: '\e0a9' - - &.info:not(.no-icon)::before - content: '\e0a7' - - &.danger:not(.no-icon)::before - content: '\e0aa' - - &.primary:not(.no-icon)::before - content: '\e0a8' - - &.warning:not(.no-icon)::before - content: '\e0a5' - - &.success:not(.no-icon)::before - content: '\e0a4' - - &::before - font-family 'solitude' - - &.icon - padding-left 2.25rem - - > .note-icon - position absolute - top calc(50% - .4rem) - left .7rem - font-size larger - - a - color inherit !important - &:hover - color var(--efu-white) !important - - for $color, $value in $colors - &.{$color}:not(.no-icon)::before - color $value - &.{$color}:not(.disabled) - border-left-color $value - - &.modern - color $value - - &:not(.simple) - background lighten($value, 75%) - - > .note-icon - color $value - - &.simple - border-width 1px 1px 1px 5px - border-style solid - border-color #eee - border-image initial - - &.modern - background-color #f5f5f5 - color #4c4948 - border 1px solid transparent !important - - &.flat - border initial - border-image initial - border-left 5px solid #eee - background-color #f9f9f9 - color #4c4948 - - h2, h3, h4, h5, h6 - margin-top 3px - margin-bottom 0 - border-bottom initial - padding-top 0 - - blockquote:first-child, img:first-child, ol:first-child, p:first-child, pre:first-child, table:first-child, ul:first-child - margin-top 0 !important - - blockquote:last-child, img:last-child, ol:last-child, p:last-child, pre:last-child, table:last-child, ul:last-child - margin-bottom 0 !important - font-size 14px !important - - &:not(.no-icon) - padding-left 2.25rem - - &::before - position absolute - top calc(50% - 19px) - left .7rem - font-size larger \ No newline at end of file diff --git a/source/css/_tags/span.styl b/source/css/_tags/span.styl deleted file mode 100644 index 85ae6b60..00000000 --- a/source/css/_tags/span.styl +++ /dev/null @@ -1,34 +0,0 @@ -#article-container - .p - &.left - text-align left - - &.center - text-align center - - &.right - text-align right - - &.small - font-size .5rem - - &.h1 - font-size 2.5rem - - &.h2 - font-size 1.625rem - - &.h3 - font-size 1.375rem - - &.h4 - font-size 1.125rem - - &.large - font-size 1.5rem - - &.huge - font-size 4rem - - &.ultra - font-size 6rem \ No newline at end of file diff --git a/source/css/_tags/tabs.styl b/source/css/_tags/tabs.styl index bec3a4f4..7e215e9f 100644 --- a/source/css/_tags/tabs.styl +++ b/source/css/_tags/tabs.styl @@ -96,7 +96,7 @@ > .tab-contents .tab-item-content.active animation tabshow 0s -webkit-animation tabshow 0s - padding 1.2rem 1.2rem + padding 1.2rem border-radius 8px +maxWidth768() diff --git a/source/css/_tags/timeline.styl b/source/css/_tags/timeline.styl deleted file mode 100644 index c9861866..00000000 --- a/source/css/_tags/timeline.styl +++ /dev/null @@ -1,82 +0,0 @@ -div.timenode - position relative - - &:before, - &:after - content '' - z-index 1 - position absolute - background var(--efu-theme) - width 2px - left 7px - - &:before - top 0 - height 6px - - &:after - top 26px - height 100% - - &:last-child:after - height calc(100% - 26px - 16px) - border-bottom-left-radius 2px - border-bottom-right-radius 2px - - .meta - position relative - line-height 32px - height 32px - left 27px - - &:before, - &:after - content '' - position absolute - top 8px - z-index 2 - left -27px - - &:before - background var(--efu-theme) - width 16px - height 16px - border-radius 8px - - &:after - background var(--efu-card-bg) - margin-left 2px - margin-top 2px - width 12px - height 12px - border-radius 6px - transform scale(0.5) - transition all 0.28s ease - - p - font-weight 500 - margin 0 0 0 24px - - .body - margin 4px 0 16px 24px - padding 16px - border-radius 8px - background var(--blockquote-bg) - - p - margin 0 !important - - p:first-child - margin-top 0 - - p:last-child - margin-bottom 0 - - &:hover - .meta - &:before - background var(--efu-theme) - - &:after - background var(--efu-theme-op) - transform scale(1) \ No newline at end of file diff --git a/source/js/main.js b/source/js/main.js index 123c26af..7227a6a7 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -465,7 +465,7 @@ const addHighlight = () => { const expandClass = !expand === true ? 'closed' : '' const $syntaxHighlight = syntax === 'highlight.js' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]') if (!(($isShowTool || limit) && $syntaxHighlight.length)) return - const copyEle = copy ? `` : ''; + const copyEle = copy ? `` : ''; const expandEle = ``; const limitEle = limit ? `` : ''; const alertInfo = (ele, text) => utils.snackbarShow(text, false, 2000) @@ -713,4 +713,4 @@ window.onkeydown = e => { }; document.addEventListener('copy', () => { utils.snackbarShow(GLOBAL_CONFIG.lang.copy.success, false, 3000); -}); \ No newline at end of file +});