From 956c35c8e7dd7312e8dd0390f1bac81a73bf93e4 Mon Sep 17 00:00:00 2001 From: Ariejan de Vroom Date: Thu, 27 Feb 2020 14:45:15 +0100 Subject: [PATCH] Update config/drone setup --- .drone.yml | 1 + config.toml | 2 +- static/css/custom.js | 35 +---------------------------------- 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/.drone.yml b/.drone.yml index a2c0823..0fb1998 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,6 +11,7 @@ steps: commands: - git submodule init - git submodule update --recursive --remote + - git submodule - name: build image: hypervtechnics/drone-hugo diff --git a/config.toml b/config.toml index f50afe7..3ffa55c 100644 --- a/config.toml +++ b/config.toml @@ -34,7 +34,7 @@ disqusShortname = "" hidecredits = true hidecopyright = true - inverted = true + colorscheme = "auto" rtl = false diff --git a/static/css/custom.js b/static/css/custom.js index 98567d1..0f2d30d 100644 --- a/static/css/custom.js +++ b/static/css/custom.js @@ -1,34 +1 @@ -function activateDarkMode() { - console.log("activated dark mode"); - document.body.classList.add('inverted'); -} - -function activateLightMode() { - console.log("activated ligth mode"); - document.body.classList.remove('inverted'); -} - -function setColorScheme() { - const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches - const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches - const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches - const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified; - - window.matchMedia("(prefers-color-scheme: dark)").addListener(e => e.matches && activateDarkMode()) - window.matchMedia("(prefers-color-scheme: light)").addListener(e => e.matches && activateLightMode()) - - if(isDarkMode) activateDarkMode() - if(isLightMode) activateLightMode() - if(isNotSpecified || hasNoSupport) { - console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.') - now = new Date(); - hour = now.getHours(); - if (hour < 4 || hour >= 16) { - activateDarkMode(); - } - } -} - -document.addEventListener('DOMContentLoaded', function(event) { - setColorScheme(); -}) +console.log("Hello, thanks for checking out my website. - Ariejan");