From 804880a90872d749e2f308367300a0c07d1fee90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 2 Mar 2020 22:30:27 +0100 Subject: [PATCH] Temporary browsable Carousel on photo page Stuff to be fixed/work on: - Why is currentPhoto only triggered at the second photo and not the first? - popState events (prev/next on browser) not working - detect URL changes and change the currentIndex --- src/organisms/Carousel.svelte | 109 +++++++++++------- .../[country]/[location]/[photo].svelte | 81 ++++++++++--- src/style/organisms/_carousel.scss | 4 +- src/style/pages/_viewer.scss | 39 +++---- 4 files changed, 156 insertions(+), 77 deletions(-) diff --git a/src/organisms/Carousel.svelte b/src/organisms/Carousel.svelte index b44ead4..ad778ba 100644 --- a/src/organisms/Carousel.svelte +++ b/src/organisms/Carousel.svelte @@ -1,7 +1,10 @@ - Houses Of - photoName photoCountryName + Houses Of – Photos of {location.name}, {location.country.name} + + + + @@ -95,5 +141,10 @@ - + diff --git a/src/style/organisms/_carousel.scss b/src/style/organisms/_carousel.scss index e5e9321..a2952c1 100644 --- a/src/style/organisms/_carousel.scss +++ b/src/style/organisms/_carousel.scss @@ -45,7 +45,7 @@ // Photo &__photo { - $duration: 0.9s; + $duration: 1s; opacity: 0; overflow: hidden; @@ -57,7 +57,7 @@ height: 100%; transform: scale($scale); box-shadow: 0 pxVW(15) pxVW(60) rgba(#000, 0.3); - transition: transform $duration $ease-quart, opacity $duration $ease-quart; + transition: transform $duration $ease-quart, opacity $duration / 2 $ease-quart; will-change: transform, opacity; @include breakpoint (sm) { diff --git a/src/style/pages/_viewer.scss b/src/style/pages/_viewer.scss index b654cfa..44ff63b 100644 --- a/src/style/pages/_viewer.scss +++ b/src/style/pages/_viewer.scss @@ -94,8 +94,8 @@ } } - // Information - &__information { + // Informations + &__infos { margin-top: 32px; padding: 0 24px; @@ -104,27 +104,26 @@ justify-content: space-between; padding: 0; } + } - // Location - &--location { - width: 75%; - text-align: left; + // Location + &__locations { + width: 75%; + } + &__location { + text-align: left; + margin-top: 0; + } - .street { - margin: 0; - } - } + // Date + &__date { + color: rgba($color-tertiary, 0.5); + font-size: rem(12px); + margin-top: 16px; - // Date - &--date { - color: rgba($color-tertiary, 0.5); - font-size: rem(12px); - margin-top: 16px; - - @include breakpoint (sm) { - font-size: rem(14px); - margin: 0; - } + @include breakpoint (sm) { + font-size: rem(14px); + margin: 0; } }