Skip to content

Commit bb01422

Browse files
committed
Merge branch 'dev' into 10yearintl
2 parents 37741e9 + a45d5fc commit bb01422

File tree

33 files changed

+397
-768
lines changed

33 files changed

+397
-768
lines changed

.all-contributorsrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11685,7 +11685,8 @@
1168511685
"avatar_url": "https://avatars.githubusercontent.com/u/6020891?v=4",
1168611686
"profile": "http://www.edukids.cz",
1168711687
"contributions": [
11688-
"eventOrganizing"
11688+
"eventOrganizing",
11689+
"maintenance"
1168911690
]
1169011691
},
1169111692
{
@@ -12770,6 +12771,15 @@
1277012771
"contributions": [
1277112772
"maintenance"
1277212773
]
12774+
},
12775+
{
12776+
"login": "Nik-EpicWeb3",
12777+
"name": "Nik-EpicWeb3",
12778+
"avatar_url": "https://avatars.githubusercontent.com/u/214466248?v=4",
12779+
"profile": "https://github.com/Nik-EpicWeb3",
12780+
"contributions": [
12781+
"eventOrganizing"
12782+
]
1277312783
}
1277412784
],
1277512785
"contributorsPerLine": 7,

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# NEXT_PUBLIC_ALGOLIA_BASE_SEARCH_INDEX_NAME=insertValue
1515

1616
# Github token for read-only use with api functions
17-
# NEXT_PUBLIC_GITHUB_TOKEN_READ_ONLY=insertValue
17+
# GITHUB_TOKEN_READ_ONLY=insertValue
1818

1919
# Etherscan API key (required for Etherscan API fetches)
2020
# ETHERSCAN_API_KEY=insertValue

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
18361836
<td align="center" valign="top" width="14.28%"><a href="http://hector.im"><img src="https://avatars.githubusercontent.com/u/12469549?v=4?s=100" width="100px;" alt="Héctor Chong"/><br /><sub><b>Héctor Chong</b></sub></a><br /><a href="#content-Hector-Chong" title="Content">🖋</a></td>
18371837
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nakmr"><img src="https://avatars.githubusercontent.com/u/145886319?v=4?s=100" width="100px;" alt="nace.kimura"/><br /><sub><b>nace.kimura</b></sub></a><br /><a href="#content-nakmr" title="Content">🖋</a></td>
18381838
<td align="center" valign="top" width="14.28%"><a href="https://github.com/WuRuiLei2023"><img src="https://avatars.githubusercontent.com/u/149141323?v=4?s=100" width="100px;" alt="WuRuiLei2023"/><br /><sub><b>WuRuiLei2023</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AWuRuiLei2023" title="Bug reports">🐛</a></td>
1839-
<td align="center" valign="top" width="14.28%"><a href="http://www.edukids.cz"><img src="https://avatars.githubusercontent.com/u/6020891?v=4?s=100" width="100px;" alt="Radek"/><br /><sub><b>Radek</b></sub></a><br /><a href="#eventOrganizing-radeksvarz" title="Event Organizing">📋</a></td>
1839+
<td align="center" valign="top" width="14.28%"><a href="http://www.edukids.cz"><img src="https://avatars.githubusercontent.com/u/6020891?v=4?s=100" width="100px;" alt="Radek"/><br /><sub><b>Radek</b></sub></a><br /><a href="#eventOrganizing-radeksvarz" title="Event Organizing">📋</a> <a href="#maintenance-radeksvarz" title="Maintenance">🚧</a></td>
18401840
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bhargavkakadiya"><img src="https://avatars.githubusercontent.com/u/26486494?v=4?s=100" width="100px;" alt="Bhargav kakadiya"/><br /><sub><b>Bhargav kakadiya</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Abhargavkakadiya" title="Bug reports">🐛</a></td>
18411841
</tr>
18421842
<tr>
@@ -1990,6 +1990,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
19901990
<td align="center" valign="top" width="14.28%"><a href="https://github.com/smithrashell"><img src="https://avatars.githubusercontent.com/u/36465023?v=4?s=100" width="100px;" alt="Rashell Smith"/><br /><sub><b>Rashell Smith</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Asmithrashell" title="Bug reports">🐛</a></td>
19911991
<td align="center" valign="top" width="14.28%"><a href="https://github.com/aolson078"><img src="https://avatars.githubusercontent.com/u/69769089?v=4?s=100" width="100px;" alt="Alex Olson"/><br /><sub><b>Alex Olson</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Aaolson078" title="Bug reports">🐛</a></td>
19921992
<td align="center" valign="top" width="14.28%"><a href="https://www.suci.io/"><img src="https://avatars.githubusercontent.com/u/155696196?v=4?s=100" width="100px;" alt="SUCI - Blockchain Hub Team"/><br /><sub><b>SUCI - Blockchain Hub Team</b></sub></a><br /><a href="#maintenance-adminsuci" title="Maintenance">🚧</a></td>
1993+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Nik-EpicWeb3"><img src="https://avatars.githubusercontent.com/u/214466248?v=4?s=100" width="100px;" alt="Nik-EpicWeb3"/><br /><sub><b>Nik-EpicWeb3</b></sub></a><br /><a href="#eventOrganizing-Nik-EpicWeb3" title="Event Organizing">📋</a></td>
19931994
</tr>
19941995
</tbody>
19951996
</table>
Lines changed: 27 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,30 @@
11
"use client"
22

