Skip to content

Instantly share code, notes, and snippets.

@IntegralPilot
Created May 15, 2025 01:20
Show Gist options
  • Select an option

  • Save IntegralPilot/3777786d96323680c0f4d080fb6bd96b to your computer and use it in GitHub Desktop.

Select an option

Save IntegralPilot/3777786d96323680c0f4d080fb6bd96b to your computer and use it in GitHub Desktop.
Fancy CSS Landing Page Animation
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;700&display=swap');
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: 'Poppins', sans-serif;
overflow: hidden; /* Prevents scrollbars from appearing during animations */
background-color: #1a1a2e; /* Dark fallback */
}
.container {
position: relative;
width: 100%;
height: 100vh; /* Full viewport height */
display: flex;
justify-content: center;
align-items: center;
text-align: center;
color: #e0e0e0; /* Light text color for contrast */
overflow: hidden;
}
.split-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, #e94560 50%, #16213e 50%);
z-index: -1;
animation: slideInSplit 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes slideInSplit {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
.content {
z-index: 1;
padding: 20px;
}
.animated-text {
font-size: 6rem; /* Responsive font size could be vw */
font-weight: 700;
margin-bottom: 20px;
line-height: 1.1;
text-shadow:
2px 2px 0px #0f3460, /* Dark blue shadow */
4px 4px 0px #16213e, /* Even darker shadow for depth */
0 0 30px rgba(233, 69, 96, 0.5); /* Subtle glow matching one side */
}
.animated-text .char {
display: inline-block;
opacity: 0;
transform: translateY(50px) rotate(10deg) scale(0.5);
animation: popInChar 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}
/* Stagger animation for each character */
.animated-text .char:nth-child(1) { animation-delay: 0.5s; }
.animated-text .char:nth-child(2) { animation-delay: 0.6s; }
.animated-text .char:nth-child(3) { animation-delay: 0.7s; }
.animated-text .char:nth-child(4) { animation-delay: 0.8s; }
.animated-text .char:nth-child(5) { animation-delay: 0.9s; }
.animated-text .char:nth-child(6) { animation-delay: 1.0s; } /* Comma */
/* For "World!" after the <br> */
.animated-text .char:nth-child(7) { animation-delay: 1.2s; }
.animated-text .char:nth-child(8) { animation-delay: 1.3s; }
.animated-text .char:nth-child(9) { animation-delay: 1.4s; }
.animated-text .char:nth-child(10) { animation-delay: 1.5s; }
.animated-text .char:nth-child(11) { animation-delay: 1.6s; }
.animated-text .char:nth-child(12) { animation-delay: 1.7s; } /* Exclamation */
@keyframes popInChar {
to {
opacity: 1;
transform: translateY(0) rotate(0deg) scale(1);
}
}
.subtitle {
font-size: 1.5rem;
font-weight: 300;
opacity: 0;
animation: fadeIn 1s ease-out 2.5s forwards;
color: #f5f5f5;
}
.cta-button {
display: inline-block;
margin-top: 30px;
padding: 15px 30px;
background-color: #e94560; /* Accent color */
color: #fff;
text-decoration: none;
font-size: 1.2rem;
border-radius: 50px;
box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
transition: transform 0.3s ease, background-color 0.3s ease;
opacity: 0;
transform: translateY(20px);
animation: slideUpFadeIn 0.8s ease-out 3s forwards;
}
.cta-button:hover {
background-color: #c62e47;
transform: translateY(-3px) scale(1.05);
}
@keyframes fadeIn {
to {
opacity: 1;
}
}
@keyframes slideUpFadeIn {
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive adjustments */
@media (max-width: 768px) {
.animated-text {
font-size: 4rem;
}
.subtitle {
font-size: 1.2rem;
}
.cta-button {
font-size: 1rem;
padding: 12px 25px;
}
}
@media (max-width: 480px) {
.animated-text {
font-size: 2.8rem;
}
.split-bg {
background: linear-gradient(65deg, #e94560 50%, #16213e 50%); /* Adjust angle for smaller screens */
}
.subtitle {
font-size: 1rem;
}
.cta-button {
font-size: 0.9rem;
padding: 10px 20px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment