File tree Expand file tree Collapse file tree 3 files changed +40
-13
lines changed Expand file tree Collapse file tree 3 files changed +40
-13
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,12 @@ piece.ghost {
86
86
opacity : 0.3 ;
87
87
}
88
88
.cg-board-wrap coords {
89
- position : absolute;
89
+ font-weight : bold;
90
+ position : absolute;
90
91
display : flex;
91
92
pointer-events : none;
92
- opacity : 0.8 ;
93
- font-size : 9 px ;
93
+ opacity : 1 ;
94
+ font-size : 12 px ;
94
95
}
95
96
.cg-board-wrap coords .ranks {
96
97
right : -15px ;
Original file line number Diff line number Diff line change 14
14
< body >
15
15
16
16
< div id ="container ">
17
- < div id ="board " class ="chessground blue merida "> </ div >
17
+ < div id ="board " style ="width: 400px " class ="chessground blue merida "> </ div >
18
+ < p >
19
+ < br />
20
+ < form >
21
+ < fieldset >
22
+ < legend > chessbot</ legend >
23
+ < textarea id = "chessbot "
24
+ rows = "1 "
25
+ cols = "80 " /> </ textarea >
26
+ </ fieldset >
18
27
</ div >
19
28
20
29
< script >
24
33
}
25
34
26
35
let ground = Chessground ( document . getElementById ( "board" ) , {
27
- coordinates : false ,
36
+ coordinates : true ,
28
37
movable : {
29
38
free : true ,
30
39
color : "both"
58
67
59
68
setInterval ( ( ) => {
60
69
konsole . log ( getMask ( ) )
61
- } , 1000 )
70
+ } , 250 )
71
+
72
+ // Send a chat text
73
+ function getUtteranceMsg ( utterance ) {
74
+ let s = "TEXT " ;
75
+ s = s + utterance ;
76
+ return s ;
77
+ }
78
+ function sendBot ( ) {
79
+ var utterance = document . getElementById ( "chessbot" ) . value ;
80
+ // Clear
81
+ konsole . log ( getUtteranceMsg ( utterance ) )
82
+ }
83
+ document . getElementById ( "chessbot" ) . addEventListener ( "keydown" , function ( e ) {
84
+ if ( e . keyCode == 13 ) { sendBot ( ) ; clearBot ( ) ; }
85
+ } ) ;
86
+ function clearBot ( ) {
87
+ document . getElementById ( "chessbot" ) . value = "" ;
88
+ }
62
89
</ script >
63
90
</ body >
64
91
</ html >
Original file line number Diff line number Diff line change 1
1
* {
2
2
margin : 0 ;
3
- padding : 0 ;
3
+ padding : 10 ;
4
4
}
5
5
6
6
html {
@@ -16,15 +16,14 @@ body {
16
16
}
17
17
18
18
# container {
19
- width : 100% ;
20
- height : 100% ;
21
- display : flex;
22
- flex-direction : column;
19
+ display : table;
20
+ height : 800px ;
21
+ width : 100% ;
23
22
justify-content : center;
24
23
}
25
24
26
25
# board {
27
26
margin : auto;
28
- width : 90 vmin ;
29
- height : 90 vmin ;
27
+ width : 400 px ;
28
+ height : 400 px ;
30
29
}
You can’t perform that action at this time.
0 commit comments