Mise à jour de 'flask_base/templates/pokemon.html'
This commit is contained in:
@@ -5,6 +5,22 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Jeu Pokémon</title>
|
||||
<link rel="stylesheet" href="../static/style.css">
|
||||
<style>
|
||||
#log {
|
||||
width: 90%;
|
||||
height: 200px;
|
||||
border: 1px solid #555;
|
||||
padding: 10px;
|
||||
margin-top: 15px;
|
||||
background: #111;
|
||||
color: white;
|
||||
white-space: pre-line;
|
||||
overflow-y: auto; /* Scroll vertical */
|
||||
display: flex;
|
||||
flex-direction: column; /* Les nouveaux messages vont en bas */
|
||||
gap: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -28,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="battle">
|
||||
<h2>Combat Pokémon-like (simple)</h2>
|
||||
<h2>Proprimon</h2>
|
||||
|
||||
<div class="row">
|
||||
<div id = "scoreDiv">Score: 0</div>
|
||||
@@ -123,7 +139,12 @@
|
||||
}
|
||||
|
||||
function addLog(text) {
|
||||
log.textContent = log.textContent + '\n' + text;
|
||||
const entry = document.createElement("div");
|
||||
entry.textContent = text;
|
||||
log.appendChild(entry);
|
||||
|
||||
// Scroll automatique vers le bas
|
||||
log.scrollTop = log.scrollHeight;
|
||||
}
|
||||
|
||||
const attacksDiv = document.getElementById("attacksDiv");
|
||||
@@ -171,7 +192,7 @@
|
||||
addRandomItemToInventory();
|
||||
score += 1;
|
||||
setCombat();
|
||||
addLog("Un nouvel ennemi sauvage apparaît !\n");
|
||||
addLog("\nUn nouvel ennemi sauvage apparaît !");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user