Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the responsiveness of canvas board #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
<meta content="width=device-width, initial-scale=1" name="viewport" />
</head>
<body onload="blackBoard()">
<div class="selectors">
<div class="color-selection board-color">
<div class="color-header">Board Color : </div>
<input type="color" name="boardColor" id="board-color">
<div class="wrapper">
<div class="selectors">
<div class="color-selection board-color">
<div class="color-header">Board Color : </div>
<input type="color" name="boardColor" id="board-color">
</div>
<div class="color-selection pen-color">
<div class="color-header">Pen Color : </div>
<input type="color" name="penColor" id="pen-color">
</div>
</div>
<div class="color-selection pen-color">
<div class="color-header">Pen Color : </div>
<input type="color" name="penColor" id="pen-color">
<div class="canvas-container">
<div class="clear-button">
<button onclick="onClear()">Clear</button>
</div>
<canvas id="black-board"></canvas>
</div>
</div>
<div class="canvas-container">
<canvas id="black-board"></canvas>
<script src="script.js"></script>
<div class="clear-button">
<button onclick="onClear()">Clear</button>
</div>
</div>



<script src="script.js"></script>
<script src="colorChanges.js"></script>
</body>
</html>
63 changes: 36 additions & 27 deletions styles.css
Original file line number Diff line number Diff line change
@@ -1,55 +1,74 @@
@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");

html {
height: 100%;
}

body {
font-family: "Poppins", sans-serif;
background: #121212;
height: 100%;
}

.wrapper {
padding-top: 1rem;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-direction: column;
gap: 6rem;
}

.selectors {
display: flex;
align-items: center;
justify-content: center;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
}

@media screen and (max-width: 320px) {
.selectors {
display: flex;
flex-direction: column;
}
}

.color-selection {
display: flex;
align-items: center;
justify-content: center;
margin: 0px 20px;
gap: 2rem;
}

.color-header {
color: white;
margin: 20px;
}

.canvas-container {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
width: 60%;
gap: 2rem;
}

canvas {
background: #000000;
border: 3px solid rgba(192, 192, 192, 0.5);
width: 40rem;
height: 24rem;
width: 90%;
height: 30rem;
cursor: url(./assets/ico/pen-cursor.ico) 0 50, pointer;
}

.clear-button {
padding: 30px;
@media screen and (max-width: 900px) {
.canvas-container {
width: 80%;
}

canvas {
height: 20rem;
}
}

@media screen and (max-width: 500px) {
.canvas-container {
width: 90%;
}
}

.clear-button button {
Expand All @@ -63,7 +82,6 @@ canvas {
font-size: 16px;
background-color: purple;
border-radius: 15px;
width: 100%;
}

.clear-button button:hover {
Expand All @@ -74,12 +92,3 @@ canvas {
canvas:active {
border-color: rgb(192, 192, 192);
}

@media screen and (max-width: 768px) {
canvas {
background: #000000;
width: 95vw;
height: 85vh;
cursor: grabbing;
}
}