Add files via upload

This commit is contained in:
Aldess 2023-11-24 07:43:27 +01:00 committed by GitHub
commit 40586e3d6a
2 changed files with 221 additions and 149 deletions

View file

@ -7,10 +7,18 @@
<title>Collaborative Pixel Art</title> <title>Collaborative Pixel Art</title>
<link rel="stylesheet" href="styles.css"> <link rel="stylesheet" href="styles.css">
</head> </head>
<body> <body onload="
document.getElementById('intro').classList.add('fadeout')
setTimeout(() => {
document.getElementById('intro').style.display = 'none'
}, 800);
">
<div id="intro" class="intro">
<h2>Collaborative Pixel Art</h2>
</div>
<div class="header"> <div class="header">
<h1>Collaborative Pixel Art</h1> <h1>Collaborative Pixel Art</h1>
<div id="pixel-count"></div> <!-- Element to display pixel count --> <div id="pixel-count">En cours de chargement...</div> <!-- Element to display pixel count -->
</div> </div>
<div class="container"> <div class="container">
<div id="canvas"> <div id="canvas">
@ -18,14 +26,18 @@
</div> </div>
<div class="color-selector"> <div class="color-selector">
<div class="color-option" style="background-color: #000000;"></div> <div class="color-option" style="background-color: #5454ff;"></div>
<div class="color-option" style="background-color: #00bbff;"></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: #ff9900;"></div>
<div class="color-option" style="background-color: #FF0000;"></div> <div class="color-option" style="background-color: #FF0000;"></div>
<div class="color-option" style="background-color: #00FF00;"></div> <div class="color-option" style="background-color: #ff89ff;"></div>
<div class="color-option" style="background-color: #0000FF;"></div> <div class="color-option" style="background-color: #a04cf9;"></div>
<div class="color-option" style="background-color: #FFFF00;"></div> <div class="color-option" style="background-color: #808080;"></div>
<div class="color-option" style="background-color: #FF00FF;"></div>
<div class="color-option" style="background-color: #00FFFF;"></div>
<div class="color-option" style="background-color: #FFFFFF;"></div> <div class="color-option" style="background-color: #FFFFFF;"></div>
<div class="color-option" style="background-color: #000000;"></div>
</div> </div>
</div> </div>

View file

@ -1,114 +1,174 @@
/* styles.css */ /* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
/* General styling for the body and page layout */ /* General styling for the body and page layout */
body { body {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100vh; height: 100vh;
margin: 0; margin: 0;
font-family: Arial, sans-serif; /* Set font family for the entire page */ font-family: 'Poppins', sans-serif; /* Set font family for the entire page */
background-color: #f0f0f0; /* Light gray background color */ background-color: var(--bg); /* Light gray background color */
}
.intro {
position: absolute;
z-index: 2;
background-color: #000;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
} }
.fadeout {
animation-name: fadeout;
animation-duration: 1s;
/* 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 */
} }
@keyframes fadeout {
/* Styling for the pixel count display */ from {
#pixel-count { opacity: 1;
font-size: 16px; }
color: #666; to {
text-align: center; opacity: 0;
margin-top: 10px; /* Add spacing above the pixel count */ }
} }
@keyframes fadeIn {
/* Styling for the main container that wraps canvas and color selector */ from {
.container { opacity: 0;
display: flex; transform: translateX(-50%);
flex-wrap: wrap; /* Allow the container to wrap on smaller screens */ }
justify-content: center; /* Center the content horizontally */ to {
align-items: center; /* Center the content vertically */ opacity: 1;
background-color: #fff; /* White background color */ transform: translateX(0);
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 */ .intro h2{
max-width: 800px; /* Set a maximum width for the container */ font-size: 35px;
} font-weight: 600;
text-align: center;
/* Styling for the canvas where pixels will be placed */ color: #fff;
#canvas { animation-name: fadeIn;
width: 500px; animation-duration: .8s;
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 { /* Styling for the header section */
width: 90%; /* Adjust canvas width to fit smaller screens */ .header {
height: auto; /* Allow canvas height to adapt based on content */ margin-bottom: 20px;
margin: 20px 0; /* Add some spacing around the canvas */
} }
:root {
.color-selector { --bg: #f0f0f0;
flex-direction: row; /* Arrange color options horizontally */ --text-color: #333;
justify-content: center; /* Center color options horizontally */ --text-color2: #666;
margin: 0; /* Remove any margin on smaller screens */
margin-top: 20px; /* Add some spacing above the color selector */
} }
/* thème sombre */
.color-option { @media (prefers-color-scheme: dark){
margin: 5px 8px; /* Adjust spacing between color options */ :root {
--bg: #171717;
--text-color: #fff;
--text-color2: #eee;
}
.navbar .time, i, .brandname, .matiere {
filter: drop-shadow(1px 1px 2px rgb(0 0 0 / 0.4));
}
} }
h1 {
/* Adjust pixel count styles for phone-friendly UI */ color: var(--text-color);
font-size: 30px;
font-weight: 600;
text-align: center;
}
/* Styling for the pixel count display */
#pixel-count { #pixel-count {
font-size: 14px; font-size: 16px;
color: var(--text-color2);
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: #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 */
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;
}
}