diff --git a/docs/About/index.en.md b/docs/About/index.en.md index b632809b3..c314e4d94 100644 --- a/docs/About/index.en.md +++ b/docs/About/index.en.md @@ -51,7 +51,7 @@ Subscribe [RSS Link1](../feed_rss_updated.xml)(sorted in updated date) for lates Theme color changes: -- Sun: deep purple +- Sun: purple - Mon: grey - Tue: blue grey - Sat: teal diff --git a/docs/About/index.md b/docs/About/index.md index af78c90ed..1bdd15b3f 100644 --- a/docs/About/index.md +++ b/docs/About/index.md @@ -65,7 +65,7 @@ hide: ### 颜色彩蛋 随着星期几的变化,本站的主题色会随之改变: -- 周日:deep purple +- 周日:purple - 周一:grey - 周二:blue grey - 周三:teal diff --git a/docs/assets/javascripts/color.js b/docs/assets/javascripts/color.js index 1d51178e2..c205d0987 100644 --- a/docs/assets/javascripts/color.js +++ b/docs/assets/javascripts/color.js @@ -1,23 +1,22 @@ -function changeColorByWeekday(){ - var date=new Date(); +function changeColorByWeekday() { + var date = new Date(); // 0-6代表周日到周六 - var day=date.getDay(); - var schemes=new Array("sun","mon","tues","wed","thur","fri","sat",); - var colors=new Array("deep purple","grey","blue grey","teal","indigo","pink","deep purple"); + var day = date.getDay() + 1; + var schemes = new Array("placeholder", "sun", "mon", "tues", "wed", "thur", "fri", "sat"); + var colors = new Array("white", "purple", "grey", "blue grey", "teal", "indigo", "pink", "deep-purple"); if (document.body.getAttribute("data-md-color-scheme") != schemes[day]) { document.body.setAttribute("data-md-color-scheme", schemes[day]); + document.body.setAttribute("data-md-color-primary", colors[day]); var local_json = { 'index': day, 'color': { - "scheme":schemes[day], - "primary":colors[day], - "accent":"orange" + "scheme": schemes[day], + "primary": colors[day], + "accent": "orange" } }; // 把更改存储到本地 window.localStorage.setItem('/.__palette', JSON.stringify(local_json)); - // 刷新页面 - location.reload(); } } diff --git a/docs/assets/stylesheets/extra.css b/docs/assets/stylesheets/extra.css index 3b422a08c..35ce4a1b2 100644 --- a/docs/assets/stylesheets/extra.css +++ b/docs/assets/stylesheets/extra.css @@ -1,3 +1,13 @@ +/* 添加颜色改变的过渡效果 */ +header.md-header { + transition: background-color 1s ease; +} + +nav.md-tabs { + transition: background-color 1s ease; + +} + /* termynal组件 */ .termynal-comment { color: #4a968f; diff --git a/mkdocs.yml b/mkdocs.yml index 7c6baafe3..441903264 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,9 +14,12 @@ theme: name: material custom_dir: overrides logo: assets/images/summation.png - palette: # 一周七天,六种颜色 + palette: # 一周七天不同颜色,白色占位 + - scheme: placeholder + primary: white + accent: orange - scheme: sun - primary: deep purple + primary: purple accent: orange - scheme: mon primary: grey @@ -34,7 +37,7 @@ theme: primary: pink accent: orange - scheme: sat - primary: deep purple + primary: deep-purple accent: orange features: