Update color picker, css changes

This commit is contained in:
Aldess 2023-11-25 18:48:24 +01:00 committed by GitHub
commit d4b4a45be6
2 changed files with 61 additions and 57 deletions

View file

@ -25,22 +25,32 @@
<!-- Canvas will be generated dynamically -->
</div>
</div>
<div class="color-selector">
<div class="color-option" style="background-color: #5454ff;"></div>
<div class="color-option" style="background-color: #0000ff;"></div>
<div class="color-option alt" style="background-color: #5454ff;"></div>
<div class="color-option" style="background-color: #00bbff;"></div>
<div class="color-option alt" style="background-color: #00ffff;"></div>
<div class="color-option alt" style="background-color: #0d5421;"></div>
<div class="color-option" style="background-color: #2e7d44;"></div>
<div class="color-option" style="background-color: #5ee834;"></div>
<div class="color-option" style="background-color: #ffe600;"></div>
<div class="color-option" style="background-color: #f9cb9c;"></div>
<div class="color-option" style="background-color: #eeff00;"></div>
<div class="color-option alt" style="background-color: #ffe600;"></div>
<div class="color-option" style="background-color: #ff9900;"></div>
<div class="color-option" style="background-color: #FF0000;"></div>
<div class="color-option alt" style="background-color: #ff89a4;"></div>
<div class="color-option" style="background-color: #ff89ff;"></div>
<div class="color-option" style="background-color: #a04cf9;"></div>
<div class="color-option" style="background-color: #808080;"></div>
<div class="color-option" style="background-color: #a48067;"></div>
<div class="color-option alt" style="background-color: #512f17;"></div>
<div class="color-option alt" style="background-color: #545454;"></div>
<div class="color-option" style="background-color: #bdbdbd;"></div>
<div class="color-option" style="background-color: #FFFFFF;"></div>
<div class="color-option" style="background-color: #000000;"></div>
</div>
</div>
<p>Made by Dolez M.</p>
<script src="/socket.io/socket.io.js"></script>
<script src="script.js"></script>
</body>

View file

@ -98,10 +98,9 @@ body {
align-items: center; /* Center the content vertically */
background-color: #fffffff3; /* White background color */
border-radius: 15px; /* Rounded corners for the container */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow effect */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding: 20px; /* Add padding inside the container */
width: 95%; /* Set a maximum width for the container */
height: 1050px;
margin-bottom: 10px;
}
@ -109,11 +108,11 @@ body {
#canvas {
padding: 10px;
overflow-x: scroll;
width: calc(100% - 100px);
height: 1030px;
width: 95vw;
height: 95vw;
display: grid;
grid-template-columns: repeat(100, 10px); /* Create 50 columns of 10px each */
grid-template-rows: repeat(100, 10px); /* Create 50 rows of 10px each */
grid-template-columns: repeat(200, 10px); /* Create 50 columns of 10px each */
grid-template-rows: repeat(200, 10px); /* Create 50 rows of 10px each */
gap: 0; /* Remove any gap between pixels */
}
@ -127,16 +126,23 @@ body {
/* Styling for the color selector section */
.color-selector {
position: fixed;
background-color: #fffffff3;
border-radius: 30px;
padding: 10px;
bottom: 0;
display: flex;
flex-direction: column; /* Color options arranged vertically */
flex-wrap: wrap;
align-items: center; /* Center color options horizontally */
margin-left: 20px; /* Add some space to the left of the color selector */
margin: 20px; /* Add some space to the left of the color selector */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Styling for individual color options */
.color-option {
width: 30px;
height: 30px;
width: 28px;
height: 28px;
border-radius: 50%; /* Make the color options circular */
margin: 5px; /* Add spacing between color options */
cursor: pointer; /* Show pointer cursor on hover */
@ -146,30 +152,18 @@ body {
/* Styling for the currently selected color option */
.color-option.selected {
border-color: #000; /* Change the border color for the selected color */
}
/* Responsive design for phone-friendly UI */
@media (max-width: 768px) {
.container {
flex-direction: column; /* Stack canvas and color selector vertically */
}
#canvas {
width: 90%; /* Adjust canvas width to fit smaller screens */
height: auto; /* Allow canvas height to adapt based on content */
margin: 20px 0; /* Add some spacing around the canvas */
border-color: #000;
}
.color-option {
margin: 5px 8px; /* Adjust spacing between color options */
p {
margin-bottom: 100px;
}
/* Adjust pixel count styles for phone-friendly UI */
#pixel-count {
font-size: 14px;
}
@media screen and (max-width: 520px) {
.alt {
display: none;
}
}