Skip to content

Commit 87afdac

Browse files
authored
Update homepage hero (#594)
1 parent 9a94113 commit 87afdac

3 files changed

Lines changed: 63 additions & 100 deletions

File tree

src/pages/home/_hero-form.png

-25.7 KB
Binary file not shown.

src/pages/home/passport.png

471 KB
Loading

src/pages/index.astro

Lines changed: 63 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
2-
32
import { Image } from "astro:assets";
43
import { RiArrowRightLine } from "@remixicon/react";
54
import Sponsors from "../components/Sponsors.astro";
65
import SupportMap from "../components/SupportMap.astro";
76
import { siteInfo } from "../constants/site-info";
87
import BaseLayout from "../layouts/BaseLayout.astro";
9-
import heroIllustration from "./home/_hero-form.png";
8+
import passport from "./home/passport.png";
109
---
1110

1211
<BaseLayout
@@ -15,51 +14,32 @@ import heroIllustration from "./home/_hero-form.png";
1514
ogImage={siteInfo.image.src}
1615
ogAlt={siteInfo.image.alt}
1716
>
18-
<div class="home">
19-
<h1>
20-
<span>Your name is</span>
21-
<span class="hero-highlight">yours to change</span>
22-
</h1>
23-
<div class="hero">
24-
<Image
25-
src={heroIllustration}
26-
alt="Some snails and flowers on top of a court order document"
27-
class="illustration"
28-
widths={[800, 1200, 1800]}
29-
sizes={`(max-width: 400px) 800px, (max-width: 600px) 1200px, 1800px`}
30-
/>
31-
</div>
32-
<section class="content">
33-
<p>
34-
<strong
35-
>Changing your legal name and gender marker can feel daunting.</strong
36-
>
37-
{" "}How long will the process take? How much will it cost? Do I need to
38-
find a notary (and if so, where)? Is the court system kind to trans
39-
people? Will I need to publish my name change in a newspaper?
40-
</p>
41-
<p>It can all feel overwhelming, but it doesn't have to be.</p>
42-
<p>
43-
We're trans, and after going through this process ourselves, we built
44-
Namesake to make it easier for others. Namesake helps you fill out
45-
forms, track your progress, access financial resources, and receive
46-
community support. It's free, <a href={siteInfo.socialLinks.github.href}
47-
>open source</a
17+
<div class="hero">
18+
<div class="hero-content">
19+
<h1>Your name is <span class="hero-highlight">yours</span> to change</h1>
20+
<p class="subtitle">
21+
Namesake publishes name change guides and tools for trans people in the
22+
U.S. It's free, <a href={siteInfo.socialLinks.github.href}
23+
>open&nbsp;source</a
4824
>, and always will be.
4925
</p>
50-
<p>
51-
Rigid systems weren't built for us, but we'll figure them out together.
52-
</p>
5326
<div class="buttons">
5427
<a href={siteInfo.urls.guides} class="button primary"
5528
>Browse guides <RiArrowRightLine className="icon" /></a
5629
>
5730
<a href={siteInfo.urls.chat}>Join us on Discord</a>
5831
</div>
59-
</section>
60-
<SupportMap />
61-
<Sponsors />
32+
</div>
33+
<Image
34+
class="hero-image"
35+
src={passport}
36+
alt=""
37+
width={440}
38+
densities={[1, 2]}
39+
/>
6240
</div>
41+
<SupportMap />
42+
<Sponsors />
6343
</BaseLayout>
6444

6545
<script>
@@ -68,102 +48,85 @@ import heroIllustration from "./home/_hero-form.png";
6848
const heroHighlight: HTMLElement | null =
6949
document.querySelector(".hero-highlight");
7050

71-
const isForcedColors = window.matchMedia("(forced-colors: active)").matches;
72-
if (heroHighlight && !isForcedColors) {
73-
heroHighlight.style.color = "var(--background-color)";
51+
if (heroHighlight) {
7452
const highlight = annotate(heroHighlight, {
75-
type: "highlight",
76-
iterations: 1,
53+
type: "circle",
54+
iterations: 2,
55+
padding: 4,
56+
strokeWidth: 3,
7757
});
7858
highlight.show();
7959
}
8060
</script>
8161

8262
<style lang="scss">
83-
.home {
63+
.hero {
64+
width: min(100vw, 1200px);
65+
padding-inline: var(--space-l);
66+
margin-inline: calc(var(--space-l) * -1);
67+
overflow: hidden;
8468
display: flex;
85-
flex-direction: column;
69+
flex-direction: row;
8670
align-items: center;
87-
padding-block: var(--space-2xl);
71+
gap: var(--space-xs);
8872
}
8973

90-
@keyframes slideInUp {
91-
from {
92-
transform: translateY(var(--space-m));
93-
opacity: 0;
94-
}
95-
to {
96-
transform: translateY(0);
97-
opacity: 1;
98-
}
99-
}
100-
101-
.hero {
102-
padding-inline: var(--space-2xs);
103-
padding-block-start: var(--space-3xl);
104-
margin-inline: calc(-1 * var(--space-m));
105-
position: relative;
106-
overflow: hidden;
107-
max-width: 100vw;
74+
.hero-content {
75+
display: flex;
76+
flex-direction: column;
77+
gap: var(--space-l);
78+
padding-block: var(--space-2xl);
10879
}
10980

110-
.illustration {
111-
width: 900px;
112-
max-width: 100%;
113-
user-select: none;
114-
pointer-events: none;
81+
.hero-image {
82+
flex-shrink: 0;
11583
mix-blend-mode: multiply;
116-
animation: slideInUp 0.6s ease-out 0.3s both;
11784

118-
@media (forced-colors: active) {
119-
filter: invert(1);
120-
mix-blend-mode: screen;
85+
@media (width < 1200px) {
86+
margin-inline-end: -48px;
12187
}
122-
}
123-
124-
h1 {
125-
text-align: center;
126-
font-size: var(--step-5);
12788

128-
@media (width >= 420px) {
129-
font-size: var(--step-6);
89+
@media (width < 1060px) {
90+
width: 400px;
91+
margin-inline-end: -80px;
13092
}
13193

132-
@media (width >= 600px) {
133-
font-size: var(--step-7);
94+
@media (width < 920px) {
95+
width: 360px;
13496
}
13597

136-
span {
137-
white-space: nowrap;
98+
@media (width < 860px) {
99+
width: 320px;
100+
margin-block-start: var(--space-3xl);
101+
align-self: flex-start;
138102
}
139-
}
140103

141-
.hero-highlight {
142-
color: var(--background-color);
104+
@media (width < 580px) {
105+
display: none;
106+
}
143107
}
144108

145-
.content {
146-
padding-block-start: var(--space-xl);
147-
max-width: 860px;
148-
font-size: var(--step-1);
149-
animation: slideInUp 0.6s ease-out 0.6s both;
150-
text-wrap: pretty;
109+
h1 {
110+
font-size: var(--step-5);
111+
text-wrap: balance;
151112

152-
:global(p) + :global(p) {
153-
margin-top: var(--space-l);
113+
@media (width >= 600px) {
114+
font-size: var(--step-6);
154115
}
116+
}
155117

156-
@media (width < 540px) {
157-
font-size: var(--step-0);
158-
}
118+
.subtitle {
119+
font-size: var(--step-1);
120+
max-width: 58ch;
121+
text-wrap: balance;
159122
}
160123

161124
.buttons {
162125
display: flex;
163-
flex-direction: column;
126+
flex-direction: row;
164127
align-items: center;
128+
flex-wrap: wrap;
165129
gap: var(--space-l);
166-
margin-block-start: var(--space-3xl);
167130
}
168131

169132
.icon {

0 commit comments

Comments
 (0)