-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
239 additions
and
95 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
html, | ||
body { | ||
height: 100vh; | ||
width: 100vw; | ||
overflow: hidden; | ||
} | ||
|
||
#background { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
display: grid; | ||
} | ||
|
||
#background > div { | ||
display: flex; | ||
height: 48px; | ||
} | ||
|
||
#background > div > div { | ||
height: 48px; | ||
width: 48px; | ||
background: rgb(246, 116, 35); | ||
transition: opacity 0.2s steps(3, jump-none); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
const background = document.querySelector("#background"); | ||
let cases = {}; | ||
let heightCount = 0; | ||
let widthCount = 0; | ||
|
||
// Click on case | ||
const effect = (originX, originY, depth = 0) => { | ||
if (depth < 3) { | ||
setTimeout(() => effect(originX, originY, depth + 1), 100); | ||
} | ||
|
||
for (let y = -depth; y <= depth; y++) { | ||
const gridY = originY + y; | ||
if (gridY < 0 || gridY >= heightCount) continue; | ||
|
||
for (let x = -depth; x <= depth; x++) { | ||
if (y !== -depth && y !== depth && x !== -depth && x !== depth) continue; | ||
|
||
const gridX = originX + x; | ||
if (gridX < 0 || gridX >= widthCount) continue; | ||
|
||
const selectedCase = cases[gridX + "-" + gridY]; | ||
const opacityDiff = (0.5 / depth) * (0.9 + Math.random() * 0.2); | ||
selectedCase.style.opacity += opacityDiff; | ||
|
||
setTimeout( | ||
(opacityDiff) => { | ||
selectedCase.style.opacity -= opacityDiff; | ||
|
||
if (selectedCase.style.opacity < 0.001) { | ||
selectedCase.style.opacity = 0; | ||
} | ||
}, | ||
200, | ||
opacityDiff | ||
); | ||
} | ||
} | ||
}; | ||
|
||
// Generate background | ||
const generate = () => { | ||
heightCount = Math.ceil(background.clientHeight / 48); | ||
widthCount = Math.ceil(background.clientWidth / 48); | ||
|
||
// Clear | ||
background.innerHTML = ""; | ||
cases = {}; | ||
|
||
for (let y = 0; y < heightCount; y++) { | ||
const line = document.createElement("div"); | ||
for (let x = 0; x < widthCount; x++) { | ||
const element = document.createElement("div"); | ||
const r = Math.random() * 255; | ||
const g = Math.random() * 255; | ||
const b = Math.random() * 255; | ||
element.style.opacity = 0; | ||
line.appendChild(element); | ||
|
||
cases[x + "-" + y] = element; | ||
} | ||
background.appendChild(line); | ||
} | ||
}; | ||
|
||
window.addEventListener("mousemove", (e) => { | ||
const x = Math.floor(e.clientX / 48); | ||
const y = Math.floor(e.clientY / 48); | ||
effect(x, y); | ||
}); | ||
|
||
window.addEventListener("resize", generate); | ||
generate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,52 @@ | ||
<!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"> | ||
<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" /> | ||
<link rel="stylesheet" href="background.css" /> | ||
|
||
<script src="script.js"></script> | ||
<script src="background.js" defer></script> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
</head> | ||
<body> | ||
<div id="background"></div> | ||
<section> | ||
<div class="title"> | ||
<p>PIXEL</p> | ||
<p><span>//</span>WAR</p> | ||
</div> | ||
<div class="title"> | ||
<p>PIXEL</p> | ||
<p><span>//</span>WAR</p> | ||
</div> | ||
|
||
<div id="countdown"></div> | ||
<div id="countdown"></div> | ||
|
||
<button class="btn-notification"> | ||
<img src="assets/phone.svg" alt="phone-icone"> Me notifier | ||
<a href="https://www.instagram.com/la404.devinci/"> | ||
<button class="btn-notification"> | ||
<img src="assets/phone.svg" alt="phone-icone" /> Me notifier | ||
</button> | ||
</a> | ||
</section> | ||
|
||
<p class="wait">En attendant, commencez votre <a href="https://hack.404devinci.fr/">Hacker's Journey</a>!</p> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> | ||
<img | ||
src="assets/cactus2W 1.png" | ||
alt="img-cactus-pixelisé" | ||
class="cactus-gauche" | ||
/> | ||
<p class="wait"> | ||
En attendant, commencez votre<a href="https://hack.404devinci.fr/"> | ||
Hacker's Journey</a | ||
>! | ||
</p> | ||
<img | ||
src="assets/Group 2.png" | ||
alt="img-cactus-pixelisé" | ||
class="cactus-droit" | ||
/> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.