File tree Expand file tree Collapse file tree 3 files changed +38
-18
lines changed Expand file tree Collapse file tree 3 files changed +38
-18
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ const ctx = canvas.getContext('2d');
118
118
119
119
const resize = _ => {
120
120
const { offsetWidth, offsetHeight } = htmlEl ;
121
- width = Math . min ( offsetWidth , 800 ) ;
121
+ width = Math . min ( offsetWidth , 600 ) ;
122
122
height = 800 ;
123
123
124
124
canvas . width = width ;
Original file line number Diff line number Diff line change 49
49
display : block ;
50
50
height :100% ;
51
51
}
52
- canvas {
53
- position : absolute ;
54
- // box-shadow:0 0 0 2px blue;
55
- // top:0;
56
- left :0 ;
57
- right :0 ;
58
- bottom :0 ;
59
- margin :0 auto ;
60
- // width: 100vw;
61
- pointer-events : none ;
62
- }
63
52
.single-box {
64
53
margin :140px auto 0 ;
65
- width : 200px ;
54
+ // width: 200px;
66
55
height : 500px ;
67
- // box-shadow:0 0 0 2px blue;
68
56
position : relative ;
69
57
70
58
position : absolute ;
@@ -73,6 +61,16 @@ canvas{
73
61
right :0 ;
74
62
pointer-events : none ;
75
63
64
+ canvas {
65
+ position : absolute ;
66
+ // top:0;
67
+ left :0 ;
68
+ right :0 ;
69
+ bottom :0 ;
70
+ margin :0 auto ;
71
+ // width: 100vw;
72
+ pointer-events : none ;
73
+ }
76
74
.main {
77
75
// width: 140px;
78
76
// height: 200px;
@@ -84,7 +82,9 @@ canvas{
84
82
height : var (--main-height );
85
83
86
84
position : absolute ;
87
- left : calc ( 200px / 2 - var (--main-width ) / 2 );
85
+ left : 0 ;
86
+ right :0 ;
87
+ margin :0 auto ;
88
88
// top: calc( 240px - var(--main-height) );
89
89
bottom : 260px ;
90
90
// box-shadow:0 0 0 2px red;
@@ -105,7 +105,9 @@ canvas{
105
105
width : 160px ;
106
106
height : 20px ;
107
107
position : absolute ;
108
- left : 20px ;
108
+ left : 0 ;
109
+ right : 0 ;
110
+ margin : 0 auto ;
109
111
bottom : 0 ;
110
112
// box-shadow:0 0 0 2px green;
111
113
background : rgba (255 ,255 ,255 ,.5 ) no-repeat 50% 50% ;
@@ -198,12 +200,30 @@ html[data-permission-state="true"]{
198
200
}
199
201
200
202
201
- @media (max-height :800px ) {
203
+ @media (max-height :800px ) and ( min-height : 600 px ) {
202
204
.app {
203
205
position : absolute ;
204
206
top : 0 ;
205
207
left : 0 ;
206
208
right : 0 ;
207
209
min-height : 600px ;
208
210
}
211
+ }
212
+ @media (max-height :600px ) {
213
+ .single-box {
214
+ transform : scale (.7 );
215
+ transform-origin : 50% 100% ;
216
+ }
217
+ }
218
+ @media (max-height :450px ) {
219
+ .single-box {
220
+ transform : scale (.6 );
221
+ transform-origin : 50% 100% ;
222
+ }
223
+ }
224
+ @media (max-height :350px ) {
225
+ .single-box {
226
+ transform : scale (.5 );
227
+ transform-origin : 50% 100% ;
228
+ }
209
229
}
Original file line number Diff line number Diff line change 11
11
</ head >
12
12
< body >
13
13
< div class ="app ">
14
- < canvas > </ canvas >
15
14
< div class ="single-box ">
15
+ < canvas > </ canvas >
16
16
< div class ="main "> </ div >
17
17
< div class ="bed "> </ div >
18
18
</ div >
You can’t perform that action at this time.
0 commit comments