-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathHero.astro
More file actions
111 lines (99 loc) · 2.32 KB
/
Copy pathHero.astro
File metadata and controls
111 lines (99 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
import { LinkButton } from '@astrojs/starlight/components';
import GraphBackground from './GraphBackground.astro';
const { data } = Astro.locals.starlightRoute.entry;
const { title = data.title, tagline, actions = [] } = data.hero || {};
---
<div class="hero" data-graph-hero>
<GraphBackground />
<div class="hero-glow" aria-hidden="true"></div>
<div class="stack">
<div class="copy">
<h1 id="_top" data-page-title set:html={title} />
{tagline && <div class="tagline" set:html={tagline} />}
</div>
{
actions.length > 0 && (
<div class="actions">
{actions.map(({ icon, link: href, text, variant, attrs }) => (
<LinkButton href={href} variant={variant} icon={icon?.name} iconPlacement={attrs?.iconPlacement || 'end'}>
{text}
</LinkButton>
))}
</div>
)
}
</div>
</div>
<style>
.hero {
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding-block: clamp(4rem, calc(2rem + 12vmin), 12rem);
overflow-x: clip;
overflow-y: visible;
}
.hero-glow {
position: absolute;
top: 30%;
left: 50%;
translate: -50% -50%;
width: 60%;
height: 60%;
background: radial-gradient(
ellipse at center,
oklch(45.7% 0.24 277.023 / 0.2) 0%,
oklch(38% 0.189 293.745 / 0.1) 40%,
transparent 70%
);
border-radius: 50%;
filter: blur(60px);
pointer-events: none;
z-index: 0;
}
:root[data-theme="light"] .hero-glow {
background: radial-gradient(
ellipse at center,
oklch(70.2% 0.183 293.541 / 0.12) 0%,
oklch(78.5% 0.115 274.713 / 0.06) 40%,
transparent 70%
);
}
.stack {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
gap: clamp(1.5rem, calc(1.5rem + 1vw), 2rem);
text-align: center;
align-items: center;
}
.copy {
display: flex;
flex-direction: column;
gap: 1rem;
align-items: center;
}
.copy > * {
max-width: 50ch;
}
h1 {
font-size: clamp(var(--sl-text-3xl), calc(0.25rem + 5vw), var(--sl-text-6xl));
line-height: var(--sl-line-height-headings);
font-weight: 800;
color: var(--sl-color-white);
letter-spacing: -0.03em;
}
.tagline {
font-size: clamp(var(--sl-text-base), calc(0.0625rem + 2vw), var(--sl-text-xl));
color: var(--sl-color-gray-2);
}
.actions {
display: flex;
gap: 1rem 2rem;
flex-wrap: wrap;
justify-content: center;
}
</style>