summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorEltrac Koalar <hi@guhub.cn>2022-09-25 14:15:31 +0800
committerEltrac Koalar <hi@guhub.cn>2022-09-25 14:15:31 +0800
commit2b075b13a991f144db10e03f26ced1827603387e (patch)
tree197b3848ca9011a4341b1d20185a39cdd42cca20 /assets
parent2058aa543a6b41f7d68d8768082c422bfef9dbf0 (diff)
:eyeglasses: Add: 专注模式背景色更护眼
Diffstat (limited to 'assets')
-rw-r--r--assets/matcha/matcha.js4
-rw-r--r--assets/matcha/matcha.post.css6
-rw-r--r--assets/matcha/matcha.reset.css11
3 files changed, 15 insertions, 6 deletions
diff --git a/assets/matcha/matcha.js b/assets/matcha/matcha.js
index b842298..94e17b4 100644
--- a/assets/matcha/matcha.js
+++ b/assets/matcha/matcha.js
@@ -205,8 +205,8 @@ var toggleFocusMode = function(){
$('#sidebar').fadeToggle();
$('#helpbar').fadeToggle();
$('.post-thumbnail-atpage').slideToggle();
- $(body).toggleClass('focus-mode')
- if($(body).hasClass('focus-mode')){
+ $('body').toggleClass('focus-mode')
+ if($('body').hasClass('focus-mode')){
scaleIn($('#focus-mode-close'), '0.7');
toast('已开启专注模式');
}else{
diff --git a/assets/matcha/matcha.post.css b/assets/matcha/matcha.post.css
index e85d2c4..56a063c 100644
--- a/assets/matcha/matcha.post.css
+++ b/assets/matcha/matcha.post.css
@@ -286,12 +286,14 @@
/* 文章目录 */
.tocbar {
position: fixed;
- left: 100%
+ left: 100%;
+ display: none
}
@media (min-width: 1200px){
.tocbar {
left: calc(50% + 415px);
- top: 4em
+ top: 4em;
+ display: block
}
}
diff --git a/assets/matcha/matcha.reset.css b/assets/matcha/matcha.reset.css
index 1290787..9c78fde 100644
--- a/assets/matcha/matcha.reset.css
+++ b/assets/matcha/matcha.reset.css
@@ -131,12 +131,18 @@ pre::-webkit-scrollbar-corner {
/* 专注模式 */
.focus-mode {
- background-color: var(--white-or-black)
+ background-color: var(--white-or-black);
}
+
+.focus-mode:not(.matcha-dark *) #body {
+ background: rgb(252, 250, 246)
+}
+
.focus-mode .container {
box-shadow: 0 0 0 #fff;
- background-color: var(--white-or-black)!important
+ background-color: transparent!important
}
+
.focus-mode-btn {
color: var(--text-gray);
top: 0;
@@ -148,6 +154,7 @@ pre::-webkit-scrollbar-corner {
display: none
}
}
+
#focus-mode-close {
display: none;
position: fixed;