Skip to content

Commit

Permalink
Adjust flex settings for main section
Browse files Browse the repository at this point in the history
Got rid of #container and allowed main to position the grid directly.
Previously it had adjusted the size of #container but didn't effect the
size of #sketch, so #sketch would overlap its borders and the control
bar. Now #sketch adjusts with window size.
  • Loading branch information
strbytes committed Apr 10, 2022
1 parent 1ef2fcb commit c25cc7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1>ECMA-sketch</h1>
<div></div>
</header>
<main>
<div class="main-flex"></div>
<div class="main-flex-left"></div>
<!-- Control section -->
<div id="control-div">
<div class="control-flex"></div>
Expand Down Expand Up @@ -62,11 +62,10 @@ <h1>ECMA-sketch</h1>
<div class="control-flex"></div>
</div>
<!-- Grid section -->
<div id="container">
<div id="sketch">
<!-- Anchor for the grid produced by createGrid -->
<div id="sketch"></div>
</div>
<div class="main-flex"></div>
<div class="main-flex-right"></div>
</main>
<footer>
<div></div>
Expand Down
20 changes: 8 additions & 12 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,29 @@ main {
flex: 1;
display: flex;
justify-content: space-around;
align-items: center;
gap: 5vw;
margin: 0 1vw;
border-radius: 1%;
}

/* Container for the controls */
#control-div {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}

/* Container for the sketch grid */
#container {
flex: 5;
display: flex;
justify-content: center;
align-items: center;
padding: 2vh 2vw;
}

/* Empty divs on sides of main section to aid spacing */
.main-flex {
.main-flex-left {
flex: 1;
}

.main-flex-right {
flex: 5;
}

/* Two divs for draw settings */
#controls,
#color-div {
Expand Down Expand Up @@ -135,7 +131,7 @@ main {
#sketch {
aspect-ratio: 1;
background-color: #fbb;
height: 100%;
height: 85vh;
display: flex;
flex-direction: column;
justify-content: space-between;
Expand Down

0 comments on commit c25cc7e

Please sign in to comment.