File tree Expand file tree Collapse file tree 4 files changed +50
-9
lines changed Expand file tree Collapse file tree 4 files changed +50
-9
lines changed Original file line number Diff line number Diff line change
1
+ body {
2
+ padding : 1rem ;
3
+ }
4
+
5
+ h1 : target {
6
+ text-decoration : underline;
7
+ }
8
+
9
+ h1 {
10
+ display : flex;
11
+ align-items : center;
12
+ margin-bottom : 0 ;
13
+
14
+ & : target {
15
+ text-decoration : underline;
16
+ }
17
+ }
18
+
19
+ ul {
20
+ margin-top : 0 ;
21
+ padding : 0 ;
22
+ margin-left : 48px ;
23
+ list-style-type : none;
24
+ display : flex;
25
+ align-items : center;
26
+
27
+ & li {
28
+ cursor : pointer;
29
+ }
30
+ }
Original file line number Diff line number Diff line change 7
7
< title > Industrial Chess</ title >
8
8
< script type ="module " src ="/src/pieces.ts "> </ script >
9
9
< link rel ="stylesheet " href ="style.css " />
10
- <!-- TODO: style this better -- >
10
+ < link rel =" stylesheet " href =" pieces.css " / >
11
11
< link rel ="icon " href ="bishop-knight-white.png ">
12
12
</ head >
13
13
Original file line number Diff line number Diff line change @@ -8,30 +8,36 @@ for (const piece of getAllPieces("white")) {
8
8
9
9
const h1 = document . createElement ( "h1" ) ;
10
10
h1 . id = piece . name ;
11
- let content : string ;
11
+ const span = document . createElement ( "span" )
12
+ const img = document . createElement ( "img" )
13
+ img . src = `${ piece . name } -white.png`
14
+ img . alt = piece . name
12
15
if ( piece . name === "bishop-rook" ) {
13
- content = "Bishop + Rook (Queen)" ;
16
+ span . textContent = "Bishop + Rook (Queen)" ;
14
17
} else if ( piece . name === "amazon" ) {
15
- content = "Amazon (Bishop + Knight + Rook)" ;
18
+ span . textContent = "Amazon (Bishop + Knight + Rook)" ;
16
19
} else {
17
- content = piece . name
20
+ span . textContent = piece . name
18
21
. split ( "-" )
19
22
. map ( ( s ) => s . charAt ( 0 ) . toUpperCase ( ) + s . slice ( 1 ) )
20
23
. join ( " + " ) ;
21
24
}
22
- h1 . textContent = content ;
25
+ h1 . appendChild ( img )
26
+ h1 . appendChild ( span )
23
27
body . appendChild ( h1 ) ;
24
28
25
29
const ul = document . createElement ( "ul" ) ;
30
+ ul . textContent = "requires:"
26
31
for ( const requirement of piece . requirements ) {
27
32
const li = document . createElement ( "li" ) ;
28
33
const a = document . createElement ( "a" ) ;
29
34
a . href = `#${ requirement . name } ` ;
30
- a . textContent = requirement . name ;
35
+ const img = document . createElement ( "img" ) ;
36
+ img . src = `${ requirement . name } -white.png`
37
+ img . alt = requirement . name
38
+ a . appendChild ( img )
31
39
li . appendChild ( a ) ;
32
40
ul . appendChild ( li ) ;
33
41
}
34
42
body . appendChild ( ul ) ;
35
43
}
36
-
37
- // TODO: images
Original file line number Diff line number Diff line change @@ -10,4 +10,9 @@ export default defineConfig({
10
10
} ,
11
11
} ,
12
12
} ,
13
+ server : {
14
+ watch : {
15
+ usePolling : true
16
+ }
17
+ }
13
18
} ) ;
You can’t perform that action at this time.
0 commit comments