feat: hero section animations and spacing, urgent banner style

This commit is contained in:
Florian Sylvain
2025-10-14 19:03:27 +02:00
parent ba90a685d6
commit c929c87e50
2 changed files with 207 additions and 30 deletions
+178 -18
View File
@@ -38,9 +38,19 @@ body {
padding: 24px;
}
main.container {
padding: 0;
}
main.container > section:not(.hero-fullscreen),
main.container > .card {
padding: 24px;
}
/* Top Bar */
.site-header {
position: sticky;
position: fixed;
width: 100%;
top: 0;
z-index: 20;
backdrop-filter: saturate(1.2) blur(6px);
@@ -169,6 +179,14 @@ body {
text-align: center;
}
.hero-fullscreen {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
}
.hero-card {
max-width: 800px;
margin: 0 auto;
@@ -193,6 +211,78 @@ body {
margin-bottom: 1.5rem;
}
.hero h1 .word {
display: inline-block;
opacity: 0;
animation: slideUpWord 0.6s ease forwards;
}
.hero h1 .word:nth-child(1) {
animation-delay: 0.1s;
}
.hero h1 .word:nth-child(2) {
animation-delay: 0.2s;
}
.hero h1 .word:nth-child(3) {
animation-delay: 0.3s;
}
.hero h1 .word:nth-child(4) {
animation-delay: 0.4s;
}
.hero h1 .word:nth-child(5) {
animation-delay: 0.5s;
}
.hero h1 .word:nth-child(6) {
animation-delay: 0.6s;
}
.hero h1 .word:nth-child(7) {
animation-delay: 0.7s;
}
.hero h1 .word:nth-child(8) {
animation-delay: 0.8s;
}
.hero h1 .word:nth-child(9) {
animation-delay: 0.9s;
}
.hero h1 .word:nth-child(10) {
animation-delay: 1s;
}
.hero h1 .word:nth-child(11) {
animation-delay: 1.1s;
}
@keyframes slideUpWord {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in {
opacity: 0;
animation: fadeIn 0.8s ease forwards;
animation-delay: 0.2s;
}
.animate-fade-in-delayed {
opacity: 0;
animation: fadeIn 0.8s ease forwards;
animation-delay: 1.3s;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.hero p {
margin: 0 0 14px;
margin-bottom: 2rem;
@@ -214,7 +304,15 @@ body {
/* Sections */
section {
margin-top: 28px;
margin-top: 48px;
}
section.hero-fullscreen {
margin-top: 0;
}
section:first-of-type {
margin-top: 0;
}
.card {
@@ -222,6 +320,7 @@ section {
border: 1px solid var(--border);
border-radius: 16px;
padding: 18px;
margin: 24px 8px;
}
h2 {
@@ -358,6 +457,7 @@ a {
text-decoration-color: var(--accent);
text-decoration-thickness: 0.08em;
text-underline-offset: 2px;
transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover {
@@ -369,16 +469,46 @@ a:visited {
color: var(--accent);
}
a:visited:hover {
color: var(--accent-2);
}
/* Urgent banner */
.banner {
opacity: 0;
transform: translateY(-100%);
animation: slideInFromTop 0.6s ease forwards;
animation-delay: 1.5s;
position: fixed;
left: 0;
right: 0;
z-index: 15;
pointer-events: none;
margin-top: 82px;
}
.banner .container {
display: flex;
align-items: center;
gap: 12px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 14px;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 12px;
margin-top: 18px;
backdrop-filter: saturate(1.2) blur(6px);
pointer-events: all;
max-width: 1084px;
}
@keyframes slideInFromTop {
from {
opacity: 0;
transform: translateY(-100%);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.badge-urgent {
@@ -396,22 +526,34 @@ a:visited {
margin-left: auto;
}
/* Links */
a {
color: var(--accent);
text-decoration: underline;
text-decoration-color: var(--accent);
text-decoration-thickness: 0.08em;
text-underline-offset: 2px;
/* Buttons */
.btn {
display: inline-block;
padding: 10px 20px;
border-radius: 10px;
text-decoration: none;
font-weight: 600;
transition: all 0.2s ease;
border: 1px solid var(--border);
background: var(--surface);
color: var(--foreground);
}
a:hover {
color: var(--accent-2);
text-decoration-color: var(--accent-2);
.btn:hover {
background: var(--surface-2);
transform: translateY(-2px);
}
a:visited {
color: var(--accent);
.btn.primary {
background: var(--accent);
color: var(--background);
border-color: var(--accent);
}
.btn.primary:hover {
background: var(--accent-2);
border-color: var(--accent-2);
color: var(--background);
}
/* Clickable project cards */
@@ -468,6 +610,24 @@ footer .to-top {
padding: 16px;
}
main.container > section:not(.hero-fullscreen),
main.container > .card {
padding: 16px;
}
.hero-fullscreen {
min-height: calc(100vh - 70px);
padding: 24px 16px;
}
.banner {
display: none;
}
section {
margin-top: 32px;
}
.menu-toggle {
display: inline-flex;
}