Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: smooth bg gradient fade #1588

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@

/* Hero */
.hero {
position: relative;
display: flex;
justify-content: center;
align-items: stretch;
padding: 4rem 0;
}

.hero::after {
content: '';
position: absolute;
inset: 70% 0 0;
background: linear-gradient(transparent, var(--ifm-background-color));
}

html[data-theme='light'] .hero::after {
background: linear-gradient(transparent, var(--ifm-background-surface-color));
}

@media (max-width: 700px) {
.hero {
padding: 1rem 0;
Expand All @@ -40,6 +52,7 @@
align-items: center;
flex-shrink: 0;
max-width: min(50rem, 100%);
z-index: 1;
}

.heroBefore,
Expand Down Expand Up @@ -246,10 +259,28 @@
}

.hero {
animation: hero-intro 2s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
background:
linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px), linear-gradient(#6d6d6d25 1px, transparent 1px), linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px), linear-gradient(#6d6d6d25 1px, transparent 1px), linear-gradient(transparent 6px, transparent 6px, transparent 156px, transparent 156px), linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px), linear-gradient(-90deg, transparent 6px, transparent 6px, transparent 156px, transparent 156px), linear-gradient(#6d6d6d25 1px, transparent 1px), transparent;
background-size: 32px 32px, 32px 32px, 256px 256px, 256px 256px, 256px 256px, 256px 256px, 256px 256px, 256px 256px
animation: hero-intro 2s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
background: linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px),
linear-gradient(#6d6d6d25 1px, transparent 1px),
linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px),
linear-gradient(#6d6d6d25 1px, transparent 1px),
linear-gradient(
transparent 6px,
transparent 6px,
transparent 156px,
transparent 156px
),
linear-gradient(-90deg, #6d6d6d25 1px, transparent 1px),
linear-gradient(
-90deg,
transparent 6px,
transparent 6px,
transparent 156px,
transparent 156px
),
linear-gradient(#6d6d6d25 1px, transparent 1px), transparent;
background-size: 32px 32px, 32px 32px, 256px 256px, 256px 256px, 256px 256px,
256px 256px, 256px 256px, 256px 256px;
}

@keyframes hero-intro {
Expand All @@ -262,4 +293,4 @@
.hero {
animation: none;
}
}
}