diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-05-04 22:12:32 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-05-04 22:12:32 -0500 |
| commit | 5b608a82bd1ebfd109520492cd6d9f54736ae862 (patch) | |
| tree | 35cd29f9a14e65036a3882bdb00e594d8c95f89d | |
| parent | 5284094278ed6e4861edc3dbadb1d53218e6f6d0 (diff) | |
| download | immich-frame-5b608a82bd1ebfd109520492cd6d9f54736ae862.tar.xz immich-frame-5b608a82bd1ebfd109520492cd6d9f54736ae862.zip | |
add icons and bottom controls
| -rw-r--r-- | public/index.html | 19 | ||||
| -rw-r--r-- | public/style.css | 61 | ||||
| -rw-r--r-- | src/icons.js | 9 | ||||
| -rw-r--r-- | src/icons/image_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/pause_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/photo_album_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/photo_frame_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/play_arrow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rwxr-xr-x | src/icons/removefill.sh | 3 | ||||
| -rw-r--r-- | src/icons/settings_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/skip_next_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/skip_previous_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/icons/slideshow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg | 1 | ||||
| -rw-r--r-- | src/index.js | 11 |
14 files changed, 102 insertions, 10 deletions
diff --git a/public/index.html b/public/index.html index 7c0fadd..406122e 100644 --- a/public/index.html +++ b/public/index.html @@ -25,15 +25,24 @@ <div class="carousel-cell"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/shore.jpg" /></div> </div> </div> - <div id="albums" style="display:none"> + <div id="albums" style="display:none"> </div> - <div id="settings" style="display:none"> + <div id="settings" style="display:none"> </div> </main> <footer> - <a href="/">Slideshow</a> - <a href="/albums">Album Picker</a> - <a href="/settings">Settings</a> + <div id="bottom-container"> + <div id="controls"> + <button id="prevSlide"><svg alt="Previous Slide"><use xlink:href="#skip_previous"></use></svg></button> + <button id="playPause"><svg alt="Pause"><use xlink:href="#pause"></use></svg></button> + <button id="nextSlide"><svg alt="Next Slide"><use xlink:href="#skip_next"></use></svg></button> + </div> + <div id="menu"> + <a href="/slideshow"><svg alt="Slideshow"><use xlink:href="#slideshow"></use></svg></a> + <a href="/albums"> <svg alt="Album Picker"><use xlink:href="#photo_album"></use></svg></a> + <a href="/settings"> <svg alt="Settings"><use xlink:href="#settings"></use></svg></a> + </div> + </div> </footer> </body> </html> diff --git a/public/style.css b/public/style.css index ce4d76a..f8c26e2 100644 --- a/public/style.css +++ b/public/style.css @@ -1,5 +1,10 @@ body { - background: black + background: black; + color: white; +} + +svg { + fill: white; } .carousel-cell { @@ -18,3 +23,57 @@ body { max-width: 100%; object-fit: contain; } + + +@media (max-width: 768px) { + .carousel-cell { + height: 100vh; + } +} + + +footer { + position: fixed; + bottom: 0; + width: 100%; +} + +#bottom-container { + max-width: 1024px; + margin: auto; +} + +#controls, #menu { + display: flex; +} +#menu { + width: 100%; +} + +#controls { + width: 80%; + margin: auto; + padding-bottom: 48px; +} + +footer a, footer button { + width: 100%; +} + +footer svg { + height: 48px; + width: 100%; + +} + +#controls button { + background: none; + border: none; + padding: 0; +} + +#menu { + padding: 16px; + box-sizing: border-box; + border-top: 1px solid rgb(55, 65, 81); +} diff --git a/src/icons.js b/src/icons.js new file mode 100644 index 0000000..af4cc70 --- /dev/null +++ b/src/icons.js @@ -0,0 +1,9 @@ +import "./icons/image_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/pause_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/photo_album_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/photo_frame_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/play_arrow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/settings_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/skip_next_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/skip_previous_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" +import "./icons/slideshow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg" diff --git a/src/icons/image_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/image_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..1ff79ee --- /dev/null +++ b/src/icons/image_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm40-160h480L570-480 450-320l-90-120-120 160Z"/></svg>
\ No newline at end of file diff --git a/src/icons/pause_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/pause_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..aa7aece --- /dev/null +++ b/src/icons/pause_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M560-200v-560h160v560H560Zm-320 0v-560h160v560H240Z"/></svg>
\ No newline at end of file diff --git a/src/icons/photo_album_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/photo_album_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..95ead34 --- /dev/null +++ b/src/icons/photo_album_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h480q33 0 56.5 23.5T800-800v640q0 33-23.5 56.5T720-80H240Zm40-160h400L545-420 440-280l-65-87-95 127Zm160-280 100-60 100 60v-280H440v280Z"/></svg>
\ No newline at end of file diff --git a/src/icons/photo_frame_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/photo_frame_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..e26dccc --- /dev/null +++ b/src/icons/photo_frame_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M240-120q-17 0-28.5-11.5T200-160v-40h-80q-33 0-56.5-23.5T40-280v-440q0-33 23.5-56.5T120-800h720q33 0 56.5 23.5T920-720v440q0 33-23.5 56.5T840-200h-80v40q0 17-11.5 28.5T720-120H240Zm-40-240h560L580-600 440-420 340-540 200-360Z"/></svg>
\ No newline at end of file diff --git a/src/icons/play_arrow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/play_arrow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..22dd0af --- /dev/null +++ b/src/icons/play_arrow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M320-200v-560l440 280-440 280Z"/></svg>
\ No newline at end of file diff --git a/src/icons/removefill.sh b/src/icons/removefill.sh new file mode 100755 index 0000000..c61fd98 --- /dev/null +++ b/src/icons/removefill.sh @@ -0,0 +1,3 @@ +#!/bin/sh +# Google Material Icons -- complete default settings +sed -Ei 's/ ?fill="#[0-9a-fA-F]{6}"//' *.svg diff --git a/src/icons/settings_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/settings_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..92240e4 --- /dev/null +++ b/src/icons/settings_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"/></svg>
\ No newline at end of file diff --git a/src/icons/skip_next_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/skip_next_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..ba0282f --- /dev/null +++ b/src/icons/skip_next_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M660-240v-480h80v480h-80Zm-440 0v-480l360 240-360 240Z"/></svg>
\ No newline at end of file diff --git a/src/icons/skip_previous_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/skip_previous_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..ea45ca0 --- /dev/null +++ b/src/icons/skip_previous_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M220-240v-480h80v480h-80Zm520 0L380-480l360-240v480Z"/></svg>
\ No newline at end of file diff --git a/src/icons/slideshow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg b/src/icons/slideshow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg new file mode 100644 index 0000000..17fb6dd --- /dev/null +++ b/src/icons/slideshow_24dp_FFFFFF_FILL1_wght400_GRAD0_opsz24.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="m380-300 280-180-280-180v360ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"/></svg>
\ No newline at end of file diff --git a/src/index.js b/src/index.js index 21d0134..59175a0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +import "./icons.js" import initSlides from "./slides.js" initSlides() @@ -29,11 +30,13 @@ window.addEventListener("popstate", pathnameCallback) pathnameCallback() /* add event listeners for anchor elements in footer */ -function anchorRedirect(e) { +function softRedirect(e) { e.preventDefault() - window.history.pushState({}, "", e.target.href); + let a = e.target + while (a.tagName !== "A" && a !== null) + a = a.parentElement + window.history.pushState({}, "", a.href); pathnameCallback() } -for (const a of document.querySelectorAll("footer a")) - a.addEventListener("click", anchorRedirect) +document.querySelector("#menu").addEventListener("click", softRedirect) |
