The content on this website, including videos and code examples, is for educational purposes only. All demonstrations and designs are fictional and created to illustrate coding techniques. Any resemblance to existing websites or brands is purely coincidental.
The creators and administrators of this website do not claim ownership or affiliation with any existing websites or companies. Users are encouraged to use the information responsibly for learning purposes. Liability for any misuse of the content provided is not accepted.
Below is the html code for this video.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Cubes Spin into the New Year</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wish hide-div">
<div class="holographic-text"><span>Happy</span> <span>New</span> <span>Year</span></div>
</div>
<div class="container">
<div class="text" style="--j: 0">
<span style="--i: 0">2</span> <span style="--i: 1">3</span>
<span style="--i: 2">4</span> <span style="--i: 3">5</span>
</div>
<div class="text" style="--j: 1">
<span style="--i: 0">0</span> <span style="--i: 1">1</span>
<span style="--i: 2">2</span> <span style="--i: 3">3</span>
</div>
<div class="text" style="--j: 2">
<span style="--i: 0">2</span> <span style="--i: 1">3</span>
<span style="--i: 2">4</span> <span style="--i: 3">5</span>
</div>
<div class="text" style="--j: 3">
<span style="--i: 0">4</span> <span style="--i: 1">5</span>
<span style="--i: 2">4</span> <span style="--i: 3">5</span>
</div>
</div>
<div class="mention hide-div">
<div class="holographic-text-2"><span>Everyone</span></div>
</div>
<div class="glowing">
<span style="--i:1"></span><span style="--i:2"></span><span style="--i:3"></span>
</div>
<div class="glowing">
<span style="--i:1"></span><span style="--i:2"></span><span style="--i:3"></span>
</div>
<div class="glowing">
<span style="--i:1"></span><span style="--i:2"></span><span style="--i:3"></span>
</div>
<div class="glowing">
<span style="--i:1"></span><span style="--i:2"></span><span style="--i:3"></span>
</div>
<script src="index.js"></script>
</body>
</html>
Below is the css code for this video.
style.css
@import url("https://fonts.googleapis.com/css2?family=Sedgwick+Ave+Display&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
height: 100vh;
width: 100%;
background-color: #130330;
background-image: linear-gradient(#130330, #520b36);
justify-content: center;
align-items: center;
overflow: hidden;
}
.wish, .mention {
position: absolute;
opacity: 1;
transition: opacity 0.51s 3s ease;
}
.wish {
top: 15%;
transform: translateY(-15%);
}
.mention {
bottom: 15%;
transform: translateY(15%);
}
.holographic-text, .holographic-text-2 {
position: relative;
color: #d0cde2;
text-align: center;
font-size: 6vw;
letter-spacing: 1.5vw;
}
.holographic-text span, .holographic-text-2 span {
position: relative;
font-family: "Sedgwick Ave Display", serif;
text-transform: uppercase;
animation: holographicTextAnim 6s infinite;
}
.holographic-text span:nth-child(2) {
animation-delay: 1s;
}
.holographic-text span:nth-child(3) {
animation-delay: 2s;
}
.holographic-text-2 span {
animation-delay: 3s;
}
@keyframes holographicTextAnim {
0%, 100% {
text-shadow: 0 0 5px #d0cde2, 0 0 10px #d0cde2, 0 0 20px #d0cde2, 0 0 40px #d0cde2;
opacity: 1;
}
50% {
text-shadow: none;
opacity: 0.25;
}
}
.wish.hide-div, .mention.hide-div {
opacity: 0;
}
.container {
position: absolute;
display: flex;
transform: rotateY(30deg) rotateX(10deg) scale(1.5);
transform-style: preserve-3d;
gap: 10px;
cursor: pointer;
}
.container.newyear .text {
transform: rotateX(calc(-360deg * 1));
}
.container.newyear .text:last-child {
transform: rotateX(calc(-630deg * 1));
}
.text {
position: relative;
height: 100px;
width: 100px;
transform-style: preserve-3d;
transition: 2.4s ease-in-out;
transition-delay: calc(0.24s * var(--j));
}
.text span {
position: absolute;
display: flex;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: linear-gradient(#828f7a, #818a7c);
color: #e7eee8;
justify-content: center;
align-items: center;
transform: rotateX(calc(90deg * var(--i))) translateZ(50px);
transform-style: preserve-3d;
font-family: monospace;
font-size: 4vw;
cursor: pointer;
transition: font-size 0.51s 3s ease;
}
.container.newyear .text span {
font-size: 6vw;
}
.text::before {
content: "";
position: absolute;
height: 100%;
width: 100%;
background: #81857e;
transform: rotateY(90deg) translateX(-50px);
transform-origin: left;
}
.text:last-child span {
background: linear-gradient(#84b067, #84ab6a);
}
.text:last-child::before {
background: #84a66d;
}
.glowing {
position: relative;
height: 750px;
min-width: 750px;
margin: -150px;
transform-origin: right;
pointer-events: none;
animation: colorChangeAnim 3s linear infinite;
}
@keyframes colorChangeAnim {
0% {
filter: hue-rotate(0deg);
transform: rotate(0deg);
}
100% {
filter: hue-rotate(360deg);
transform: rotate(360deg);
}
}
.glowing:nth-child(even) {
transform-origin: left;
}
.glowing span {
position: absolute;
top: calc(80px * var(--i));
left: calc(80px * var(--i));
bottom: calc(80px * var(--i));
right: calc(80px * var(--i));
border-radius: 50%;
}
.glowing span::before {
content: "";
position: absolute;
top: 50%;
left: -8px;
height: 15px;
width: 15px;
background: #ff7f7f;
border-radius: 50%;
}
.glowing span:nth-child(3n + 1) {
animation: animate 4s alternate infinite;
}
.glowing span:nth-child(3n + 2) {
animation: animateReverse 5s alternate infinite;
}
.glowing span:nth-child(3n + 3) {
animation: animate 6s alternate infinite;
}
@keyframes animate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes animateReverse {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}
.glowing span:nth-child(3n + 1)::before {
background: #ff7f7f;
box-shadow: 0 0 20px #ff7f7f, 0 0 40px #ff7f7f, 0 0 60px #ff7f7f, 0 0 80px #ff7f7f, 0 0 4px #ff7f7f1a;
}
.glowing span:nth-child(3n + 2)::before {
background: #90ee90;
box-shadow: 0 0 20px #90ee90, 0 0 40px #90ee90, 0 0 60px #90ee90, 0 0 80px #90ee90, 0 0 4px #90ee901a;
}
.glowing span:nth-child(3n + 3)::before {
background: #add8e6;
box-shadow: 0 0 20px #add8e6, 0 0 40px #add8e6, 0 0 60px #add8e6, 0 0 80px #add8e6, 0 0 4px #add8e61a;
}
Below is the javascript code for this video.
index.js
const container = document.querySelector(".container");
const showHideDivs = document.querySelectorAll(".hide-div");
container.onclick = function () {
this.classList.toggle("newyear");
showHideDivs.forEach(each => each.classList.toggle("hide-div"));
}
Thanks for visiting