Skip to content

Commit ddb0539

Browse files
Update index.js
1 parent 736e9b9 commit ddb0539

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

pages/docs/index.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ import { useGlobalContext } from '@/global-context';
3333

3434
const tutorial = {
3535
'JS': [
36-
`import { encode, decode } from "${process.env.scriptURL}";`
36+
`import { encode, decode } from "${process.env.scriptURL}";`,
37+
'const text = "Hello, Encoder.js!";\nconst key = "TOP SECRET KEY";\nconst encoded = encode(text, key, true);\nconst decoded = decode(encoded, key);\n\nconsole.log(` text: "${text}"\n key: "${key}"\nencoded: "${encoded}"\ndecoded: "${decoded}"`);'
3738
],
3839
'TS': [
39-
`import { encode as encd, decode as decd } from "${process.env.scriptURL}";\nconst encode: (text: string, key?: string, compress?: boolean) => string = encd;\nconst decode: (text: string, key?: string) => string = decd;`
40+
`import { encode as encd, decode as decd } from "${process.env.scriptURL}";\nconst encode: (text: string, key?: string, compress?: boolean) => string = encd;\nconst decode: (text: string, key?: string) => string = decd;`,
41+
'const text = "Hello, Encoder.js!";\nconst key = "TOP SECRET KEY";\nconst encoded = encode(text, key, true);\nconst decoded = decode(encoded, key);\n\nconsole.log(` text: "${text}"\n key: "${key}"\nencoded: "${encoded}"\ndecoded: "${decoded}"`);'
4042
]
4143
}
4244

@@ -70,7 +72,7 @@ const Home = (props) => {
7072
>
7173
<span data-thq-animate-on-reveal="true" className="home-name">
7274
<span dangerouslySetInnerHTML={{__html:translate.raw('text_-XONHh')}} />
73-
<span dangerouslySetInnerHTML={{__html:` ${translate.raw('text-4')}`}}/>
75+
<span dangerouslySetInnerHTML={{__html:` ${translate.raw('docs-00')}`}}/>
7476
</span>
7577
</animate-on-reveal>
7678
<div
@@ -115,8 +117,8 @@ const Home = (props) => {
115117
</div>
116118
<div className="home-main">
117119
<div className="idk">
118-
<h1 dangerouslySetInnerHTML={{__html: translate.raw('docs-2')}} className="home-name" />
119-
<span dangerouslySetInnerHTML={{__html: translate.raw('docs-3')}} className="tutor" />
120+
<h1 dangerouslySetInnerHTML={{__html: translate.raw('docs-02')}} className="home-name" />
121+
<span dangerouslySetInnerHTML={{__html: translate.raw('docs-03')}} className="tutor" />
120122
<div className='zxc'>{ts?<CopyBlock
121123
text={tutorial.TS[0]}
122124
language='typescript'
@@ -130,6 +132,20 @@ const Home = (props) => {
130132
wrapLines
131133
theme={dracula}
132134
/>}</div>
135+
<span dangerouslySetInnerHTML={{__html: translate.raw('docs-04')}} className="tutor" />
136+
<div className='zxc'>{ts?<CopyBlock
137+
text={tutorial.TS[1]}
138+
language='typescript'
139+
showLineNumbers='true'
140+
wrapLines
141+
theme={dracula}
142+
/>:<CopyBlock
143+
text={tutorial.JS[1]}
144+
language='javascript'
145+
showLineNumbers='true'
146+
wrapLines
147+
theme={dracula}
148+
/>}</div>
133149
</div>
134150
<div className="home-buttons">
135151
<animate-on-reveal
@@ -149,7 +165,7 @@ const Home = (props) => {
149165
<span className="home-text4">
150166
<span className="home-text5"
151167
dangerouslySetInnerHTML={{
152-
__html: translate.raw('docs-1'),
168+
__html: translate.raw('docs-01'),
153169
}}
154170
></span>
155171
<span></span>

0 commit comments

Comments
 (0)