Place: Add photo Transition In, Add Illustration system, Visual fixes
- Add a transition in on each photo component (scale down + fade in), TODO: Parallax on number - Illustration takes two images and changes the source depending on the viewport size
This commit is contained in:
48
src/animations/Photo.js
Normal file
48
src/animations/Photo.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import anime from 'animejs'
|
||||
import ScrollOut from 'scroll-out'
|
||||
import { animDuration, animDurationLong } from '../utils/store'
|
||||
import { debounce } from '../utils/functions'
|
||||
|
||||
|
||||
/*
|
||||
** Transition In
|
||||
*/
|
||||
export const animateIn = scope => {
|
||||
// Title appearing
|
||||
const titleReveal = ScrollOut({
|
||||
once: true,
|
||||
targets: scope,
|
||||
offset: window.offsetHeight / 3,
|
||||
onShown (el) {
|
||||
// Title reveal
|
||||
anime({
|
||||
targets: el.querySelectorAll('h2 span'),
|
||||
translateY: ['100%', 0],
|
||||
duration: 1000,
|
||||
delay: anime.stagger(120),
|
||||
easing: 'easeOutQuart'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Photo appearing
|
||||
const photoReveal = ScrollOut({
|
||||
once: true,
|
||||
targets: scope.querySelector('picture'),
|
||||
offset: window.offsetHeight / 3,
|
||||
onShown (el) {
|
||||
// Title reveal
|
||||
anime({
|
||||
targets: el.querySelector('img'),
|
||||
scale: [1.12, 1],
|
||||
opacity: [0, 1],
|
||||
duration: 2000,
|
||||
delay: 50,
|
||||
easing: 'easeOutQuart'
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Number parallax
|
||||
//! TODO
|
||||
}
|
||||
Reference in New Issue
Block a user