Skip to content

Commit

Permalink
added styles with aspect ratio;
Browse files Browse the repository at this point in the history
  • Loading branch information
katrysja committed Sep 14, 2023
1 parent 4dd0449 commit a8fbfec
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
60 changes: 29 additions & 31 deletions src/engine/Graphics2d.module.css
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
.wrapperStyles {
width: 100%;
justify-content: center;
overflow: scroll;
padding: 0;
height: calc(100% - 0.5rem);
margin: 0;

}

.canvasStyles {
display: block;
width: 150vw;
height: 100%;
margin: 0;
padding: 0;
@media screen and (max-width: 768px) {

.wrapperStyles {
width: 100%;
height: 100vh;
justify-content: center;
overflow: scroll;
}

.canvasStyles {
display: block;
width: 150vw;
}
}

@media screen and (min-width: 768px) {
@media screen and (min-width: 768px ) and (max-width: 1024px) {

.wrapperStyles {
height: calc(100% - 2.5rem);
width: calc(100% - 3rem);
border: 2px solid #dc5e47;
border-radius: 10px;
}
.canvasStyles {
width: 150vw;
height: calc(100% - 3rem);
}
}
@media screen and(min-width: 768px) {
.wrapperStyles {
height: calc(100% - 3rem);
width: calc(100%- 3rem);
aspect-ratio: 1 / 1;
}
}

@media screen and (orientation: landscape) and (min-width: 768px) {

.wrapperStyles {
height: calc(100% - 2.5rem);
width: calc(100%- 3rem);
border: none;
}

.canvasStyles {
width: 80vw;
height: calc(100% - 0.5rem);
aspect-ratio: 1 / 1;
border: 2px solid #dc5e47;
border-radius: 10px;
}

}

@media screen and (orientation: landscape) and (min-width: 1024px) {

@media screen and (min-width: 1024px) and (orientation: landscape) {

.wrapperStyles {
width: 80%;
height: calc(100% - 0.5rem);
display: flex;
aspect-ratio: 1/1;
}

.canvasStyles {
width: 150vw;
height: calc(100% - 0.5rem);
margin: 0 auto;
}
}

4 changes: 2 additions & 2 deletions src/ui/Main.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
position: absolute;
left: 25px;
top: 100px;
z-index: 900;
z-index: 1010;
}

.bottleft {
Expand All @@ -125,7 +125,7 @@
position: absolute;
left: 25px;
bottom: 25px;
z-index: 1000;
z-index: 1010;
}


Expand Down

0 comments on commit a8fbfec

Please sign in to comment.