premiere version

This commit is contained in:
vesta 2025-08-30 00:18:53 +02:00
parent f001d8295c
commit 5dcb18fe66
2 changed files with 619 additions and 495 deletions

110
html/main.html Normal file
View file

@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>defiance v0.12.1</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/simplex-noise/2.4.0/simplex-noise.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
<style>
body { font-family: 'Inter', sans-serif; overflow: hidden; }
canvas { display: block; background-color: #1a202c; cursor: pointer; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #2d3748; }
::-webkit-scrollbar-thumb { background: #4a5568; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #718096; }
.control-btn {
background-color: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.4);
color: white; font-size: 1.5rem; font-weight: bold; display: flex;
align-items: center; justify-content: center; user-select: none;
-webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.control-btn:active { background-color: rgba(255, 255, 255, 0.5); }
.equip-btn, .menu-btn {
background-color: #3182ce; color: white; padding: 2px 6px; border-radius: 4px;
font-size: 0.75rem; cursor: pointer; margin-left: 8px; border: none;
}
.equip-btn:hover, .menu-btn:hover { background-color: #2b6cb0; }
.menu-btn { padding: 8px 12px; font-size: 1rem; width: 100%; text-align: left; }
.menu-btn:disabled { background-color: #4a5568; cursor: not-allowed; }
@media (min-width: 1024px) { #mobile-controls, #info-toggle-btn { display: none; } }
</style>
</head>
<body class="bg-gray-900 text-white flex h-screen">
<!-- Panneau d'information Desktop -->
<div id="desktop-panel" class="w-1/4 max-w-sm p-6 bg-gray-800 shadow-lg overflow-y-auto flex-col hidden md:flex">
<h1 class="text-2xl font-bold mb-4 text-cyan-400">defiance v0.12.1</h1>
<p class="text-sm text-gray-400 mb-6">ZQSD/Flèches: Bouger | E: Interagir | C: Camper</p>
<div class="space-y-4">
<h2 class="text-xl font-semibold border-b-2 border-gray-700 pb-2">Feuille de Personnage</h2>
<div id="player-info-desktop" class="bg-gray-700 p-4 rounded-lg text-sm space-y-3"></div>
<h2 class="text-xl font-semibold border-b-2 border-gray-700 pb-2 mt-4">Infos de la Tuile</h2>
<div id="tile-info-desktop" class="bg-gray-700 p-4 rounded-lg text-sm"></div>
</div>
<div class="mt-auto pt-6 text-center text-xs text-gray-500"><p>Généré par Gemini</p></div>
</div>
<!-- Zone du jeu -->
<div class="flex-1 relative">
<canvas id="gameCanvas"></canvas>
<div id="loading" class="absolute inset-0 bg-black bg-opacity-75 flex items-center justify-center text-2xl z-50">Le monde prend vie...</div>
<!-- UI Temps et Saison -->
<div id="time-ui" class="absolute top-4 left-4 bg-black/50 p-2 rounded-lg text-sm font-semibold z-20">
<div id="time-display">Jour 1, 06:00</div>
<div id="season-display">Printemps</div>
</div>
<!-- Bouton d'info Mobile -->
<button id="info-toggle-btn" class="control-btn absolute top-5 right-5 w-16 h-16 rounded-full text-3xl z-20">🎒</button>
<!-- Panneau d'info Mobile (Overlay) -->
<div id="mobile-info-panel" class="absolute inset-0 bg-black/75 p-4 flex-col items-center justify-center z-30 hidden">
<div class="w-full max-w-md max-h-full bg-gray-800 rounded-lg shadow-lg overflow-y-auto p-6 space-y-4">
<h2 class="text-xl font-semibold border-b-2 border-gray-700 pb-2">Feuille de Personnage</h2>
<div id="player-info-mobile" class="bg-gray-700 p-4 rounded-lg text-sm space-y-3"></div>
<h2 class="text-xl font-semibold border-b-2 border-gray-700 pb-2 mt-4">Infos de la Tuile</h2>
<div id="tile-info-mobile" class="bg-gray-700 p-4 rounded-lg text-sm"></div>
</div>
</div>
<!-- Contrôles Mobiles -->
<div id="mobile-controls" class="absolute bottom-20 right-5 flex items-end gap-4 z-20">
<button id="btn-camp" class="control-btn rounded-full w-20 h-20 text-3xl"></button>
<button id="btn-action" class="control-btn rounded-full w-20 h-20 text-3xl"></button>
<div class="grid grid-cols-3 grid-rows-3 w-36 h-36 gap-1">
<div></div><button id="btn-up" class="control-btn rounded-t-lg"></button><div></div>
<button id="btn-left" class="control-btn rounded-l-lg"></button><div></div><button id="btn-right" class="control-btn rounded-r-lg"></button>
<div></div><button id="btn-down" class="control-btn rounded-b-lg"></button><div></div>
</div>
</div>
<!-- Écran de Combat -->
<div id="combat-screen" class="absolute inset-0 bg-black/80 flex-col items-center justify-center z-40 hidden">
<div class="text-center text-4xl mb-8 text-red-500 font-bold">COMBAT !</div>
<div class="flex justify-around w-full max-w-4xl">
<div class="text-center w-1/3">
<div class="text-8xl">🦸</div>
<h3 class="text-2xl font-bold text-cyan-400">Héros</h3>
<div class="w-full bg-gray-700 rounded-full h-6 mt-2 border-2 border-gray-600"><div id="combat-player-hp-bar" class="bg-green-500 h-full rounded-full text-center text-white font-bold transition-all duration-500"></div></div>
<div id="combat-player-hp-text" class="mt-1"></div>
</div>
<div class="text-4xl font-bold self-center">VS</div>
<div class="text-center w-1/3">
<div id="combat-opponent-icon" class="text-8xl"></div>
<h3 id="combat-opponent-name" class="text-2xl font-bold text-red-400"></h3>
<div class="w-full bg-gray-700 rounded-full h-6 mt-2 border-2 border-gray-600"><div id="combat-opponent-hp-bar" class="bg-red-500 h-full rounded-full text-center text-white font-bold transition-all duration-500"></div></div>
<div id="combat-opponent-hp-text" class="mt-1"></div>
</div>
</div>
<div class="mt-12 flex flex-col items-center">
<button id="attack-btn" class="bg-red-600 hover:bg-red-700 text-white font-bold py-4 px-8 rounded-lg text-2xl shadow-lg">⚔️ Attaquer</button>
<div id="combat-log" class="mt-4 h-24 text-center text-gray-300"></div>
</div>
</div>
</div>
<script src="../js/script.js"></script>
</body>
</html>