File tree Expand file tree Collapse file tree 6 files changed +46
-35
lines changed Expand file tree Collapse file tree 6 files changed +46
-35
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,5 @@ body.light {
170
170
--bg-player : hsl (240 , 10% , 30% );
171
171
--bg-wall : hsla (0 , 0% , 55% , 1 );
172
172
173
-
174
173
--bg-nav : hsl (240 , 10% , 30% , 1 );
175
174
}
Original file line number Diff line number Diff line change 40
40
<style >
41
41
.wrapper {
42
42
height : 100% ;
43
- min-width : 160px ;
43
+ grid-area : select;
44
+ /* max-width: 160px; */
45
+ width : 100% ;
44
46
display : flex ;
45
47
justify-content : center ;
46
48
align-items : center ;
47
49
font-size : 24px ;
48
50
color : white ;
49
51
position : relative ;
50
52
font-weight : bold ;
51
- border : 2px solid var (--bg-body );
52
- border-top : none ;
53
- border-left : none ;
54
53
}
55
54
56
55
ul {
Original file line number Diff line number Diff line change 20
20
import { player , cancelFunction } from ' $lib/stores/player' ;
21
21
import { history , trackAtTheEnd } from ' $lib/stores/history' ;
22
22
import { algorithms } from ' $lib/algorithms' ;
23
+ import AlgoSelect from ' ./AlgoSelect.svelte' ;
23
24
24
25
const playAlgorithm = async () => {
25
26
const drawShortestPath = async (node : Node | undefined ): Promise <void > => {
241
242
style ="--height: {$layout .player .height }px;--width: {$layout .player .width }px;"
242
243
id =" player"
243
244
>
245
+ <AlgoSelect />
244
246
<Tools />
245
247
<Controls {playAlgorithm } />
246
248
</div >
247
249
248
250
<style >
249
251
.wrapper {
250
252
transition : background-color ease-in-out 0.5s ;
251
-
252
253
position : absolute ;
253
254
left : 0 ;
254
255
bottom : 0 ;
255
256
height : var (--height );
256
257
min-height : var (--height );
257
- width : var ( --width ) ;
258
+ width : 100 % ;
258
259
background-color : var (--bg-player );
259
- display : flex ;
260
- flex-direction : column ;
261
- justify-content : center ;
260
+
261
+ display : grid ;
262
+ grid-template-columns : 1fr 1fr ;
263
+ grid-template-rows : 1fr 1fr ;
264
+ grid-template-areas : ' select tools' ' controls controls' ;
262
265
gap : 10px ;
266
+ padding-bottom : 10px ;
263
267
}
264
268
265
- /* @media (min-width: 1024px) {
269
+ @media (min-width : 1024px ) {
266
270
.wrapper {
267
271
left : 0 ;
268
- width: 576px;
272
+ grid-template-columns : 1fr 1fr 1fr ;
273
+ grid-template-rows : 1fr ;
274
+ grid-template-areas : ' select controls tools' ;
269
275
height : var (--height );
270
276
}
271
- } */
277
+ }
272
278
</style >
Original file line number Diff line number Diff line change 57
57
58
58
<style >
59
59
.wrapper {
60
- flex : 1 ;
61
- width : 100 % ;
60
+ /* width: 100%; */
61
+ grid-area : controls ;
62
62
display : flex ;
63
63
justify-content : center ;
64
64
align-items : center ;
74
74
align-items : center ;
75
75
border : none ;
76
76
color : inherit ;
77
- font-size : 32px ;
78
77
}
79
78
80
79
button .disabled :hover {
88
87
89
88
.play {
90
89
color : white ;
91
- font-size : 68 px ;
90
+ font-size : 64 px ;
92
91
}
93
92
94
93
.play :hover {
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import AlgoSelect from ' $lib/Components/AlgoSelect.svelte' ;
3
2
import Wall from ' $lib/Components/Tools/Wall.svelte' ;
4
3
import Weight from ' $lib/Components/Tools/Weight.svelte' ;
5
4
import Reset from ' $lib/Components/Tools/Reset.svelte' ;
6
5
</script >
7
6
8
7
<div class =" wrapper" >
9
- <AlgoSelect />
10
- <div class =" tools" >
11
- <Weight name =" weight" />
12
- <Wall name =" wall" />
13
- <Reset name =" reset" />
14
- </div >
8
+ <Weight name =" weight" />
9
+ <Wall name =" wall" />
10
+ <Reset name =" reset" />
15
11
</div >
16
12
17
13
<style >
18
14
.wrapper {
19
- flex : 0.8 ;
15
+ /* flex: 0.8; */
20
16
display : flex ;
21
- justify-content : space-between ;
17
+ justify-content : center ;
18
+ align-items : center ;
19
+ gap : 10px ;
22
20
}
23
21
24
- .tools {
25
- flex : 1 ;
22
+ .wrapper {
23
+ grid-area : tools ;
26
24
height : 100% ;
27
- width : 100% ;
25
+ /* width: 100%; */
28
26
display : flex ;
29
27
align-items : center ;
30
28
justify-content : space-evenly ;
Original file line number Diff line number Diff line change @@ -35,16 +35,26 @@ const createLayoutStore = () => {
35
35
} ;
36
36
37
37
const getPlayerLayout = ( screenHeight : number , screenCols : number , screenRows : number ) => {
38
- let playerRows ;
38
+ let playerRows = 4 ;
39
39
let playerCols ;
40
40
41
41
const emptyVerticalSpace = ( screenHeight % 32 ) - 1 ;
42
42
43
- if ( screenRows <= 22 ) {
44
- playerRows = 4 ;
45
- } else {
46
- playerRows = 6 ;
47
- }
43
+ console . log ( 'screenRows' , screenRows ) ;
44
+
45
+ // if (screenRows <= 22) {
46
+ // playerRows = 4;
47
+ // } else if (screenRows <= 35) {
48
+ // playerRows = 2;
49
+ // } else {
50
+ // playerRows = 4
51
+ // }
52
+
53
+ // if (screenRows <= 22) {
54
+ // playerRows = 4;
55
+ // } else {
56
+ // playerRows = 4;
57
+ // }
48
58
49
59
if ( screenCols <= 30 ) {
50
60
playerCols = screenCols ;
You can’t perform that action at this time.
0 commit comments