File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ button:hover {
138
138
color : white;
139
139
background-color : rgba (211 , 211 , 211 , 0.05 );
140
140
border : 1px solid transparent;
141
- border-radius : 10 px ;
141
+ border-radius : 8 px ;
142
142
}
143
143
144
144
.menu-items {
@@ -148,8 +148,8 @@ button:hover {
148
148
right : 0 ;
149
149
150
150
background-color : # 203139 ;
151
- border-radius : 2 px ;
152
- padding : 10 px ;
151
+ border-radius : 8 px ;
152
+ padding : 8 px ;
153
153
}
154
154
155
155
@media (min-width : 640px ) {
@@ -191,7 +191,7 @@ button:hover {
191
191
align-items : center;
192
192
gap : 2px ;
193
193
194
- border-radius : 10 px ;
194
+ border-radius : 8 px ;
195
195
}
196
196
197
197
.score p {
@@ -207,7 +207,7 @@ button:hover {
207
207
footer {
208
208
color : white;
209
209
font-size : 0.8rem ;
210
- margin-top : 10 vw ;
210
+ margin-top : 16 vw ;
211
211
}
212
212
213
213
@media (min-width : 640px ) {
Original file line number Diff line number Diff line change @@ -156,8 +156,6 @@ function init() {
156
156
const view = new View ( ) ;
157
157
const store = new Store ( players ) ;
158
158
159
- console . log ( store . game ) ;
160
-
161
159
view . bindGameResetEvent ( ( event ) => {
162
160
view . closeModal ( ) ;
163
161
view . clearMoves ( ) ;
@@ -173,6 +171,8 @@ function init() {
173
171
} ) ;
174
172
175
173
view . bindPlayerMoveEvent ( ( square ) => {
174
+ view . closeMenu ( ) ;
175
+
176
176
const existingMove = store . game . moves . find (
177
177
( move ) => move . squareID === + square . id
178
178
) ;
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ export default class View {
52
52
icon . classList . toggle ( "fa-chevron-up" ) ;
53
53
}
54
54
55
+ closeMenu ( ) {
56
+ if ( ! this . $ . menuItems . classList . contains ( "hidden" ) ) {
57
+ this . #toggleMenu( ) ;
58
+ }
59
+ }
60
+
55
61
handlePlayerMove ( squareEl , player ) {
56
62
const icon = document . createElement ( "i" ) ;
57
63
icon . classList . add ( "fa-solid" , player . iconClass , player . colorClass ) ;
You can’t perform that action at this time.
0 commit comments