diff --git a/src/atoms/Counter.svelte b/src/atoms/Counter.svelte
new file mode 100644
index 0000000..4595a08
--- /dev/null
+++ b/src/atoms/Counter.svelte
@@ -0,0 +1,37 @@
+
+
+
+ {#each digits as digit}
+
+ {#each numbers as number}
+ {number}
+ {/each}
+
+ {/each}
+
diff --git a/src/organisms/Carousel.svelte b/src/organisms/Carousel.svelte
index fb0090b..2ca70d0 100644
--- a/src/organisms/Carousel.svelte
+++ b/src/organisms/Carousel.svelte
@@ -11,6 +11,7 @@
// Components
import IconArrow from '../atoms/IconArrow'
+ import Counter from '../atoms/Counter'
// Props
export let photos
@@ -42,6 +43,9 @@
} else if (direction === 'next') {
currentIndex++
currentIndex = (currentIndex >= photos.length) ? 0 : currentIndex
+ } else {
+ currentIndex = direction
+ console.log('Go to photo', direction, currentIndex)
}
// Send current photo to event
@@ -182,9 +186,7 @@
{#if viewer}
-
- {currentIndex < 10 ? 0 : ''}{photos.length - currentIndex}
-
+
{/if}
@@ -207,25 +209,13 @@
{formatDate(currentPhoto.date, 'FULL')}
{/if}
-
- {#if !viewer}
-
- {#each photos as page, index}
- - currentIndex = index}>
-
-
- {/each}
-
- {/if}
- {#if viewer}
- {#each photos as page}
- -
-
+ {#each photos as page, index}
+
- goToPhoto(index)}>
+
{/each}
- {/if}
diff --git a/src/style/atoms/_counter.scss b/src/style/atoms/_counter.scss
new file mode 100644
index 0000000..989a518
--- /dev/null
+++ b/src/style/atoms/_counter.scss
@@ -0,0 +1,22 @@
+// Counter
+.counter {
+ display: inline-flex;
+ justify-content: center;
+ font-family: $font-serif-extra;
+ font-size: pxVW(672);
+ color: rgba($color-tertiary, 0.4);
+ text-align: center;
+ // pointer-events: none;
+ // user-select: none;
+
+ // Column
+ &__column {
+ display: flex;
+ flex-direction: column;
+ line-height: 0.85;
+ text-align: right;
+ margin: 0 -16px;
+ transition: transform 0.6s $ease-quart;
+ will-change: transform;
+ }
+}
\ No newline at end of file
diff --git a/src/style/organisms/_carousel.scss b/src/style/organisms/_carousel.scss
index 25e106d..c119bfe 100644
--- a/src/style/organisms/_carousel.scss
+++ b/src/style/organisms/_carousel.scss
@@ -6,7 +6,10 @@
max-width: 1280px;
padding: 0;
- @include breakpoint (1600px) {
+ @include breakpoint (sm) {
+ max-width: 85%;
+ }
+ @include breakpoint (1680px) {
max-width: 1424px;
}
}
@@ -20,9 +23,6 @@
z-index: 2;
margin: 0 auto;
- @include breakpoint (sm) {
- max-width: 85%;
- }
@include breakpoint (xl) {
max-width: 100%;
}
@@ -194,7 +194,11 @@
&__locations {
position: relative;
overflow: hidden;
- min-height: 128px;
+ min-height: 56px;
+
+ @include breakpoint (sm) {
+ min-height: 128px;
+ }
}
// Location
diff --git a/src/style/style.scss b/src/style/style.scss
index 830af6a..bfd3b13 100644
--- a/src/style/style.scss
+++ b/src/style/style.scss
@@ -21,6 +21,7 @@
@import "atoms/toggle";
@import "atoms/link";
@import "atoms/switcher";
+@import "atoms/counter";
// Molecules
@import "molecules/location";