diff options
author | mattkae <mattkae@protonmail.com> | 2021-12-29 16:33:55 -0500 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2021-12-29 16:33:55 -0500 |
commit | c3bff045eb9e28e8e49d511c9e15e13db25a2319 (patch) | |
tree | 87ab9b6e2dcdfcb6a74c7d7ab32b845fc216e568 | |
parent | dca628d985a1904be7d45b373a17ac9b7e3e09c6 (diff) |
Improved image manipulation and loading
-rw-r--r-- | images/dog_and_me-min.jpg | bin | 719525 -> 391836 bytes | |||
-rw-r--r-- | images/friends-min.jpg | bin | 1078187 -> 935190 bytes | |||
-rw-r--r-- | images/portrait-min.jpg | bin | 897904 -> 329679 bytes | |||
-rw-r--r-- | index.css | 14 | ||||
-rw-r--r-- | index.html | 2 | ||||
-rw-r--r-- | index.js | 25 |
6 files changed, 21 insertions, 20 deletions
diff --git a/images/dog_and_me-min.jpg b/images/dog_and_me-min.jpg Binary files differindex 984996c..6e4e040 100644 --- a/images/dog_and_me-min.jpg +++ b/images/dog_and_me-min.jpg diff --git a/images/friends-min.jpg b/images/friends-min.jpg Binary files differindex 2f39ff6..0fbb4c1 100644 --- a/images/friends-min.jpg +++ b/images/friends-min.jpg diff --git a/images/portrait-min.jpg b/images/portrait-min.jpg Binary files differindex 391267f..49e8cde 100644 --- a/images/portrait-min.jpg +++ b/images/portrait-min.jpg @@ -107,17 +107,19 @@ section a:hover { display: flex; flex-direction: row; height: 100%; - transition: transform 50ms linear; + transition: all 100ms linear; + opacity: 0; } #image_container .carousel_image { width: 240px; - transition: opacity 50ms linear; + transition: opacity 100ms linear; padding: 0; margin: 0; padding-right: 12px; cursor: pointer; position: relative; + opacity: 0; } #image_container .carousel_image:hover::after { @@ -203,6 +205,14 @@ input:focus { display: flex; align-items: center; bottom: 1rem; + pointer-events: all; + opacity: 1; + transition: opacity 150ms linear; +} + +#theme_selector.hidden { + pointer-events: none; + opacity: 0; } #theme_selector > button { @@ -69,7 +69,7 @@ </section> <h2>Theme</h2> - <div id="theme_selector"> + <div id="theme_selector" class="hidden"> <button id="theme_button_default">Default</button> <button id="theme_button_autumn">Autumn</button> </div> @@ -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; |