diff --git a/src/lib/NavClose.svelte b/src/lib/Close.svelte similarity index 100% rename from src/lib/NavClose.svelte rename to src/lib/Close.svelte diff --git a/src/lib/Gallery.svelte b/src/lib/Gallery.svelte index 3906fe3..2cb206e 100644 --- a/src/lib/Gallery.svelte +++ b/src/lib/Gallery.svelte @@ -4,6 +4,7 @@ import { linear } from "svelte/easing"; import ArrowLeft from "$lib/ArrowLeft.svelte"; import ArrowRight from "$lib/ArrowRight.svelte"; + import Close from "$lib/Close.svelte"; export let images; export let arrowColor; @@ -13,6 +14,7 @@ let selectedImageIndex = 0 let elements = []; + let fullscreenShown = false; const scrollConfig = { behavior: 'smooth', @@ -48,16 +50,48 @@ elements[selectedImageIndex].scrollIntoView(scrollConfig) }); } + + const openFullscreen = () => { + fullscreenShown = true + document.body.classList.add("no-scroll") + } + + const closeFullscreen = () => { + fullscreenShown = false + document.body.classList.remove("no-scroll") + }
- {images[selectedImageIndex].image.alt} -
- +
e.stopPropagation()}> + {images[selectedImageIndex].image.alt} +
{images[selectedImageIndex].image.alt}
+
+ + +
+ + + +
+
{#each images as image, index}
- -
+
@@ -98,7 +129,7 @@ width: 100%; max-width: 40rem; height: 100%; - max-height: 40rem; + max-height: 30rem; } .image-button { @@ -137,13 +168,34 @@ padding-top: 1rem; padding-bottom: 1rem; max-width: 60rem; - max-height: 60rem; + } + + .current-image-container { + position: relative; + width: 100%; + display: flex; + justify-content: center; + align-items: center; + max-width: 60rem; } .arrow-button { background-color: rgba(0, 0, 0, 0); border: none; cursor: pointer; + position: absolute; + } + + .arrow-button.left { + left: 0; + top: 50%; + transform: translateY(-50%); + } + + .arrow-button.right { + right: 0; + top: 50%; + transform: translateY(-50%); } .arrow-button { @@ -161,17 +213,77 @@ align-items: center; } + .button-reset { + border: none; + padding: 0; + margin: 0; + background-color: rgba(0, 0, 0, 0); + cursor: pointer; + } + + .fullscreen { + position: fixed; + display: none; + width: 100%; + height: 100%; + top: 0; + left: 0; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.75); + z-index: 5; + } + + .fullscreen-close { + position: absolute; + top: 2rem; + right: 2rem; + } + + .fullscreen figcaption { + font-family: 'Roboto', serif; + font-size: 18px; + line-height: 22px; + color: #FFFFFF; + text-align: start; + overflow: auto; + } + + .fullscreen figure { + margin: 1rem; + } + + .fullscreen figure img { + cursor: auto; + } + + .fullscreen .current-image { + max-width: 90vw; + max-height: 90vh; + } + @media only screen and (max-width: 580px) { + .arrow-button { + position: relative; + } + .big-screen { display: none; } - .selector { - flex-direction: column; - } + .selector { + flex-direction: column; + } .small-screen-navigation { display: flex; } } + + @media only screen and (max-width: 800px) { + .fullscreen .current-image { + max-width: 100%; + max-height: 90vh; + } + } diff --git a/src/lib/Navbar.svelte b/src/lib/Navbar.svelte index f69d508..33711ca 100644 --- a/src/lib/Navbar.svelte +++ b/src/lib/Navbar.svelte @@ -1,6 +1,6 @@