You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
163 lines
2.9 KiB
SCSS
163 lines
2.9 KiB
SCSS
2 years ago
|
:root {
|
||
|
--scenePerspective: 1;
|
||
|
--scenePerspectiveOriginX: 50;
|
||
|
--scenePerspectiveOriginY: 0;
|
||
2 years ago
|
--itemZ: 5;
|
||
|
--cameraSpeed: 40; // Where 1 is the fastest
|
||
2 years ago
|
--cameraZ: 0;
|
||
|
--viewportHeight: 105;
|
||
|
}
|
||
|
|
||
2 years ago
|
$n : 300;
|
||
2 years ago
|
|
||
|
.viewport {
|
||
|
height: calc(var(--viewportHeight) * 1px);
|
||
|
|
||
|
.scene3D-container {
|
||
|
z-index: 1;
|
||
|
position: fixed;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
perspective: calc(var(--scenePerspective) * var(--cameraSpeed) * 1px);
|
||
|
perspective-origin: calc(var(--scenePerspectiveOriginX) * 1%) calc(var(--scenePerspectiveOriginY) * 1%);
|
||
|
will-change: perspective-origin;
|
||
|
transform: translate3d(0, 0, 0); //Allow Hardware-Accelerated CSS
|
||
|
|
||
|
.scene3D {
|
||
|
position: absolute;
|
||
|
top: 0;
|
||
|
height: 100vh;
|
||
|
width: 100%;
|
||
|
transform-style: preserve-3d;
|
||
|
transform: translateZ(calc(var(--cameraZ) * 1px));
|
||
|
will-change: transform;
|
||
|
|
||
|
>div {
|
||
|
position: absolute;
|
||
|
display: block;
|
||
|
width: 70%;
|
||
|
top: 100%;
|
||
|
|
||
|
&:nth-child(2n) {
|
||
|
left: 80%;
|
||
|
bottom: 10%;
|
||
|
}
|
||
|
|
||
|
&:nth-child(2n + 1) {
|
||
|
right: 80%;
|
||
|
bottom: 10%
|
||
|
}
|
||
|
|
||
|
|
||
|
@for $i from 0 through $n {
|
||
|
&:nth-child(#{$i}) {
|
||
|
transform: translate3D(random(200) * .1%, random(300) * 1%, calc(var(--itemZ) * var(--cameraSpeed) * #{$i} * -.5px));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// ----------
|
||
|
// Styling
|
||
|
// ----------
|
||
|
|
||
2 years ago
|
|
||
2 years ago
|
|
||
|
*,
|
||
|
*:before,
|
||
|
*:after {
|
||
|
box-sizing: border-box;
|
||
|
}
|
||
|
|
||
|
html {
|
||
|
scroll-behavior: smooth;
|
||
|
}
|
||
|
|
||
|
body {
|
||
2 years ago
|
font-family: 'Courier New', Courier, monospace;
|
||
2 years ago
|
background-color: black;
|
||
|
padding: 0;
|
||
|
margin: 0;
|
||
|
}
|
||
|
|
||
|
#loading {
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
position: absolute;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
z-index: 100;
|
||
|
}
|
||
|
|
||
|
#text {
|
||
|
position: fixed;
|
||
|
z-index: 100;
|
||
|
left: 0;
|
||
|
bottom: 0;
|
||
|
width: 150%;
|
||
|
display: flex;
|
||
|
}
|
||
|
|
||
2 years ago
|
#text {
|
||
|
position: fixed;
|
||
|
left: 0;
|
||
|
// animation: scroll-left 500s linear infinite;
|
||
|
}
|
||
|
|
||
2 years ago
|
.marquee {
|
||
2 years ago
|
font-size: 60px;
|
||
2 years ago
|
color: #0f0;
|
||
|
white-space: nowrap;
|
||
2 years ago
|
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
@keyframes scroll-left {
|
||
2 years ago
|
0% {
|
||
2 years ago
|
// transform: translateX(100px);
|
||
|
left: 0;
|
||
2 years ago
|
}
|
||
|
|
||
|
100% {
|
||
2 years ago
|
// transform: translateX(0);
|
||
|
left: -3000%
|
||
2 years ago
|
}
|
||
|
}
|
||
|
|
||
2 years ago
|
@-moz-keyframes scroll-left {
|
||
|
0% {
|
||
|
-moz-transform: translateX(100%);
|
||
|
}
|
||
2 years ago
|
|
||
2 years ago
|
100% {
|
||
|
-moz-transform: translateX(-100%);
|
||
|
}
|
||
2 years ago
|
}
|
||
|
|
||
|
|
||
|
|
||
|
.scene3D {
|
||
|
|
||
|
>div {
|
||
|
padding: 5vw;
|
||
|
|
||
|
h1 {
|
||
2 years ago
|
color: white;
|
||
|
font-size: 400px;
|
||
|
width: 1000vw;
|
||
|
margin: 0 0 0 -650%;
|
||
|
text-align: center;
|
||
2 years ago
|
}
|
||
|
|
||
|
img {
|
||
|
width: 150vw;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|