fix: fix styles

This commit is contained in:
Spirit 2020-04-09 16:11:54 +08:00
parent 0ddfcad236
commit 6b919d0157
4 changed files with 31 additions and 22 deletions

View File

@ -150,6 +150,7 @@ h1.entry-title {
} }
.entry-content tr:nth-child(even){background-color: #f2f2f2} .entry-content tr:nth-child(even){background-color: #f2f2f2}
body.dark .entry-content tr:nth-child(even){background-color: unset}
.entry-content th { .entry-content th {
color: white; color: white;

File diff suppressed because one or more lines are too long

View File

@ -324,18 +324,20 @@ function checkBgImgCookie() {
} }
function checkDarkModeCookie() { function checkDarkModeCookie() {
var night = getCookie("night"), var dark = getCookie("dark"),
today = new Date() today = new Date()
cWidth = document.body.clientWidth; cWidth = document.body.clientWidth;
if (!night) { if (!dark) {
if ((today.getHours() > 21 || today.getHours() < 7) && cWidth > 1200) { if ((today.getHours() > 21 || today.getHours() < 7)) {
setTimeout(function () {
$("#dark-bg").click(); $("#dark-bg").click();
}, 100);
console.log('夜间模式开启'); console.log('夜间模式开启');
} else { } else {
if (cWidth > 860) { if (cWidth > 860) {
setTimeout(function () { setTimeout(function () {
checkBgImgCookie(); checkBgImgCookie();
}, 1000); }, 100);
console.log('夜间模式关闭'); console.log('夜间模式关闭');
} else { } else {
$("html").css("background", "unset"); $("html").css("background", "unset");
@ -345,14 +347,16 @@ function checkDarkModeCookie() {
} }
} }
} else { } else {
if (night == '1' && (today.getHours() >= 22 || today.getHours() <= 6) && cWidth > 1200) { if (dark == '1' && (today.getHours() >= 22 || today.getHours() <= 6)) {
setTimeout(function () {
$("#dark-bg").click(); $("#dark-bg").click();
}, 100);
console.log('夜间模式开启'); console.log('夜间模式开启');
} else if (night == '0' || today.getHours() < 22 || today.getHours() > 6) { } else if (dark == '0' || today.getHours() < 22 || today.getHours() > 6) {
if (cWidth > 860) { if (cWidth > 860) {
setTimeout(function () { setTimeout(function () {
checkBgImgCookie(); checkBgImgCookie();
}, 1000); }, 100);
console.log('夜间模式关闭'); console.log('夜间模式关闭');
} else { } else {
$("html").css("background", "unset"); $("html").css("background", "unset");

View File

@ -1877,19 +1877,8 @@ h1.page-title.mb- {
text-align: center text-align: center
} }
@media screen and (max-width:860px) {
.cd-top {
display: none;
height: 60px;
width: 50px
}
.cd-top span {
height: 10px;
width: 50px
}
}
#moblieGoTop,#moblieDarkLight { #moblieGoTop,#moblieDarkLight {
visibility: hidden;
position: fixed; position: fixed;
bottom: 60px; bottom: 60px;
right: 10px; right: 10px;
@ -1914,6 +1903,21 @@ h1.page-title.mb- {
#moblieDarkLight{ #moblieDarkLight{
bottom: 10px; bottom: 10px;
} }
@media screen and (max-width:860px) {
.cd-top {
display: none;
height: 60px;
width: 50px
}
.cd-top span {
height: 10px;
width: 50px
}
#moblieGoTop,#moblieDarkLight{
visibility: visible;
}
}
.post-footer { .post-footer {
padding: 20px 0; padding: 20px 0;
border-bottom: 1px dashed #ddd; border-bottom: 1px dashed #ddd;