File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
2
2
: root {
3
+ --heightScreen : 583px ;
4
+ --widthScreen : 800px ;
3
5
--backgroundColor : white;
4
6
--buttonSize : 50px ;
5
7
}
@@ -17,8 +19,10 @@ canvas {
17
19
margin-left : auto;
18
20
margin-right : auto;
19
21
margin-top : 80px ;
20
- width : 100% ;
21
- height : 100% ;
22
+ // width: 100%;
23
+ // height: 100%;
24
+ width : var (--widthScreen );
25
+ height : var (--heightScreen );
22
26
// background-image: url(http://github.com/"cassette-depth.svg");
23
27
}
24
28
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ function setup() {
48
48
49
49
// define canvas dimensions for mobile screens
50
50
if ( window . innerWidth < widthScreen ) {
51
- heightScreen = window . innerWidth * ( heightScreen / widthScreen ) ;
52
- widthScreen = window . innerWidth ;
51
+ root . style . setProperty ( '-- heightScreen' , window . innerWidth * ( heightScreen / widthScreen ) + "px" ) ;
52
+ root . style . setProperty ( '-- widthScreen' , window . innerWidth + "px" ) ;
53
53
}
54
54
55
55
canvas = createCanvas ( widthScreen , heightScreen ) ;
You can’t perform that action at this time.
0 commit comments