mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
1. 完善gitalk 在 dark mode下的顯示
2. 完善footer 有背景和無背景下,在dark mode下的顯示 3. 界面微調 4. 增加選項可關閉aside在手機上的顯示 5. 修復關閉夜間模式情況下,console報Uncaught ReferenceError: autoChangeMode is not defined 的bug
This commit is contained in:
parent
27adaecf51
commit
082df56112
@ -428,6 +428,9 @@ subtitle:
|
|||||||
|
|
||||||
#### 側邊欄 ####
|
#### 側邊欄 ####
|
||||||
#-------------------------------------
|
#-------------------------------------
|
||||||
|
# 手機頁面( 顯示寬度 < 768px )是否顯示aside内容
|
||||||
|
aside_mobile: true
|
||||||
|
|
||||||
# 側邊欄顯示設置
|
# 側邊欄顯示設置
|
||||||
aside:
|
aside:
|
||||||
position: right # left or right
|
position: right # left or right
|
||||||
|
|||||||
@ -70,7 +70,8 @@ html(lang=config.language data-theme=theme.display_mode)
|
|||||||
block content
|
block content
|
||||||
|
|
||||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||||
footer#footer(style=footer_bg)
|
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
|
||||||
|
footer#footer(style=footer_bg data-type=is_bg)
|
||||||
include ./footer.pug
|
include ./footer.pug
|
||||||
include ./rightside.pug
|
include ./rightside.pug
|
||||||
each item in theme.CDN_USE.js
|
each item in theme.CDN_USE.js
|
||||||
|
|||||||
@ -273,3 +273,9 @@
|
|||||||
margin-left: 15px
|
margin-left: 15px
|
||||||
else
|
else
|
||||||
margin-right: 15px
|
margin-right: 15px
|
||||||
|
|
||||||
|
if hexo-config('aside_mobile') == false
|
||||||
|
@media screen and (max-width: $sm)
|
||||||
|
#aside_content
|
||||||
|
display: none
|
||||||
|
|
||||||
|
|||||||
@ -15,13 +15,11 @@
|
|||||||
content: ''
|
content: ''
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
opacity: 0.5
|
background-color: alpha($dark-black,0.5)
|
||||||
background-color: #394245
|
|
||||||
background-image: linear-gradient(234deg, #394245 0%, #000 100%)
|
|
||||||
|
|
||||||
|
|
||||||
#footer-wrap
|
#footer-wrap
|
||||||
padding: 1.2rem 1rem 1rem
|
padding: 2rem 1rem
|
||||||
color: $light-grey
|
color: $light-grey
|
||||||
text-align: center
|
text-align: center
|
||||||
position: relative
|
position: relative
|
||||||
|
|||||||
@ -319,7 +319,7 @@
|
|||||||
#tag,
|
#tag,
|
||||||
#category
|
#category
|
||||||
padding: 1.8rem 1.3rem
|
padding: 1.8rem 1.3rem
|
||||||
margin-top: 10px
|
margin: 0
|
||||||
|
|
||||||
.category-lists
|
.category-lists
|
||||||
padding: 0
|
padding: 0
|
||||||
@ -344,7 +344,7 @@
|
|||||||
display: none
|
display: none
|
||||||
|
|
||||||
&:first-child
|
&:first-child
|
||||||
margin-top: 10px
|
margin: 0
|
||||||
|
|
||||||
@media screen and (min-width: 900px)
|
@media screen and (min-width: 900px)
|
||||||
if hexo-config("aside.position") == "left"
|
if hexo-config("aside.position") == "left"
|
||||||
|
|||||||
@ -41,16 +41,14 @@ if hexo-config("post_beautify.enable")
|
|||||||
height: 19rem
|
height: 19rem
|
||||||
|
|
||||||
&:before
|
&:before
|
||||||
position: absolute;
|
position: absolute
|
||||||
top: 0;
|
top: 0
|
||||||
left: 0;
|
left: 0
|
||||||
display: block;
|
display: block
|
||||||
content: '';
|
content: ''
|
||||||
width: 100%;
|
width: 100%
|
||||||
height: 100%;
|
height: 100%
|
||||||
opacity: 0.5;
|
background-color: alpha($dark-black,0.5)
|
||||||
background-color: #394245;
|
|
||||||
background-image: linear-gradient(234deg, #394245 0%, #000 100%);
|
|
||||||
|
|
||||||
a
|
a
|
||||||
color: $light-grey
|
color: $light-grey
|
||||||
@ -464,4 +462,4 @@ img
|
|||||||
@media screen and (max-width:768px)
|
@media screen and (max-width:768px)
|
||||||
.layout_post
|
.layout_post
|
||||||
padding: 1.8rem 1rem
|
padding: 1.8rem 1rem
|
||||||
margin: 30px 5px
|
margin: 0px 5px
|
||||||
|
|||||||
@ -181,13 +181,11 @@
|
|||||||
#category,
|
#category,
|
||||||
#page,
|
#page,
|
||||||
.flink,
|
.flink,
|
||||||
.layout_post,
|
.layout_post
|
||||||
#footer-wrap
|
background: #2d3035
|
||||||
background:#2d3035
|
|
||||||
|
|
||||||
#nav,
|
#nav,
|
||||||
#top-container,
|
#top-container
|
||||||
#footer
|
|
||||||
&::before
|
&::before
|
||||||
content: ""
|
content: ""
|
||||||
position: absolute
|
position: absolute
|
||||||
@ -195,7 +193,7 @@
|
|||||||
bottom: 0
|
bottom: 0
|
||||||
left: 0
|
left: 0
|
||||||
right: 0
|
right: 0
|
||||||
background-color: rgba(0,0,0,0.7)
|
background-color: alpha($dark-black,0.7)
|
||||||
|
|
||||||
#nav span,
|
#nav span,
|
||||||
#nav i,
|
#nav i,
|
||||||
@ -234,23 +232,19 @@
|
|||||||
border-top: 13px solid lighten(#2d3035,10) !important
|
border-top: 13px solid lighten(#2d3035,10) !important
|
||||||
|
|
||||||
|
|
||||||
#web_bg[data-type=color]
|
#web_bg[data-type=color],
|
||||||
|
#footer[data-type=color]
|
||||||
background: #2d3032
|
background: #2d3032
|
||||||
|
|
||||||
#web_bg[data-type=photo]:before
|
#web_bg[data-type=photo]:before,
|
||||||
content: ""
|
#footer[data-type=photo]:before
|
||||||
position: absolute
|
background-color: alpha($dark-black,0.7)
|
||||||
top: 0
|
|
||||||
bottom: 0
|
|
||||||
left: 0
|
|
||||||
right: 0
|
|
||||||
background-color: rgba(0,0,0,0.8)
|
|
||||||
|
|
||||||
#hbe-security
|
#hexo-blog-encrypt
|
||||||
label
|
label,input
|
||||||
color: #99a9bf !important
|
color: #99a9bf !important
|
||||||
input
|
input
|
||||||
background-color: #616a6b
|
background-color: #2d3035
|
||||||
|
|
||||||
|
|
||||||
#mobile-sidebar
|
#mobile-sidebar
|
||||||
@ -283,6 +277,15 @@
|
|||||||
|
|
||||||
.bookmark--animated:before
|
.bookmark--animated:before
|
||||||
background: lighten(#2d3035,20) !important
|
background: lighten(#2d3035,20) !important
|
||||||
|
|
||||||
|
if hexo-config('gitalk') && hexo-config('gitalk.enable')
|
||||||
|
#gitalk-container
|
||||||
|
.gt-header-textarea
|
||||||
|
background-color: #2d3035 !important
|
||||||
|
color: #99a9bf
|
||||||
|
border: 1px solid #99a9bf
|
||||||
|
.gt-comment-content
|
||||||
|
filter: brightness(0.7)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -746,26 +746,30 @@ $(function () {
|
|||||||
* Darkmode
|
* Darkmode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// if (autoChangeMode == '1') {
|
if (typeof autoChangeMode !== "undefined") {
|
||||||
// window.matchMedia("(prefers-color-scheme: dark)").addListener(function (e) {
|
|
||||||
// if (e.matches) {
|
|
||||||
// activateDarkMode()
|
|
||||||
// change_light_icon()
|
|
||||||
// Cookies.remove('theme')
|
|
||||||
// } else {
|
|
||||||
// activateLightMode()
|
|
||||||
// change_dark_icon()
|
|
||||||
// Cookies.remove('theme')
|
|
||||||
// }
|
|
||||||
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (autoChangeMode == '1' || autoChangeMode == '2') {
|
// if (autoChangeMode == '1') {
|
||||||
if (Cookies.get("theme") == "dark") {
|
// window.matchMedia("(prefers-color-scheme: dark)").addListener(function (e) {
|
||||||
change_light_icon()
|
// if (e.matches) {
|
||||||
} else {
|
// activateDarkMode()
|
||||||
change_dark_icon()
|
// change_light_icon()
|
||||||
|
// Cookies.remove('theme')
|
||||||
|
// } else {
|
||||||
|
// activateLightMode()
|
||||||
|
// change_dark_icon()
|
||||||
|
// Cookies.remove('theme')
|
||||||
|
// }
|
||||||
|
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (autoChangeMode == '1' || autoChangeMode == '2') {
|
||||||
|
if (Cookies.get("theme") == "dark") {
|
||||||
|
change_light_icon()
|
||||||
|
} else {
|
||||||
|
change_dark_icon()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user