Skip to content

Commit 2e49b01

Browse files
committed
fix: morpher layout shift
1 parent 7ffda5b commit 2e49b01

File tree

2 files changed

+41
-23
lines changed

2 files changed

+41
-23
lines changed

app/[locale]/10years/_components/TenYearHero.tsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ import ParallaxImage from "@/components/Image/ParallaxImage"
88
import TenYearBackgroundImage from "@/public/images/10-year-anniversary/10-year-background.png"
99
import TenYearGraphicImage from "@/public/images/10-year-anniversary/10-year-graphic.png"
1010

11+
const [initialText, ...initialWords] = [
12+
"censorship resistance",
13+
"100% uptime",
14+
"decentralization",
15+
"community building",
16+
"developer growth",
17+
"global collaboration",
18+
"cypherpunk values",
19+
"hackathons",
20+
"censorship resistance",
21+
"permissionless finance",
22+
"credible neutrality",
23+
"the infinite garden",
24+
"client diversity",
25+
]
26+
1127
const TenYearHero = () => {
1228
const [words, setWords] = useState<{ text: string; words: string[] }>({
13-
text: "censorship resistance",
14-
words: [
15-
"censorship resistance",
16-
"100% uptime",
17-
"decentralization",
18-
"community building",
19-
"developer growth",
20-
"global collaboration",
21-
"cypherpunk values",
22-
"hackathons",
23-
"censorship resistance",
24-
"permissionless finance",
25-
"credible neutrality",
26-
"the infinite garden",
27-
"client diversity",
28-
],
29+
text: initialText,
30+
words: initialWords,
2931
})
3032

3133
// loops over chars to morph a text to another
@@ -136,7 +138,17 @@ const TenYearHero = () => {
136138
</div>
137139
<p className="text-center text-3xl">
138140
Celebrating 10 years of{" "}
139-
<span className="font-bold text-accent-b">{words.text}</span>
141+
<span className="relative max-md:block md:w-fit">
142+
<span
143+
className="select-none opacity-0 max-md:hidden"
144+
data-label="space-holder"
145+
>
146+
{initialText}
147+
</span>
148+
<span className="font-bold text-accent-b md:absolute md:start-0 md:text-nowrap">
149+
{words.text}
150+
</span>
151+
</span>
140152
</p>
141153
</div>
142154
)

src/styles/global.css

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
rgba(58, 142, 137, 0.2) 100%
2525
);
2626
--feedback-gradient: var(--gradient-main);
27-
--table-box-shadow: 0 14px 66px rgba(0, 0, 0, 0.07),
28-
0 10px 17px rgba(0, 0, 0, 0.03), 0 4px 7px rgba(0, 0, 0, 0.05);
27+
--table-box-shadow:
28+
0 14px 66px rgba(0, 0, 0, 0.07), 0 10px 17px rgba(0, 0, 0, 0.03),
29+
0 4px 7px rgba(0, 0, 0, 0.05);
2930
--table-item-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
3031

3132
--gradient-banner: radial-gradient(
@@ -49,7 +50,7 @@
4950
rgba(231, 202, 200, 0.1) 82.88%
5051
);
5152

52-
--gradient-step-1: rgba(127, 127, 213, 0.20);
53+
--gradient-step-1: rgba(127, 127, 213, 0.2);
5354
}
5455

5556
.dark {
@@ -69,7 +70,8 @@
6970
#44404d 52.42%,
7071
#303038 98.77%
7172
);
72-
--table-box-shadow: 0 14px 66px hsla(0, 0%, 96.1%, 0.07),
73+
--table-box-shadow:
74+
0 14px 66px hsla(0, 0%, 96.1%, 0.07),
7375
0 10px 17px hsla(0, 0%, 96.1%, 0.03), 0 4px 7px hsla(0, 0%, 96.1%, 0.05);
7476
--table-item-box-shadow: 0 1px 1px hsla(0, 0%, 100%, 0.1);
7577
--banner-grid-gradient: linear-gradient(
@@ -78,8 +80,8 @@
7880
rgba(134, 253, 232, 0.08) 100%
7981
);
8082
--search-background: #4c4c4c;
81-
82-
--gradient-step-1: rgba(127, 127, 213, 0.20);
83+
84+
--gradient-step-1: rgba(127, 127, 213, 0.2);
8385
}
8486
}
8587

@@ -201,6 +203,10 @@
201203
.gold {
202204
@apply font-bold text-staking-gold;
203205
}
206+
207+
.dev-ring {
208+
@apply ring ring-red-500 sm:ring-orange-500 md:ring-yellow-400 lg:ring-green-500 xl:ring-blue-500 2xl:ring-violet-500;
209+
}
204210
}
205211

206212
@layer utilities {

0 commit comments

Comments
 (0)