File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
app/[locale]/10years/_components Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import Morpher from "@/components/Morpher"
7
7
import TenYearBackgroundImage from "@/public/images/10-year-anniversary/10-year-background.png"
8
8
import TenYearGraphicImage from "@/public/images/10-year-anniversary/10-year-graphic.png"
9
9
10
- const [ initialText , ... initialWords ] = [
10
+ const WORDS = [
11
11
"censorship resistance" ,
12
12
"100% uptime" ,
13
13
"decentralization" ,
@@ -44,14 +44,10 @@ const TenYearHero = () => (
44
44
className = "select-none opacity-0 max-md:hidden"
45
45
data-label = "space-holder"
46
46
>
47
- { initialText }
47
+ { words [ 0 ] }
48
48
</ span >
49
49
< span className = "text-3xl font-bold text-accent-b md:absolute md:start-0 md:text-nowrap" >
50
- < Morpher
51
- text = { initialText }
52
- words = { initialWords }
53
- charSet = "abcdfgijklnopqsvwxyz"
54
- />
50
+ < Morpher words = { WORDS } charSet = "abcdfgijklnopqsvwxyz" />
55
51
</ span >
56
52
</ span >
57
53
</ p >
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ const LanguageMorpher = () => {
41
41
variant = "ghost"
42
42
>
43
43
< Morpher
44
- text = "Ethereum"
45
44
words = { [
45
+ "Ethereum" ,
46
46
"以太坊" ,
47
47
"イーサリアム" ,
48
48
"Etérium" ,
Original file line number Diff line number Diff line change 3
3
import { useEffect , useState } from "react"
4
4
5
5
type MorpherProps = {
6
- text : string
7
6
words : string [ ]
8
7
charSet ?: string
9
8
}
10
9
11
10
const Morpher = ( {
12
- text,
13
11
words,
14
12
charSet = "abcdefghijklmnopqrstuvwxyz" ,
15
13
} : MorpherProps ) => {
16
- const [ state , setState ] = useState ( { text, words } )
14
+ const [ state , setState ] = useState ( { text : words [ 0 ] , words } )
17
15
18
16
// loops over chars to morph a text to another
19
17
const morpher = ( start : string , end : string ) : void => {
You can’t perform that action at this time.
0 commit comments