mirror of
https://github.com/Xevion/old.xevion.github.io.git
synced 2025-12-06 15:15:39 -06:00
build
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
const hours = d.getHours();
|
const hours = d.getHours();
|
||||||
const nighttime = (hours >= 19) || (hours <= 7); // 7pm <= hours <= 7am
|
const night = (hours >= 19) || (hours <= 7); // between 7pm and 7am
|
||||||
const body = document.querySelector('body');
|
const body = document.querySelector('body');
|
||||||
const toggle = document.getElementById('toggle');
|
const toggle = document.getElementById('toggle');
|
||||||
const input = document.getElementById('switch');
|
const input = document.getElementById('switch');
|
||||||
|
|
||||||
if (nighttime) {
|
if (night) {
|
||||||
input.checked = true;
|
input.checked = true;
|
||||||
body.classList.add('night');
|
body.classList.add('night');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user