Skip to content

Commit

Permalink
perf(theme): improve home hero transition
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Jun 18, 2024
1 parent d9be40e commit 018cecf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion theme/src/client/components/Home/VPHomeHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,23 @@ useHomeHeroTintPlate(
height: calc(100% + var(--vp-footer-height, 0px));
}
@property --vp-home-hero-bg-filter {
inherits: false;
initial-value: #fff;
syntax: "<color>";
}
.bg-filter::after {
--vp-home-hero-bg-filter: var(--vp-c-bg);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: "";
background: linear-gradient(to bottom, var(--vp-c-bg) 0, transparent 40%, transparent 60%, var(--vp-c-bg) 140%);
background: linear-gradient(to bottom, var(--vp-home-hero-bg-filter) 0, transparent 45%, transparent 55%, var(--vp-home-hero-bg-filter) 140%);
transition: --vp-home-hero-bg-filter var(--t-color);
}
.bg-filter canvas {
Expand Down

0 comments on commit 018cecf

Please sign in to comment.