summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2021-11-24 21:08:53 -0500
committermattkae <mattkae@protonmail.com>2021-11-24 21:08:53 -0500
commitb6ecb0485ebbd1bd1512cc6a087c403ad67683f0 (patch)
treef73ae28c37e7589244385cf4d91cf4e8efb02a10 /index.js
parentac9c187740797c5f8105b052bc057d274edc4be1 (diff)
(mkosarek) Fixed up a bunch of styling, add new links, and made it a light theme
Diffstat (limited to 'index.js')
-rw-r--r--index.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/index.js b/index.js
index 72fcc2e..fbe9ba9 100644
--- a/index.js
+++ b/index.js
@@ -2,6 +2,22 @@
function main() {
runCarousel();
runPosts();
+
+ // -- Note! We require a black background to properly see the WebGL, so we handle that here.
+ var bodyElement = document.querySelector('body');
+ var themeButtonList = document.querySelectorAll('#theme_selector > button');
+ themeButtonList.forEach(function(themeButton) {
+ if (themeButton.id !== 'theme_button_default') {
+ themeButton.addEventListener('click', function() {
+ bodyElement.style.background = 'black';
+ });
+ }
+ else {
+ themeButton.addEventListener('click', function() {
+ bodyElement.style.background = 'white';
+ });
+ }
+ })
}
function runCarousel() {