Viewer: Add intro animation, Visual fixes (WIP)

This commit is contained in:
2020-03-10 21:23:13 +01:00
parent cc0d6c1dcd
commit eb529b196e
3 changed files with 77 additions and 42 deletions

37
src/animations/viewer.js Normal file
View File

@@ -0,0 +1,37 @@
import anime from 'animejs'
import { animDuration } from '../utils/store'
/*
** Transition In
*/
export const animateIn = () => {
// Buttons
anime({
targets: '.viewer__top p, .viewer__top .buttons a',
translateY: [-32, 0],
duration: animDuration,
delay: anime.stagger(150, { start: 600 }),
easing: 'easeOutQuart'
})
// Carousel
anime({
targets: '.viewer .carousel',
opacity: [0, 1],
translateY: window.innerWidth >= 768 ? [32, 0] : ['-33%', '-37%'],
duration: animDuration,
delay: 300,
easing: 'easeOutQuart'
})
// Carousel: Number
anime({
targets: '.viewer .carousel__number_column',
opacity: [0, 1],
marginTop: [24, 0],
duration: animDuration,
delay: anime.stagger(100, { start: 450 }),
easing: 'easeOutQuart'
})
}

View File

@@ -45,8 +45,8 @@
import SocialMetas from '../../../../utils/SocialMetas' import SocialMetas from '../../../../utils/SocialMetas'
// Animations // Animations
// import { animateIn } from '../../../animations/photoPage' import { animateIn } from '../../../../animations/viewer'
// pageTransition.onAnimationEnd = animateIn pageTransition.onAnimationEnd = animateIn
// Props // Props

View File

@@ -3,14 +3,13 @@
position: relative; position: relative;
height: 100vh; height: 100vh;
min-height: 560px; min-height: 560px;
padding-top: 24px;
@include breakpoint (sm) { @include breakpoint (sm) {
width: 100%;
height: 100vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: space-between;
align-items: center;
width: 100%;
} }
@@ -18,11 +17,7 @@
** Top part ** Top part
*/ */
&__top { &__top {
position: absolute;
z-index: 10; z-index: 10;
top: 0;
left: 0;
right: 0;
margin-top: 16px; margin-top: 16px;
padding-left: 24px; padding-left: 24px;
padding-right: 16px; padding-right: 16px;
@@ -69,22 +64,20 @@
** Carousel ** Carousel
*/ */
.carousel { .carousel {
position: absolute; @include breakpoint (xs) {
top: 50%; position: absolute;
left: 0; top: 50%;
right: 0; left: 0;
transform: translateY(-37%); right: 0;
margin: 0; transform: translateY(-37%);
}
@include breakpoint (sm) { @include breakpoint (sm) {
// position: static; width: 100%;
// transform: none; margin: auto;
// margin-top: auto; }
// margin-bottom: auto; // Landscape
left: 50%; @media screen and (max-width: $screen-lg) and (orientation: landscape) {
transform: translate(-50%, -45%); width: 60%;
width: 85%;
min-height: 500px;
} }
// Gallery // Gallery
@@ -114,22 +107,29 @@
// Location // Location
&__locations { &__locations {
width: 75%; @include breakpoint (sm) {
width: 75%;
}
} }
&__location { &__location {
text-align: left;
margin-top: 0; margin-top: 0;
@include breakpoint (sm) {
text-align: left;
}
} }
// Date // Date
&__date { &__date {
color: rgba($color-tertiary, 0.5);
font-size: rem(12px);
margin-top: 16px; margin-top: 16px;
font-size: rem(12px);
color: rgba($color-tertiary, 0.5);
text-align: center;
@include breakpoint (sm) { @include breakpoint (sm) {
font-size: rem(14px);
margin: 0; margin: 0;
font-size: rem(14px);
text-align: left;
} }
} }
@@ -138,26 +138,24 @@
position: absolute; position: absolute;
z-index: 1; z-index: 1;
left: 0; left: 0;
top: -33.5vw; top: -28vw;
width: 100%; width: 100%;
font-family: $font-serif-extra; height: 42vw;
font-size: pxVW(672); max-height: 232px;
color: rgba($color-tertiary, 0.4); overflow: hidden;
text-align: center;
pointer-events: none;
user-select: none;
@include breakpoint (sm) { @include breakpoint (sm) {
display: block;
top: auto; top: auto;
right: 112px; right: 176px;
bottom: -240px; left: auto;
// bottom: -240px;
width: auto; width: auto;
font-size: rem(250px); font-size: rem(240px);
text-align: right; text-align: right;
} }
@include breakpoint (md) { @include breakpoint (md) {
bottom: -288px; // bottom: -288px;
bottom: -160px;
font-size: rem(300px); font-size: rem(300px);
} }
} }