diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 232f664..b19c2b7 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -29,11 +29,11 @@ module.exports = { var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();`], - ['script', { - "language": "javascript", - "type": "text/javascript", - "src": "https://limeng-blog.oss-cn-hangzhou.aliyuncs.com/sakura.js" - }] + // ['script', { + // "language": "javascript", + // "type": "text/javascript", + // "src": "https://limeng-blog.oss-cn-hangzhou.aliyuncs.com/sakura.js" + // }] ], markdown: { lineNumbers: true, diff --git a/docs/.vuepress/styles/palette.styl b/docs/.vuepress/styles/palette.styl index 9386d53..cb2cf79 100644 --- a/docs/.vuepress/styles/palette.styl +++ b/docs/.vuepress/styles/palette.styl @@ -1,8 +1,10 @@ // 默认值 //$accentColor = #73acd9 // 主题颜色 //$textColor = #366693 // 文本颜色 -$accentColor = #f883c5 // 主题颜色 -$textColor = #f3087d // 文本颜色 +//$accentColor = #f883c5 // 主题颜色 +//$textColor = #f3087d // 文本颜色 +$accentColor = #f1aeca // 主题颜色 +$textColor = #f1aeca // 文本颜色 $borderColor = #f1aeca // 边框线颜色 $codeBgColor = #56585d // 代码块背景色 $backgroundColor = #f1aeca // 悬浮块背景色 diff --git a/docs/.vuepress/theme/components/HomeBlog.vue b/docs/.vuepress/theme/components/HomeBlog.vue index 7b55823..ac6538b 100644 --- a/docs/.vuepress/theme/components/HomeBlog.vue +++ b/docs/.vuepress/theme/components/HomeBlog.vue @@ -78,8 +78,6 @@ - - diff --git a/docs/.vuepress/theme/components/Mode/applyMode.js b/docs/.vuepress/theme/components/Mode/applyMode.js index 44d9a89..196d37a 100644 --- a/docs/.vuepress/theme/components/Mode/applyMode.js +++ b/docs/.vuepress/theme/components/Mode/applyMode.js @@ -1,10 +1,27 @@ import modeOptions from './modeOptions' function render (mode) { + + switch (mode){ + case 'dark': + case 'light': + var script1=document.createElement('script');//创建script标签节点 + script1.setAttribute('type','text/javascript');//设置script类型 + script1.setAttribute('src','https://limeng-blog.oss-cn-hangzhou.aliyuncs.com/sakura.js');//设置js地址 + document.body.appendChild(script1);//将js追加为body的子标签 + } + const rootElement = document.querySelector(':root') const options = modeOptions[mode] - const opposite = mode === 'dark' ? 'light' : 'dark' - + let temp = 'dark' + switch (mode){ + case 'dark': + case 'simple': + case 'light': + temp = mode + } + // const opposite = mode === 'dark' ? 'light' : 'dark' + const opposite = temp for (const k in options) { rootElement.style.setProperty(k, options[k]) } @@ -26,11 +43,13 @@ export default function applyMode (mode) { const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches + const isSimpleMode = window.matchMedia('(prefers-color-scheme: simple)').matches if (isDarkMode) render('dark') if (isLightMode) render('light') + if (isSimpleMode) render('simple') - if (!isDarkMode && !isLightMode) { + if (!isDarkMode && !isLightMode && !isSimpleMode) { console.log('You specified no preference for a color scheme or your browser does not support it. I schedule dark mode during night time.') const hour = new Date().getHours() if (hour < 6 || hour >= 18) render('dark') diff --git a/docs/.vuepress/theme/components/Mode/modeOptions.js b/docs/.vuepress/theme/components/Mode/modeOptions.js index bb30b0f..b90c3f9 100644 --- a/docs/.vuepress/theme/components/Mode/modeOptions.js +++ b/docs/.vuepress/theme/components/Mode/modeOptions.js @@ -1,4 +1,24 @@ const modeOptions = { + simple: { + '--default-color-10': 'rgba(255, 255, 255, 1)', + '--default-color-9': 'rgba(255, 255, 255, .9)', + '--default-color-8': 'rgba(255, 255, 255, .8)', + '--default-color-7': 'rgba(255, 255, 255, .7)', + '--default-color-6': 'rgba(255, 255, 255, .6)', + '--default-color-5': 'rgba(255, 255, 255, .5)', + '--default-color-4': 'rgba(255, 255, 255, .4)', + '--default-color-3': 'rgba(255, 255, 255, .3)', + '--default-color-2': 'rgba(255, 255, 255, .2)', + '--default-color-1': 'rgba(255, 255, 255, .1)', + '--background-color': '#fff', + '--box-shadow': '0 1px 8px 0 rgba(0, 0, 0, 0.1)', + '--box-shadow-hover': '0 2px 16px 0 rgba(0, 0, 0, 0.2)', + '--text-color': '#242424', + '--text-color-sub': '#7F7F7F', + '--border-color': '#eaecef', + '--code-color': 'rgba(27, 31, 35, 0.05)', + '--mask-color': '#888' + }, light: { '--default-color-10': 'rgba(255, 255, 255, 1)', '--default-color-9': 'rgba(255, 255, 255, .9)', diff --git a/docs/.vuepress/theme/components/NoteAbstractItem.vue b/docs/.vuepress/theme/components/NoteAbstractItem.vue index 2be0f5f..4ad409f 100644 --- a/docs/.vuepress/theme/components/NoteAbstractItem.vue +++ b/docs/.vuepress/theme/components/NoteAbstractItem.vue @@ -2,9 +2,10 @@
+
-
+
{{item.title}}
@@ -27,7 +28,7 @@ export default {