|
|
@ -47,6 +47,7 @@
|
|
|
|
switch(e.key) {
|
|
|
|
switch(e.key) {
|
|
|
|
case 'ArrowRight':
|
|
|
|
case 'ArrowRight':
|
|
|
|
open = open === (images.length - 2) ? 0 : open + 1;
|
|
|
|
open = open === (images.length - 2) ? 0 : open + 1;
|
|
|
|
|
|
|
|
slide_classes = 'slide-in-right';
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'ArrowLeft':
|
|
|
|
case 'ArrowLeft':
|
|
|
|
open = open === 0 ? images.length - 2 : open - 1;
|
|
|
|
open = open === 0 ? images.length - 2 : open - 1;
|
|
|
@ -62,6 +63,22 @@
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.slide-in-right {
|
|
|
|
|
|
|
|
animation: slide-in-right .3s ease;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes slide-in-right {
|
|
|
|
|
|
|
|
from {
|
|
|
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
|
|
|
transform: translate3d(60%, 0, 0);
|
|
|
|
|
|
|
|
opacity: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
|
|
|
|
|
|
|
visibility: visible;
|
|
|
|
|
|
|
|
transform: translate3d(0, 0, 0);
|
|
|
|
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.slide-in-left {
|
|
|
|
.slide-in-left {
|
|
|
|
animation: slide-in-left .3s ease;
|
|
|
|
animation: slide-in-left .3s ease;
|
|
|
@ -69,13 +86,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
@keyframes slide-in-left {
|
|
|
|
@keyframes slide-in-left {
|
|
|
|
from {
|
|
|
|
from {
|
|
|
|
opacity: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
transform: translate3d(-60%, 0, 0);
|
|
|
|
transform: translate3d(-60%, 0, 0);
|
|
|
|
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
to {
|
|
|
|
visibility: visible;
|
|
|
|
visibility: visible;
|
|
|
|
transform: translate3d( 0, 0, 0);
|
|
|
|
transform: translate3d( 0, 0, 0);
|
|
|
|
opacity: 1;
|
|
|
|
opactiy: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -85,8 +103,6 @@
|
|
|
|
left: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100vw;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
height: 100vh;
|
|
|
|
opacity: 1;
|
|
|
|
|
|
|
|
transition: opacity 1s; /* This is being applied when we add `slide_classes' */
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
@ -101,8 +117,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
<svelte:window on:keydown={handle_keys} />
|
|
|
|
<svelte:window on:keydown={handle_keys} />
|
|
|
|
|
|
|
|
|
|
|
|
<div id="lightbox" class="{class_list} {slide_classes}" on:click={close}>
|
|
|
|
<div id="lightbox" class="{class_list}" on:click={close}>
|
|
|
|
|
|
|
|
<header>
|
|
|
|
|
|
|
|
</header>
|
|
|
|
<img class=" hidden" rel="preload" src="{image[0]}" />
|
|
|
|
<img class=" hidden" rel="preload" src="{image[0]}" />
|
|
|
|
<img class="object-contain max-w-full max-h-full" src="{image[1]}" />
|
|
|
|
<img class="object-contain max-w-full max-h-full {slide_classes}" src="{image[1]}" />
|
|
|
|
<img class="hidden" rel="preload" src="{image[2]}" />
|
|
|
|
<img class="hidden" rel="preload" src="{image[2]}" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|