summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2021-12-29 16:33:55 -0500
committermattkae <mattkae@protonmail.com>2021-12-29 16:33:55 -0500
commitc3bff045eb9e28e8e49d511c9e15e13db25a2319 (patch)
tree87ab9b6e2dcdfcb6a74c7d7ab32b845fc216e568 /index.js
parentdca628d985a1904be7d45b373a17ac9b7e3e09c6 (diff)
Improved image manipulation and loading
Diffstat (limited to 'index.js')
-rw-r--r--index.js25
1 files changed, 8 insertions, 17 deletions
diff --git a/index.js b/index.js
index 7304870..acdbe49 100644
--- a/index.js
+++ b/index.js
@@ -1,22 +1,9 @@
function main() {
- runCarousel();
+ var themeSelector = document.getElementById('theme_selector');
+ themeSelector.classList.remove('hidden');
- // // -- Note! We require a black background to properly see the WebGL, so we handle that here.
- // var themeElement = document.getElementById('theme_container');
- // var themeButtonList = document.querySelectorAll('#theme_selector > button');
- // themeButtonList.forEach(function(themeButton) {
- // if (themeButton.id !== 'theme_button_default') {
- // themeButton.addEventListener('click', function() {
- // themeElement.style.background = 'black';
- // });
- // }
- // else {
- // themeButton.addEventListener('click', function() {
- // themeElement.style.background = 'white';
- // });
- // }
- // });
+ runCarousel();
}
function runCarousel() {
@@ -54,6 +41,7 @@ function runCarousel() {
background.append(clone);
clone.addEventListener('click', function(event) { event.stopPropagation(); });
background.addEventListener('click', function() { background.remove(); });
+ window.addEventListener('keydown', function(e) { if (e.key === 'Escape') background.remove(); });
document.body.parentElement.prepend(background);
}
@@ -95,6 +83,9 @@ function runCarousel() {
leftButton.addEventListener('click', onCarouselLeft);
rightButton.addEventListener('click', onCarouselRight);
+
+ // -- Fade in the container
+ imageContainer.style.opacity = '1';
}
-document.onload = main;
+window.onload = main;