diff --git a/src/molecules/InteractiveGlobe.svelte b/src/molecules/InteractiveGlobe.svelte index 17ba04a..1e13eb4 100644 --- a/src/molecules/InteractiveGlobe.svelte +++ b/src/molecules/InteractiveGlobe.svelte @@ -1,3 +1,8 @@ + +
diff --git a/src/molecules/Photo.svelte b/src/molecules/Photo.svelte index 71b7690..5d2e588 100644 --- a/src/molecules/Photo.svelte +++ b/src/molecules/Photo.svelte @@ -1,8 +1,11 @@
@@ -32,13 +62,15 @@ - {photo.name}, {location.region}, {location.country.name} + {photo.name}, {location.region}, {location.country.name} - - {(index < 10 ? '0': '') + index} + + {(index < 10 ? '0': '') + index}
diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 244d07c..bf29f80 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -88,7 +88,7 @@
-
+

{@html fn.lettersToSpan('Houses')}

@@ -109,7 +109,7 @@
-
+
{@html fn.lettersToSpan('of')}
@@ -122,7 +122,7 @@
-

+

{@html fn.lettersToSpan('World')}

diff --git a/src/style/_animations.scss b/src/style/_animations.scss index 59c8282..57c9672 100644 --- a/src/style/_animations.scss +++ b/src/style/_animations.scss @@ -3,7 +3,7 @@ ========================================================================== */ // Parallax title: Translate X .title-parallax { - transform: translate3d(var(--translateX), 0, 0); + transform: translateX(var(--translateX)); will-change: transform; } @@ -17,14 +17,16 @@ overflow: hidden; } -// Translate each letter from top/bottom +// Translate each letter from a direction [data-aos="letters-translate-top"], [data-aos="letters-translate-bottom"] { white-space: nowrap; span { display: inline-block; - transition: all 1000ms $ease-quart; + transition: transform 1000ms $ease-quart; + will-change: transform; + @for $i from 1 to 8 { &:nth-child(#{$i}) { @@ -35,18 +37,66 @@ &.aos-animate { span { - transform: translate3d(0, 0, 0); + transform: translate(0, 0); } } } [data-aos="letters-translate-top"] { span { - transform: translate3d(0, -100%, 0); + transform: translate(0, -100%); } } [data-aos="letters-translate-bottom"] { span { - transform: translate3d(0, 100%, 0); + transform: translate(0, 100%); + } +} + +// Carousel prev/active/next photos +[data-aos="carousel-prev"] { + transform: translate(-16%, -4%) rotate(-3deg) scale(0.8); + opacity: 0; + transition-duration: 1.6s; + transition-delay: 450ms; + + &.aos-animate { + transform: translate(-9%, -1%) rotate(-1deg) scale(0.9); + opacity: 1; + } +} +[data-aos="carousel-active"] { + transform: scale(0.8); + opacity: 0; + transition-delay: 400ms; + + &.aos-animate { + transform: scale(1); + opacity: 1; + } +} +[data-aos="carousel-next"] { + transform: translate(16%, -4%) rotate(3deg) scale(0.8); + opacity: 0; + transition-duration: 1.6s; + transition-delay: 500ms; + + &.aos-animate { + transform: translate(9%, -1%) rotate(1deg) scale(0.9); + opacity: 1; + } +} + + +// Scale down and Fade in +[data-aos="scale-down-fade-in"] { + transform: scale(1.1); + opacity: 0; + transition: transform 2s $ease-quart, opacity 2s $ease-quart; + will-change: transform, opacity; + + &.aos-animate { + transform: scale(1); + opacity: 1; } } @@ -61,27 +111,33 @@ 100% { transform: rotate(360deg); } } -// Spinning globe (small) + +/* +** Spinning globe +*/ +@keyframes moveContinents { + 0% { transform: translate(0,0); } + 100% { transform: translate(-80.26px, 28.2px); } +} +.anim-spinGlobe { + animation: moveContinents 1.7s linear infinite; + animation-play-state: paused; +} +// Small @keyframes moveContinentsSmall { - 0% { transform: translate3d(0,0,0); } - 100% { transform: translate3d(-96.95px, 0, 0); } + 0% { transform: translate(0,0); } + 100% { transform: translate(-96.95px, 0); } } .anim-spinGlobeSmall { animation: moveContinentsSmall 1.5s linear infinite; animation-play-state: paused; } -// Spinning globe -@keyframes moveContinents { - 0% { transform: translate3d(0,0,0); } - 100% { transform: translate3d(-80.26px, 28.2px, 0); } -} -.anim-spinGlobe { - animation: moveContinents 1.7s linear infinite; - animation-play-state: paused; -} -// Layout: List +/* +** Layout +*/ +// List @keyframes layoutListOdd { 0% { transform: translateX(0); } 100% { transform: translateX(4px); } @@ -91,7 +147,7 @@ 100% { transform: translateX(-4px); } } -// Layout: Grid +// Grid @keyframes layoutGridOdd { 0% { transform: translateY(0); } 100% { transform: translateY(3px); } @@ -99,4 +155,4 @@ @keyframes layoutGridEven { 0% { transform: translateY(0); } 100% { transform: translateY(-3px); } -} \ No newline at end of file +} diff --git a/src/style/atoms/_button-control.scss b/src/style/atoms/_button-control.scss index edfdaec..5a27a2d 100644 --- a/src/style/atoms/_button-control.scss +++ b/src/style/atoms/_button-control.scss @@ -14,6 +14,7 @@ cursor: pointer; outline: none; transition: background-color 350ms $ease-quart; + will-change: background-color; @include breakpoint (sm) { width: 56px; @@ -22,11 +23,12 @@ // Icon .icon { + overflow: hidden; display: block; width: 13px; height: auto; transition: transform 500ms $ease-quart, opacity 150ms $ease-inout; - overflow: hidden; + will-change: transform; @include breakpoint (sm) { width: 20px; @@ -72,34 +74,34 @@ // To left &.dir-left { .icon[aria-hidden] { - transform: translate3d(100%, -50%, 0); + transform: translate(100%, -50%); } &:hover, &:focus { .icon:not([aria-hidden]) { opacity: 0; - transform: translate3d(-100%, 0, 0); + transform: translate(-100%, 0); } .icon[aria-hidden] { opacity: 1; - transform: translate3d(-50%, -50%, 0); + transform: translate(-50%, -50%); } } } // To right &.dir-right { .icon[aria-hidden] { - transform: translate3d(-150%, -50%, 0); + transform: translate(-150%, -50%); } &:hover, &:focus { .icon:not([aria-hidden]) { opacity: 0; - transform: translate3d(100%, 0, 0); + transform: translate(100%, 0); } .icon[aria-hidden] { opacity: 1; - transform: translate3d(-50%, -50%, 0); + transform: translate(-50%, -50%); } } } @@ -107,17 +109,17 @@ &.dir-top { .icon[aria-hidden] { left: auto; - transform: translate3d(0, -150%, 0); + transform: translate(0, -150%); } &:hover, &:focus { .icon:not([aria-hidden]) { opacity: 0; - transform: translate3d(0, 100%, 0); + transform: translate(0, 100%); } .icon[aria-hidden] { opacity: 1; - transform: translate3d(0, -50%, 0); + transform: translate(0, -50%); } } } @@ -125,17 +127,17 @@ &.dir-bottom { .icon[aria-hidden] { left: auto; - transform: translate3d(0, 150%, 0); + transform: translate(0, 150%); } &:hover, &:focus { .icon:not([aria-hidden]) { opacity: 0; - transform: translate3d(0, -100%, 0); + transform: translate(0, -100%); } .icon[aria-hidden] { opacity: 1; - transform: translate3d(0, -50%, 0); + transform: translate(0, -50%); } } } @@ -149,6 +151,7 @@ overflow: visible; background-color: rgba($color-lightpurple, 0.5); transition: background-color 150ms $ease-inout; + will-change: background-color; // Icon svg[fill] { @@ -175,6 +178,7 @@ animation-play-state: paused; animation-delay: 50ms; transition: stroke 150ms $ease-inout; + will-change: stroke; } // Hover diff --git a/src/style/atoms/_button-outline.scss b/src/style/atoms/_button-outline.scss index ed1a637..b66c707 100644 --- a/src/style/atoms/_button-outline.scss +++ b/src/style/atoms/_button-outline.scss @@ -1,21 +1,22 @@ // Button: Outline .button-outline { + overflow: hidden; position: relative; display: inline-flex; align-items: center; height: 32px; padding: 1px 16px 0; + background: none; font-family: $font-sans-sb; font-size: rem(14px); color: #fff; - background: none; border: 2px solid #fff; border-radius: 50vh; - overflow: hidden; text-decoration: none; cursor: pointer; outline: none; transition: all 275ms $ease-cubic; + will-change: border, color; @include breakpoint (sm) { height: 40px; @@ -36,11 +37,12 @@ top: 50%; left: 0; right: 0; - transform: translate3d(0, -120%, 0); + transform: translateY(-120%); } span, &:after { - transition: opacity 275ms $ease-cubic, transform 275ms $ease-cubic; + transition: transform 275ms $ease-cubic, opacity 275ms $ease-cubic; + will-change: transform, opacity; } // Disabled @@ -56,11 +58,11 @@ span { opacity: 0; - transform: translate3d(0, 100%, 0); + transform: translateY(100%); } &:after { opacity: 1; - transform: translate3d(0, -50%, 0); + transform: translateY(-50%); } } } diff --git a/src/style/atoms/_button.scss b/src/style/atoms/_button.scss index 66aea85..4b84cb9 100644 --- a/src/style/atoms/_button.scss +++ b/src/style/atoms/_button.scss @@ -16,6 +16,7 @@ outline: none; cursor: pointer; transition: background-color 250ms $ease-cubic, color 350ms $ease-cubic; + will-change: background-color, color; @include breakpoint (sm) { height: 48px; @@ -58,10 +59,11 @@ top: 50%; left: 0; width: 100%; - transform: translate3d(0, -120%, 0); + transform: translateY(-120%); } span, &:after { - transition: opacity 275ms $ease-cubic, transform 275ms $ease-cubic; + transition: transform 275ms $ease-cubic, opacity 275ms $ease-cubic; + will-change: transform, opacity; } // Button has an icon (offset the hovered text) @@ -86,14 +88,14 @@ } span { opacity: 0; - transform: translate3d(0, 100%, 0); + transform: translateY(100%); } &:after { opacity: 1; - transform: translate3d(0, -47%, 0); + transform: translateY(-47%); @include breakpoint (sm) { - transform: translate3d(0, -50%, 0); + transform: translateY(-50%); } } } diff --git a/src/style/atoms/_toggle.scss b/src/style/atoms/_toggle.scss index 75dbca1..c48fae4 100644 --- a/src/style/atoms/_toggle.scss +++ b/src/style/atoms/_toggle.scss @@ -20,6 +20,7 @@ justify-content: center; outline: none; transition: color 150ms $ease-inout; + will-change: color; } button { span { @@ -80,6 +81,7 @@ height: 100%; background-color: $color-primary; transition: all 500ms $ease-quart; + will-change: width, left; span { content: attr(data-text); @@ -87,4 +89,4 @@ margin: 0; } } -} \ No newline at end of file +} diff --git a/src/style/molecules/_pagination.scss b/src/style/molecules/_pagination.scss index 0189cf8..c7654b3 100644 --- a/src/style/molecules/_pagination.scss +++ b/src/style/molecules/_pagination.scss @@ -45,6 +45,7 @@ line-height: 0.85; transform: translate3d(0, -190%, 0); transition: transform 250ms $ease-cubic; + will-change: transform; } } diff --git a/src/style/molecules/_photo.scss b/src/style/molecules/_photo.scss index aa45745..8483ef2 100644 --- a/src/style/molecules/_photo.scss +++ b/src/style/molecules/_photo.scss @@ -84,7 +84,7 @@ background-color: $color-primary; display: block; z-index: 3; - transition: all 150ms ease-in-out; + transition: opacity 150ms $ease-inout; } } diff --git a/src/style/organisms/_photos.scss b/src/style/organisms/_photos.scss index 2d6ed39..b34672e 100644 --- a/src/style/organisms/_photos.scss +++ b/src/style/organisms/_photos.scss @@ -105,6 +105,12 @@ } } } + + // Number + &__image--number { + transform: translate(-50%, var(--translate)); + will-change: transform; + } } // Pagination diff --git a/src/style/tools/_mixins.scss b/src/style/tools/_mixins.scss index ad72cdf..b0da768 100644 --- a/src/style/tools/_mixins.scss +++ b/src/style/tools/_mixins.scss @@ -28,19 +28,19 @@ // Center vertically @mixin center-y { top: 50%; - transform: translate3d(0,-50%,0); + transform: translate(0, -50%); } // Center horizontally @mixin center-x { left: 50%; - transform: translate3d(-50%,0,0); + transform: translate(-50%, 0); } // Center vertically and horizontally @mixin center-xy { top: 50%; left: 50%; - transform: translate3d(-50%,-50%,0); + transform: translate(-50%, -50%); } // Smooth fonts