All checks were successful
continuous-integration/drone/push Build is passing
- Basically add `will-change` to CSS elements to enable GPU animations, less choppy, more sassy - Use requestAnimationFrame over setTimeout - Avoid repaints AMAP
114 lines
2.3 KiB
SCSS
114 lines
2.3 KiB
SCSS
/* ==========================================================================
|
|
PAGE TRANSITION
|
|
========================================================================== */
|
|
.transition {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
z-index: 10000;
|
|
overflow: hidden;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
&, * {
|
|
will-change: transform, opacity;
|
|
}
|
|
|
|
// Content
|
|
&__loader {
|
|
position: relative;
|
|
z-index: 2;
|
|
}
|
|
|
|
// Background
|
|
&__background {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: $color-primary;
|
|
transform-origin: 50% 0;
|
|
}
|
|
|
|
// Hidden
|
|
&.hidden {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
REVEAL ANIMATIONS
|
|
========================================================================== */
|
|
.anim-mask {
|
|
display: block;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
|
|
span {
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* ==========================================================================
|
|
KEYFRAMES ANIMATIONS
|
|
========================================================================== */
|
|
// Rotate button dashes
|
|
@keyframes rotateDashes {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
|
|
/*
|
|
** 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: translate(0,0); }
|
|
100% { transform: translate(-96.95px, 0); }
|
|
}
|
|
.anim-spinGlobeSmall {
|
|
animation: moveContinentsSmall 1.5s linear infinite;
|
|
animation-play-state: paused;
|
|
}
|
|
|
|
|
|
/*
|
|
** Layout
|
|
*/
|
|
// List
|
|
@keyframes layoutListOdd {
|
|
0% { transform: translateX(0); }
|
|
50% { transform: translateX(2px); }
|
|
}
|
|
@keyframes layoutListEven {
|
|
0% { transform: translateX(0); }
|
|
50% { transform: translateX(-4px); }
|
|
}
|
|
|
|
// Grid
|
|
@keyframes layoutGridOdd {
|
|
0% { transform: translateY(0); }
|
|
50% { transform: translateY(2px); }
|
|
}
|
|
@keyframes layoutGridEven {
|
|
0% { transform: translateY(0); }
|
|
50% { transform: translateY(-3px); }
|
|
}
|