Skip to content

Commit

Permalink
🚀 DEPLOYING
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolap authored Mar 2, 2024
0 parents commit bb505a0
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 0 deletions.
50 changes: 50 additions & 0 deletions assets/Background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/phone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pixelify+Sans:[email protected]&family=Press+Start+2P&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<section>
<div class="title">
<p>PIXEL</p>
<p><span>//</span>WAR</p>
</div>

<div id="countdown"></div>

<button class="btn-notification">
<img src="assets/phone.svg" alt="phone-icone"> Me notifier
</button>
</section>

<p class="wait">En attendant, commencez votre <a href="">Hacker's Journey</a>!</p>

<script src="script.js"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// modifier heure si nécessaire
const endDate = new Date("2024-03-15T20:00:00").getTime();

const countdown = setInterval(() => {
const now = new Date().getTime();
const distance = endDate - now;

const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById("countdown").innerHTML = `<p>${days}<span>J</span></p>`;
document.getElementById("countdown").innerHTML += `<p>${hours}<span>H</span></p>`;
document.getElementById("countdown").innerHTML += `<p>${minutes}<span>M</span></p>`;
document.getElementById("countdown").innerHTML += `<p>${seconds}<span>S</span></p>`;

if (distance < 0) {
clearInterval(countdown);
document.getElementById("countdown").innerHTML ="Le countdown est terminé !";
}
}, 1000);
102 changes: 102 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Press Start 2P", system-ui;

}

body {
background-color: #f4f4f4;
background-color: #131518;
color: white;
height: 100vh;
}

section {
width: 90%;
max-width: 800px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-weight: 700;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

.title {
width: 90%;
max-width: 770px;
font-size: 7em;
margin-bottom: 100px;
}

#countdown {
display: flex;
font-size: 2em;
margin-bottom: 100px;
}

#countdown p {
margin: 0 0.5em;
}

#countdown p span {
margin: 0 0.5em;
opacity: 0.5;
}

.title p:nth-child(1) {
text-align: left;
}

.title p:nth-child(2) {
text-align: right;
}

.btn-notification {
background-image: url(assets/Background.svg);
background-repeat: no-repeat;
background-size: cover;
color: white;
border: none;
padding: 1.5em;
cursor: pointer;
}

.wait {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
margin-bottom: 1.5em;
font-size: 0.8em;
text-align: center;
}

.wait a {
color: #5C5CFF;
text-decoration: none;
}

@media screen and (max-width: 768px) {
section {
max-width: 90%;
}

.title {
font-size: 3.5em;
text-align: center;
}

#countdown {
font-size: 1em;
}

.wait {
width: 90%;
}
}

0 comments on commit bb505a0

Please sign in to comment.