Style and animations fixes

- Add a requestAnimationFrame for TitleSite (would not fire from a location to credits/choose)
- Center and adjust parallax scroll for massive titles
- Place illustration: max width and center
This commit is contained in:
2020-04-21 15:21:50 +02:00
parent 9063045e94
commit 99dd2c5327
5 changed files with 16 additions and 9 deletions

View File

@@ -21,12 +21,11 @@ export const animateIn = (scope, init) => {
}) })
// On scroll animation // On scroll animation
const title = ScrollOut({ requestAnimationFrame(() => {
once: true, const title = ScrollOut({
targets: scope, once: true,
onShown: () => { targets: scope,
console.log('TitleSite show') onShown: () => letters.restart()
letters.restart() })
}
}) })
} }

View File

@@ -21,7 +21,7 @@ export const animateIn = () => {
// Title: Parallax on scroll // Title: Parallax on scroll
const translate = anime({ const translate = anime({
targets: '#title-houses', targets: '#title-houses',
translateX: ['7%', '-15%'], translateX: window.innerWidth <= 1920 ? ['25%', '-15%'] : ['7%', '-7%'],
translateZ: [0, 0], translateZ: [0, 0],
easing: 'linear', easing: 'linear',
duration: animDuration, duration: animDuration,

View File

@@ -57,6 +57,7 @@ button {
line-height: 1; line-height: 1;
color: $color-secondary; color: $color-secondary;
letter-spacing: -2vw; letter-spacing: -2vw;
text-align: center;
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
@@ -65,6 +66,7 @@ button {
} }
@include breakpoint (1920px) { @include breakpoint (1920px) {
font-size: rem(900px); font-size: rem(900px);
letter-spacing: -40px;
} }
&, span { &, span {

View File

@@ -7,6 +7,11 @@
.title-parallax { .title-parallax {
margin-top: -#{pxVW(160)}; margin-top: -#{pxVW(160)};
margin-left: -#{pxVW(160)}; margin-left: -#{pxVW(160)};
@include breakpoint (1920px) {
margin-top: -160px;
margin-left: auto;
}
} }
// Description // Description

View File

@@ -167,13 +167,14 @@
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
max-width: 1920px;
height: 100%; height: 100%;
will-change: transform, opacity; will-change: transform, opacity;
.parallax { .parallax {
width: 100%; width: 100%;
height: 100%; height: 100%;
max-width: 1760px;
margin: 0 auto;
} }
&_img { &_img {
position: relative; position: relative;