add halcyon theme to projects

This commit is contained in:
Brittany Chiang
2017-12-25 20:09:04 -05:00
parent 165a8799e7
commit f22c02b90b
3 changed files with 14 additions and 5 deletions

View File

@@ -1,13 +1,12 @@
$(function() {
const d = new Date();
const hours = d.getHours();
const nighttime = (hours >= 19) || (hours <= 7); // between 7pm and 7am
const night = (hours >= 19) || (hours <= 7); // between 7pm and 7am
const body = document.querySelector('body');
const toggle = document.getElementById('toggle');
const input = document.getElementById('switch');
if (nighttime) {
if (night) {
input.checked = true;
body.classList.add('night');
}