Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 6a004f7

Browse files
author
Wenjie Xia
committed
chore: update examples
1 parent 2b7d8fa commit 6a004f7

File tree

28 files changed

+422
-423
lines changed

28 files changed

+422
-423
lines changed
-4.19 KB
Binary file not shown.

examples/default-src-directory/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import React from 'react'
33

44
export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
55
return (
6-
<>
6+
<main>
77
<head>
88
<title>Hello World - Aleph.js</title>
99
</head>
1010
<Page {...pageProps} />
11-
</>
11+
</main>
1212
)
1313
}

examples/default-src-directory/src/pages/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import Logo from '../components/logo.tsx'
44

55
export default function Home() {
66
const [count, setCount] = useState(0)
7-
const version = useDeno(() => {
8-
return Deno.version
9-
})
7+
const version = useDeno(() => Deno.version.deno)
108

119
return (
1210
<div className="page">
13-
<link rel="stylesheet" href="../style/index.less" />
11+
<link rel="stylesheet" href="../style/index.css" />
1412
<p className="logo"><Logo /></p>
1513
<h1>Welcome to use <strong>Aleph.js</strong>!</h1>
1614
<p className="links">
@@ -22,13 +20,13 @@ export default function Home() {
2220
<span></span>
2321
<a href="https://github.com/alephjs/aleph.js" target="_blank">Github</a>
2422
</p>
25-
<p className="counter">
23+
<div className="counter">
2624
<span>Counter:</span>
2725
<strong>{count}</strong>
2826
<button onClick={() => setCount(n => n - 1)}>-</button>
2927
<button onClick={() => setCount(n => n + 1)}>+</button>
30-
</p>
31-
<p className="copyinfo">Built by Aleph.js in Deno v{version.deno}</p>
28+
</div>
29+
<p className="copyinfo">Built by Aleph.js in Deno {version}</p>
3230
</div>
3331
)
3432
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
border: none;
5+
outline: none;
6+
font: inherit;
7+
font-size: 100%;
8+
vertical-align: baseline;
9+
background: transparent;
10+
}
11+
12+
body {
13+
font-family: "Helvetica Neue", Helvetica, Arial sans-serif;
14+
font-size: 16px;
15+
}
16+
17+
main {
18+
display: flex;
19+
align-items: center;
20+
justify-content: center;
21+
height: 100vh;
22+
}
23+
24+
.page h1 {
25+
margin: 0;
26+
line-height: 1.5;
27+
font-size: 18px;
28+
font-weight: 400;
29+
text-align: center;
30+
color: #000;
31+
}
32+
33+
.page h1 strong {
34+
font-weight: 700;
35+
}
36+
37+
.page p {
38+
margin: 0;
39+
line-height: 1.5;
40+
text-align: center;
41+
color: #333;
42+
}
43+
44+
.logo + p {
45+
margin-top: 6px;
46+
}
47+
48+
.links span,
49+
.links a {
50+
display: inline-block;
51+
vertical-align: middle;
52+
}
53+
54+
.links span {
55+
color: #999;
56+
}
57+
58+
.links span::after {
59+
content: '·';
60+
}
61+
62+
.links a {
63+
margin: 0 9px;
64+
color: #777;
65+
text-decoration: none;
66+
border-bottom: 1px dashed #ccc;
67+
}
68+
69+
.links a:hover {
70+
color: #333;
71+
border-bottom-color: transparent;
72+
}
73+
74+
.counter {
75+
display: flex;
76+
justify-content: center;
77+
align-items: center;
78+
width: 270px;
79+
height: 48px;
80+
margin: 30px auto 0;
81+
border: 1px solid #eee;
82+
border-radius: 6px;
83+
transition: border-color 0.15s ease-in;
84+
}
85+
86+
.counter:hover {
87+
border-color: #ccc;
88+
}
89+
90+
.counter strong {
91+
display: inline-block;
92+
width: 48px;
93+
font-weight: 600;
94+
text-align: center;
95+
}
96+
97+
.counter button {
98+
display: line-flex;
99+
align-items: center;
100+
justify-content: center;
101+
width: 20px;
102+
height: 20px;
103+
border-radius: 4px;
104+
box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
105+
line-height: 1;
106+
font-size: 12px;
107+
font-family: Courier, monospace;
108+
font-weight: 600;
109+
color: #666;
110+
transition: color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
111+
cursor: pointer;
112+
}
113+
114+
.counter button:hover {
115+
color: #111;
116+
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
117+
}
118+
119+
.counter button + button {
120+
margin-left: 9px;
121+
}
122+
123+
.page .copyinfo {
124+
margin-top: 30px;
125+
font-size: 14px;
126+
color: #999;
127+
}

examples/default-src-directory/src/style/index.less

Lines changed: 0 additions & 126 deletions
This file was deleted.

examples/hello-world/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import React from 'react'
33

44
export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
55
return (
6-
<>
6+
<main>
77
<head>
88
<title>Hello World - Aleph.js</title>
99
</head>
1010
<Page {...pageProps} />
11-
</>
11+
</main>
1212
)
1313
}

examples/hello-world/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function Home() {
2626
<button onClick={() => setCount(n => n - 1)}>-</button>
2727
<button onClick={() => setCount(n => n + 1)}>+</button>
2828
</div>
29-
<p className="copyinfo">Built by Aleph.js in Deno v{version}</p>
29+
<p className="copyinfo">Built by Aleph.js in Deno {version}</p>
3030
</div>
3131
)
3232
}
-4.19 KB
Binary file not shown.

examples/hello-world/style/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ main {
6565
text-decoration: none;
6666
border-bottom: 1px dashed #ccc;
6767
}
68+
6869
.links a:hover {
6970
color: #333;
7071
border-bottom-color: transparent;
@@ -81,6 +82,7 @@ main {
8182
border-radius: 6px;
8283
transition: border-color 0.15s ease-in;
8384
}
85+
8486
.counter:hover {
8587
border-color: #ccc;
8688
}
@@ -108,6 +110,7 @@ main {
108110
transition: color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
109111
cursor: pointer;
110112
}
113+
111114
.counter button:hover {
112115
color: #111;
113116
box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);

examples/hi/app.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import React from 'react'
33

44
export default function App({ Page, pageProps }: { Page: ComponentType<any>, pageProps: any }) {
55
return (
6-
<>
7-
<head>
8-
<title>Hello World - Aleph.js</title>
9-
</head>
6+
<main>
7+
<link rel="stylesheet" href="./style/app.css" />
108
<Page {...pageProps} />
11-
</>
9+
</main>
1210
)
1311
}

0 commit comments

Comments
 (0)