3-
import { useEffect, useState } from "react"
4-
53
import { Image } from "@/components/Image"
64
import ParallaxImage from "@/components/Image/ParallaxImage"
5+
import Morpher from "@/components/Morpher"
76

87
import { useTranslation } from "@/hooks/useTranslation"
98
import TenYearBackgroundImage from "@/public/images/10-year-anniversary/10-year-background.png"
109
import TenYearGraphicImage from "@/public/images/10-year-anniversary/10-year-graphic.png"
1110

1211
const TenYearHero = () => {
1312
const { t } = useTranslation("page-10-year-anniversary")
14-
const [words, setWords] = useState<{ text: string; words: string[] }>({
15-
text: t("page-10-year-censorship-resistance"),
16-
words: [
17-
t("page-10-year-censorship-resistance"),
18-
t("page-10-year-uptime"),
19-
t("page-10-year-decentralization"),
20-
t("page-10-year-community-building"),
21-
t("page-10-year-developer-growth"),
22-
t("page-10-year-global-collaboration"),
23-
t("page-10-year-cypherpunk-values"),
24-
t("page-10-year-hackathons"),
25-
t("page-10-year-permissionless-finance"),
26-
t("page-10-year-credible-neutrality"),
27-
t("page-10-year-infinite-garden"),
28-
t("page-10-year-client-diversity"),
29-
],
30-
})
31-
32-
// loops over chars to morph a text to another
33-
const morpher = (start: string, end: string): void => {
34-
// array of chars to randomly morph the text between start and end
35-
const chars = "abcdfgijklnopqsvwxyz".split("")
36-
// duration of the global morph
37-
const duration = 3
38-
// speed of the morph for each letter
39-
const frameRate = 30
40-
41-
// text variables
42-
const textString = start.split("")
43-
const result = end.split("")
44-
const slen = textString.length
45-
const rlen = result.length
46-
47-
// time variables
48-
let present = new Date()
49-
let past = present.getTime()
50-
let count = 0
51-
let spentTime = 0
52-
// splitTime = milliseconds / letters
53-
const splitTime = (duration * 70) / Math.max(slen, rlen)
54-
55-
function update() {
56-
// Update present date and spent time
57-
present = new Date()
58-
spentTime += present.getTime() - past
59-
60-
// Random letters
61-
for (let i = count; i < Math.min(slen, rlen, 18); i++) {
62-
const random = Math.floor(Math.random() * (chars.length - 1))
63-
// Change letter
64-
textString[i] = chars[random]
65-
}
66-
67-
// Morph letters from start to end
68-
if (spentTime >= splitTime) {
69-
// Update count of letters to morph
70-
count += Math.floor(spentTime / splitTime)
71-
// Morphing
72-
for (let j = 0; j < count; j++) {
73-
textString[j] = result[j] || ""
74-
}
75-
// Reset spent time
76-
spentTime = 0
77-
}
78-
79-
// Update DOM
80-
setWords({ ...words, text: textString.join("") })
81-
82-
// Save present date
83-
past = present.getTime()
8413

85-
// Loop
86-
if (count < Math.max(slen, rlen)) {
87-
// Only use a setTimeout if the frameRate is lower than 60FPS
88-
// Remove the setTimeout if the frameRate is equal to 60FPS
89-
morphTimeout = setTimeout(() => {
90-
window.requestAnimationFrame(update)
91-
}, 1000 / frameRate)
92-
}
93-
}
94-
95-
// Start loop
96-
update()
97-
}
98-
99-
let morphTimeout: NodeJS.Timeout
100-
101-
useEffect(() => {
102-
let counter = 0
103-
104-
const morphInterval = setInterval(() => {
105-
const start = words.text
106-
const end = words.words[counter]
107-
108-
morpher(start, end)
109-
110-
if (counter < words.words.length - 1) {
111-
counter++
112-
} else {
113-
counter = 0
114-
}
115-
}, 3000)
116-
117-
return () => {
118-
clearInterval(morphInterval)
119-
clearTimeout(morphTimeout)
120-
}
121-
// eslint-disable-next-line react-hooks/exhaustive-deps
122-
}, [])
14+
const WORDS = [
15+
t("page-10-year-censorship-resistance"),
16+
t("page-10-year-uptime"),
17+
t("page-10-year-decentralization"),
18+
t("page-10-year-community-building"),
19+
t("page-10-year-developer-growth"),
20+
t("page-10-year-global-collaboration"),
21+
t("page-10-year-cypherpunk-values"),
22+
t("page-10-year-hackathons"),
23+
t("page-10-year-permissionless-finance"),
24+
t("page-10-year-credible-neutrality"),
25+
t("page-10-year-infinite-garden"),
26+
t("page-10-year-client-diversity"),
27+
]
12328

12429
return (
12530
<div>
@@ -136,11 +41,20 @@ const TenYearHero = () => {
13641
/>
13742
</div>
13843
<p className="text-center text-3xl">
139-
{t("page-10-year-celebrating")}{" "}
140-
<span className="font-bold text-accent-b">{words.text}</span>
44+
Celebrating 10 years of{" "}
45+
<span className="relative max-md:block md:w-fit">
46+
<span
47+
className="select-none opacity-0 max-md:hidden"
48+
data-label="space-holder"
49+
>
50+
{WORDS[0]}
51+
</span>
52+
<span className="text-3xl font-bold text-accent-b md:absolute md:start-0 md:text-nowrap">
53+
<Morpher words={WORDS} charSet="abcdfgijklnopqsvwxyz" />
54+
</span>
55+
</span>
14156
</p>
14257
</div>
14358
)
14459
}
145-
14660
export default TenYearHero

app/[locale]/10years/page.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { Suspense } from "react"
12
import { pick } from "lodash"
3+
import dynamic from "next/dynamic"
24
import {
35
getMessages,
46
getTranslations,
@@ -14,6 +16,7 @@ import MainArticle from "@/components/MainArticle"
1416
import Translation from "@/components/Translation"
1517
import { ButtonLink } from "@/components/ui/buttons/Button"
1618
import { LinkBox, LinkOverlay } from "@/components/ui/link-box"
19+
import { Skeleton } from "@/components/ui/skeleton"
1720
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
1821

1922
import { cn } from "@/lib/utils/cn"
@@ -28,14 +31,17 @@ import CountDown from "./_components/CountDown"
2831
import { adoptionCards, adoptionStyles } from "./_components/data"
2932
import InnovationSwiper from "./_components/InnovationSwiper"
3033
import Stories from "./_components/Stories"
31-
import TenYearGlobe from "./_components/TenYearGlobe"
3234
import TenYearHero from "./_components/TenYearHero"
3335
import { parseStoryDates } from "./_components/utils"
3436

3537
import { fetch10YearEvents } from "@/lib/api/fetch10YearEvents"
3638
import { fetch10YearStories } from "@/lib/api/fetch10YearStories"
3739
import TenYearLogo from "@/public/images/10-year-anniversary/10-year-logo.png"
3840

41+
const TenYearGlobe = dynamic(() => import("./_components/TenYearGlobe"), {
42+
ssr: false,
43+
})
44+
3945
// In seconds
4046
const REVALIDATE_TIME = BASE_TIME_UNIT * 1
4147

@@ -100,16 +106,22 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
100106
{t("page-10-year-join-party-description")}
101107
</p>
102108
</div>
103-
<div>
104-
<TenYearGlobe
105-
events={Object.values(fetched10YearEvents).flatMap((region) =>
106-
region.events.map((event) => ({
107-
...event,
108-
lat: Number(event.lat),
109-
lng: Number(event.lng),
110-
}))
111-
)}
112-
/>
109+
<div className="h-[max(fit,260px)] sm:h-[400px] md:h-[500px] lg:h-[600px]">
110+
<Suspense
111+
fallback={
112+
<Skeleton className="mx-auto aspect-square h-full rounded-full bg-primary/20 blur-2xl" />
113+
}
114+
>
115+
<TenYearGlobe
116+
events={Object.values(fetched10YearEvents).flatMap((region) =>
117+
region.events.map((event) => ({
118+
...event,
119+
lat: Number(event.lat),
120+
lng: Number(event.lng),
121+
}))
122+
)}
123+
/>
124+
</Suspense>
113125
</div>
114126
</div>
115127
</div>
@@ -358,7 +370,7 @@ export async function generateMetadata({
358370

359371
return await getMetadata({
360372
locale,
361-
slug: ["10-year-anniversary"],
373+
slug: ["10years"],
362374
title: t("page-10-year-anniversary-meta-title"),
363375
description: t("page-10-year-anniversary-meta-description"),
364376
})

0 commit comments

Comments
 (0)