first commit the code is uploaded

This commit is contained in:
Martin 2023-07-21 17:46:01 +02:00
commit c8598bfa6a
6 changed files with 1761 additions and 0 deletions

114
public/styles.css Normal file
View file

@ -0,0 +1,114 @@
/* styles.css */
/* General styling for the body and page layout */
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif; /* Set font family for the entire page */
background-color: #f0f0f0; /* Light gray background color */
}
/* Styling for the header section */
.header {
margin-bottom: 20px; /* Add spacing at the bottom of the header */
color: #333; /* Dark text color */
font-size: 24px; /* Larger font size for the header */
font-weight: bold; /* Make the header text bold */
text-align: center; /* Center-align the text within the header */
}
/* Styling for the pixel count display */
#pixel-count {
font-size: 16px;
color: #666;
text-align: center;
margin-top: 10px; /* Add spacing above the pixel count */
}
/* Styling for the main container that wraps canvas and color selector */
.container {
display: flex;
flex-wrap: wrap; /* Allow the container to wrap on smaller screens */
justify-content: center; /* Center the content horizontally */
align-items: center; /* Center the content vertically */
background-color: #fff; /* White background color */
border-radius: 8px; /* Rounded corners for the container */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow effect */
padding: 20px; /* Add padding inside the container */
max-width: 800px; /* Set a maximum width for the container */
}
/* Styling for the canvas where pixels will be placed */
#canvas {
width: 500px;
height: 500px;
display: grid;
grid-template-columns: repeat(50, 10px); /* Create 50 columns of 10px each */
grid-template-rows: repeat(50, 10px); /* Create 50 rows of 10px each */
gap: 0; /* Remove any gap between pixels */
}
/* Styling for individual pixels */
.pixel {
width: 10px;
height: 10px;
display: inline-block;
border: 1px solid #ccc; /* Add a 1px border around each pixel */
}
/* Styling for the color selector section */
.color-selector {
display: flex;
flex-direction: column; /* Color options arranged vertically */
align-items: center; /* Center color options horizontally */
margin-left: 20px; /* Add some space to the left of the color selector */
}
/* Styling for individual color options */
.color-option {
width: 30px;
height: 30px;
border-radius: 50%; /* Make the color options circular */
margin: 5px; /* Add spacing between color options */
cursor: pointer; /* Show pointer cursor on hover */
border: 2px solid #ccc; /* Add a 2px border around each color option */
/* Color options will have their background color set dynamically */
}
/* 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 */
}
.color-selector {
flex-direction: row; /* Arrange color options horizontally */
justify-content: center; /* Center color options horizontally */
margin: 0; /* Remove any margin on smaller screens */
margin-top: 20px; /* Add some spacing above the color selector */
}
.color-option {
margin: 5px 8px; /* Adjust spacing between color options */
}
/* Adjust pixel count styles for phone-friendly UI */
#pixel-count {
font-size: 14px;
}
}