Merge branch 'main' of https://git.etud.insa-toulouse.fr/bocquel/Projet_JS
This commit is contained in:
commit
2a2cf84cf3
6 changed files with 151 additions and 6 deletions
2
TODO.txt
Normal file
2
TODO.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
younes: final chrono , pop up cookie , centrer ligne , animation pop up
|
||||
raph : finir de faire marcher la grille, lier la grille à l'affichage des mines, faire la logique du jeu
|
|
@ -5,7 +5,9 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Démineur</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
|
||||
<script type="text/javascript" src="demineur.js"></script>
|
||||
|
||||
</head>
|
||||
<body id="body_demineur">
|
||||
|
||||
|
@ -16,20 +18,27 @@
|
|||
<div class="item_nav">
|
||||
<a href="https://demineur.nhtdev.com/fr/rules">Help</a>
|
||||
</div>
|
||||
|
||||
<div class="item_nav">
|
||||
Temps:
|
||||
</div>
|
||||
<input id="temps" type="number" value="000" disabled>
|
||||
</div>
|
||||
|
||||
<div class="item_nav">
|
||||
Mines restantes:10
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<div id="jeu">
|
||||
<button id="debut_game" onclick="chrono()">GO!</button>
|
||||
<button id="fin_game" onclick="reset()">CIAO</button>
|
||||
<div id="grille">
|
||||
<script type="text/javascript">grilleButtons(7,7);</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
32
demineur.js
32
demineur.js
|
@ -9,6 +9,38 @@ class Case {
|
|||
|
||||
|
||||
}
|
||||
function sleep(ms){
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
async function chrono(){
|
||||
let k=document.getElementById("temps").value;
|
||||
const myButton = document.getElementById("fin_game");
|
||||
let arret=0;
|
||||
myButton.addEventListener("click",() =>{arret=1;})
|
||||
|
||||
while(arret==!1) {
|
||||
await sleep(1000);
|
||||
if (arret==!1){
|
||||
document.getElementById("temps").value=document.getElementById("temps").value*1+1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
async function reset(){
|
||||
|
||||
document.getElementById("temps").value=0;
|
||||
|
||||
}
|
||||
|
||||
function Cookies() {
|
||||
var accept = confirm("Tu veux des cookies ?");
|
||||
if (accept === true) {
|
||||
alert("Bon jeu!");
|
||||
} else {
|
||||
Cookies();
|
||||
}
|
||||
}
|
||||
//Cookies();
|
||||
|
||||
|
||||
let grille = [];
|
||||
|
|
69
main.css
Normal file
69
main.css
Normal file
|
@ -0,0 +1,69 @@
|
|||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: linear-gradient(135deg, #007BFF, #00C6FF);
|
||||
color: #007BFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.container {
|
||||
text-align: center;
|
||||
max-width: 600px;
|
||||
padding: 20px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
|
||||
header .logo {
|
||||
width: 100px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: 2rem;
|
||||
color: #007BFF;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.welcome-image {
|
||||
width: 80%;
|
||||
max-width: 400px;
|
||||
margin: 20px auto;
|
||||
display: block;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
|
||||
button {
|
||||
padding: 15px 30px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
background-color: #007BFF;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s, transform 0.2s;
|
||||
}
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
|
||||
footer {
|
||||
margin-top: 20px;
|
||||
font-size: 14px;
|
||||
color: #888;
|
||||
}
|
32
main.html
32
main.html
|
@ -1 +1,31 @@
|
|||
<html></html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<title>Démineur - Accueil</title>
|
||||
<link rel="stylesheet" href="main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<img src="logo.png" alt="Logo du Démineur" class="logo">
|
||||
<h1>Bienvenue dans le Monde du Démineur !</h1>
|
||||
</header>
|
||||
<main>
|
||||
<p>Préparez-vous à une expérience de jeu inoubliable ! Cliquez sur le bouton ci-dessous pour commencer votre aventure.</p>
|
||||
<img src="welcome-image.png" alt="Image de bienvenue" class="welcome-image">
|
||||
<button id="play-button">JOUER</button>
|
||||
</main>
|
||||
<footer>
|
||||
<p>© 2024 Démineur. Tous droits réservés.</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById('play-button').addEventListener('click', () => {
|
||||
window.location.href = 'game.html';
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
11
style.css
11
style.css
|
@ -1,6 +1,6 @@
|
|||
#nav_demineur{
|
||||
width: 100%;
|
||||
background-position:0cm;
|
||||
|
||||
background-color: #2bd7d484;
|
||||
border-width: 2px;
|
||||
border-style: double;
|
||||
|
@ -18,10 +18,13 @@
|
|||
}
|
||||
|
||||
#jeu{
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
/* border-width: 2px;
|
||||
border-style: double; */
|
||||
justify-content: left;
|
||||
border-width: 2px;
|
||||
border-style: double;
|
||||
width: 49%;
|
||||
|
||||
}
|
||||
|
||||
#grille{
|
||||
|
|
Loading…
Reference in a new issue