File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,14 +132,14 @@ function show_date_time() {
132132 const modeSwitch = document.querySelector('.my_mode_switch');
133133 modeSwitch && modeSwitch.addEventListener('click', e => {
134134 e.stopPropagation();
135- if (cookie.get('night') === '0') {
136- document.body.classList.add('night');
137- cookie.set('night', '1');
138- console.log('开启夜间模式');
139- } else {
135+ if (cookie.get('night') === '1') {
140136 document.body.classList.remove('night');
141137 cookie.set('night', '0');
142138 console.log('关闭夜间模式');
139+ } else {
140+ document.body.classList.add('night');
141+ cookie.set('night', '1');
142+ console.log('开启夜间模式');
143143 }
144144 });
145145 <?php endif ; ?>
Original file line number Diff line number Diff line change 1717<!DOCTYPE html>
1818<html lang="zh">
1919<?php $ this ->need ('header.php ' ); ?>
20- <body class="page-body <?php echo $ _COOKIE ['night ' ] == '1 ' ? 'night ' : '' ; ?> ">
20+ <body class="page-body <?php echo isset ( $ _COOKIE [ ' night ' ]) && $ _COOKIE ['night ' ] == '1 ' ? 'night ' : '' ; ?> ">
2121<!-- skin-white -->
2222<div class="page-container">
2323 <?php $ this ->need ('sidebar.php ' ); ?>
You can’t perform that action at this time.
0 commit comments