-
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
20 changed files
with
1,838 additions
and
149 deletions.
There are no files selected for viewing
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,4 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@100;200;300;400;500;600;700;800;900&family=Dancing+Script:wght@400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900&display=swap') | ||
|
||
* | ||
font-family: Orbitron, sans-serif |
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,16 @@ | ||
// Scrollbar | ||
::-webkit-scrollbar | ||
width: 12px | ||
|
||
::-webkit-scrollbar-track | ||
background: transparent | ||
|
||
::-webkit-scrollbar-thumb | ||
background: black | ||
border: 4px solid white | ||
border-radius: 2rem | ||
|
||
::-webkit-scrollbar-thumb:hover | ||
background: royalblue | ||
border: 2px solid white |
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
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
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.
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,85 @@ | ||
var objImage = null; | ||
function init() { | ||
objImage = document.getElementById("contour"); | ||
objImage.style.position = "relative"; | ||
objImage.style.left = "0px"; | ||
objImage.style.top = "0px"; | ||
} | ||
function getKeyAndMove(e) { | ||
var key_code = e.which || e.keyCode; | ||
switch (key_code) { | ||
case 37: //gauche | ||
moveLeft(); | ||
break; | ||
case 38: //haut | ||
moveUp(); | ||
break; | ||
case 39: //droite | ||
moveRight(); | ||
break; | ||
case 40: //bas | ||
moveDown(); | ||
break; | ||
} | ||
} | ||
function moveLeft() { | ||
objImage.style.left = parseInt(objImage.style.left) - 20 + "px"; | ||
objImage.style.rotate = "-90deg"; | ||
} | ||
function moveUp() { | ||
objImage.style.top = parseInt(objImage.style.top) - 20 + "px"; | ||
objImage.style.rotate = "0deg"; | ||
} | ||
function moveRight() { | ||
objImage.style.left = parseInt(objImage.style.left) + 20 + "px"; | ||
objImage.style.rotate = "90deg"; | ||
} | ||
function moveDown() { | ||
objImage.style.top = parseInt(objImage.style.top) + 20 + "px"; | ||
objImage.style.rotate = "180deg"; | ||
} | ||
window.onload = init; | ||
|
||
// Collision | ||
const ship = document.querySelector("#vaisseau"); | ||
const planet = document.querySelector("#hitbox"); | ||
const code = document.querySelector("#code"); | ||
|
||
function checkCollision() { | ||
let shipRect = ship.getBoundingClientRect(); | ||
let planetRect = planet.getBoundingClientRect(); | ||
|
||
if (shipRect.x < planetRect.x + planetRect.width && | ||
shipRect.x + shipRect.width > planetRect.x && | ||
shipRect.y < planetRect.y + planetRect.height && | ||
shipRect.height + shipRect.y > planetRect.y) { | ||
code.classList.add('codepop'); | ||
document.querySelector('#retour').classList.add('retourpop'); | ||
} | ||
} | ||
setInterval(checkCollision, 50); | ||
|
||
// Click Sound | ||
var click = document.querySelector('#clicksound'); | ||
click.volume = 0.6; | ||
|
||
boutons = document.querySelectorAll('.click'); | ||
|
||
boutons.forEach(function(truc) { | ||
truc.addEventListener('click', function() { | ||
click.load(); | ||
click.play(); | ||
}); | ||
}); | ||
|
||
// Boutons OK | ||
function bouton1() { | ||
document.querySelector('#vif').classList.add('plurien'); | ||
document.querySelector('#ok1').classList.add('okdisparait'); | ||
} | ||
|
||
function bouton2() { | ||
document.querySelector('#blabla').classList.add('plurien'); | ||
document.querySelector('#vif').classList.add('vifpop'); | ||
document.querySelector('#ok2').classList.add('okdisparait'); | ||
} |
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.