From ab0e19ef34ad85cbb0ce81e198f809d7059fc65f Mon Sep 17 00:00:00 2001 From: Whykioh Date: Mon, 30 Mar 2026 20:03:34 +0200 Subject: [PATCH] Initial Push --- yahtzee/RequestsHandler.php | 39 ++++++++ yahtzee/config/index.html | 62 ++++++++++++ yahtzee/css/config.css | 191 ++++++++++++++++++++++++++++++++++++ yahtzee/css/game.css | 0 yahtzee/css/index.css | 139 ++++++++++++++++++++++++++ yahtzee/game/index.html | 14 +++ yahtzee/index.html | 43 ++++++++ yahtzee/js/config.js | 31 ++++++ yahtzee/js/game.js | 0 yahtzee/js/index.js | 0 10 files changed, 519 insertions(+) create mode 100644 yahtzee/RequestsHandler.php create mode 100644 yahtzee/config/index.html create mode 100644 yahtzee/css/config.css create mode 100644 yahtzee/css/game.css create mode 100644 yahtzee/css/index.css create mode 100644 yahtzee/game/index.html create mode 100644 yahtzee/index.html create mode 100644 yahtzee/js/config.js create mode 100644 yahtzee/js/game.js create mode 100644 yahtzee/js/index.js diff --git a/yahtzee/RequestsHandler.php b/yahtzee/RequestsHandler.php new file mode 100644 index 0000000..177af00 --- /dev/null +++ b/yahtzee/RequestsHandler.php @@ -0,0 +1,39 @@ + PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => false, + PDO::ATTR_STRINGIFY_FETCHES => false, +]; + +try { + $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8", $user, $pass, $options); +} catch (Exception $e) { + echo json_encode(['success' => false, 'error' => 'Connexion échouée']); + exit; +} + +// Lecture de l'input +$json = file_get_contents('php://input'); +$data = json_decode($json, true); + +if (!$data || !isset($data['action'])) { + echo json_encode(['success' => false, 'error' => 'Aucune action spécifiée']); + exit; +} + +$action = $data['action']; +$params = $data['params'] ?? []; + +switch ($action) { + case "": \ No newline at end of file diff --git a/yahtzee/config/index.html b/yahtzee/config/index.html new file mode 100644 index 0000000..e5bf1fe --- /dev/null +++ b/yahtzee/config/index.html @@ -0,0 +1,62 @@ + + + + + + Configuration - Yahtzee PAF + + + + + +
+
+
+
+
🎲
+

Nouvelle Partie

+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ +
+ + +
+
+ + +
+
+
+
+ + + + \ No newline at end of file diff --git a/yahtzee/css/config.css b/yahtzee/css/config.css new file mode 100644 index 0000000..8f0774b --- /dev/null +++ b/yahtzee/css/config.css @@ -0,0 +1,191 @@ +:root { + --night-blue: radial-gradient(circle, #1a2a6c 0%, #0a1128 100%); + --velvet-red: #8e0000; + --neon-red: #ff3131; + --gold: #d4af37; + --gold-light: #f9e27d; + --dark-bg: #050505; +} + +body { + background-color: var(--dark-bg); + background-image: radial-gradient(circle at center, #0a1128 0%, #020205 100%); + color: white; + font-family: 'Segoe UI', sans-serif; + margin: 0; + display: flex; + justify-content: center; + align-items: center; + min-height: 100vh; +} + +.main-wrapper { + width: 100%; + max-width: 600px; + padding: 20px; +} + +/* --- LA TABLE DE CONFIGURATION --- */ +.config-table { + background: var(--night-blue); + border-radius: 60px; + border: 12px solid #2d0000; + outline: 2px solid #4a0000; + padding: 40px; + box-shadow: 0 25px 50px rgba(0,0,0,0.9), inset 0 0 60px rgba(0,0,0,0.7); + position: relative; +} + +.config-table::before { + content: ''; + position: absolute; + top: 10px; left: 10px; right: 10px; bottom: 10px; + border: 1px solid rgba(255, 255, 255, 0.05); + border-radius: 50px; + pointer-events: none; +} + +/* --- HEADER --- */ +.config-header { + text-align: center; + margin-bottom: 30px; +} + +.dice-icon { + font-size: 3rem; + filter: drop-shadow(0 0 10px var(--neon-red)); + margin-bottom: 10px; +} + +.config-header h1 { + color: var(--gold); + text-transform: uppercase; + letter-spacing: 2px; + font-size: 1.8rem; + margin: 0; +} + +/* --- FORMULAIRE --- */ +.input-group { + display: flex; + flex-direction: column; + margin-bottom: 20px; +} + +.input-group label, .players-list label { + color: var(--gold); + font-size: 0.9rem; + text-transform: uppercase; + margin-bottom: 8px; + font-weight: bold; +} + +input[type="text"], select { + background: rgba(0, 0, 0, 0.4); + border: 2px solid #2d0000; + border-radius: 10px; + padding: 12px; + color: white; + font-size: 1rem; + outline: none; + transition: border-color 0.3s; +} + +input[type="text"]:focus, select:focus { + border-color: var(--neon-red); +} + +.players-list { + display: flex; + flex-direction: column; + gap: 10px; + margin-bottom: 30px; +} + +/* --- BOUTONS --- */ +.button-footer { + display: flex; + gap: 15px; +} + +.btn-confirm { + flex: 2; + background: linear-gradient(135deg, #b31217 0%, #e52d27 100%); + color: white; + border: 2px solid var(--gold); + padding: 15px; + border-radius: 50px; + font-weight: 900; + cursor: pointer; + text-transform: uppercase; + box-shadow: 0 5px 0 #600000; + transition: 0.2s; +} + +.btn-confirm:hover { + filter: brightness(1.2); + transform: translateY(-2px); +} + +.btn-cancel { + flex: 1; + background: transparent; + color: rgba(255,255,255,0.5); + border: 2px solid rgba(255,255,255,0.2); + padding: 15px; + border-radius: 50px; + cursor: pointer; +} + +.btn-cancel:hover { + color: white; + border-color: white; +} + +/* Alignement du sélecteur et du texte */ +.player-row { + display: flex; + align-items: center; + gap: 15px; + margin-bottom: 10px; +} + +/* Style du sélecteur de couleur */ +.color-picker { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + width: 45px; + height: 45px; + background-color: transparent; + border: 2px solid #2d0000; + border-radius: 50%; /* On le fait rond comme un jeton */ + cursor: pointer; + padding: 0; + overflow: hidden; +} + +.color-picker::-webkit-color-swatch-wrapper { + padding: 0; +} + +.color-picker::-webkit-color-swatch { + border: none; + border-radius: 50%; +} + +/* On ajuste l'input texte pour qu'il prenne le reste de la place */ +.player-input { + flex: 1; + background: rgba(0, 0, 0, 0.4); + border: 2px solid #2d0000; + border-radius: 10px; + padding: 12px; + color: white; + outline: none; +} + +.player-input:focus { + border-color: var(--neon-red); + box-shadow: 0 0 10px rgba(255, 49, 49, 0.3); +} \ No newline at end of file diff --git a/yahtzee/css/game.css b/yahtzee/css/game.css new file mode 100644 index 0000000..e69de29 diff --git a/yahtzee/css/index.css b/yahtzee/css/index.css new file mode 100644 index 0000000..98eb48f --- /dev/null +++ b/yahtzee/css/index.css @@ -0,0 +1,139 @@ +/* --- VARIABLES YAHTZEE PAF --- */ +:root { + --night-blue: radial-gradient(circle, #1a2a6c 0%, #0a1128 100%); + --velvet-red: #8e0000; + --neon-red: #ff3131; + --gold: #d4af37; + --gold-light: #f9e27d; + --dark-bg: #050505; + --white: #ffffff; +} + +body { + background-color: var(--dark-bg); + background-image: radial-gradient(circle at center, #0a1128 0%, #020205 100%); + color: var(--white); + font-family: 'Segoe UI', Roboto, sans-serif; + margin: 0; + min-height: 100vh; + display: flex; + justify-content: center; +} + +.main-wrapper { + display: flex; + flex-direction: column; + align-items: center; + padding: 40px 20px; + width: 100%; + max-width: 1000px; +} + +/* --- STYLE DES TABLES --- */ +.yahtzee-table { + position: relative; + padding: 35px; + border-radius: 80px; + /* Bordure Rouge Classe */ + border: 15px solid #2d0000; + box-shadow: 0 25px 50px rgba(0,0,0,0.9), inset 0 0 60px rgba(0,0,0,0.7); + width: 100%; + outline: 2px solid #4a0000; + margin-bottom: 40px; + box-sizing: border-box; +} + +/* Liseré de finition blanc/bleu */ +.yahtzee-table::before { + content: ''; + position: absolute; + top: 12px; left: 12px; right: 12px; bottom: 12px; + border: 1px solid rgba(255, 255, 255, 0.05); + border-radius: 65px; + pointer-events: none; +} + +.table-inner { + position: relative; + z-index: 2; + text-align: center; +} + +/* Table Header (Plus compact) */ +.table-header { + background: #0a1128; + max-width: 800px; +} + +.table-header h1 { + color: rgba(255, 255, 255, 0.5); + text-transform: uppercase; + font-size: 1rem; + letter-spacing: 4px; + margin-bottom: 10px; +} + +/* Style du Logo Texte Néon */ +.neon-dice { + font-size: 3.5rem; + font-weight: 900; + color: #fff; + text-transform: uppercase; + text-shadow: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red); +} + +.neon-dice span { + color: var(--gold); + text-shadow: 0 0 10px var(--gold); +} + +/* Table de Jeu (Bleu Nuit) */ +.table-main { + background: var(--night-blue); +} + +.button-center-wrapper { + display: flex; + justify-content: center; + padding: 20px 0 40px 0; +} + +/* --- BOUTON ROUGE ET OR --- */ +.btn-main-create { + background: linear-gradient(135deg, #b31217 0%, #e52d27 100%); + color: white; + padding: 18px 45px; + font-weight: 900; + font-size: 1.2rem; + border-radius: 50px; + border: 2px solid var(--gold); + cursor: pointer; + transition: all 0.3s ease; + box-shadow: 0 8px 0px #600000, 0 15px 20px rgba(0,0,0,0.5); + text-transform: uppercase; +} + +.btn-main-create:hover { + transform: translateY(-3px); + filter: brightness(1.2); + box-shadow: 0 11px 0px #600000, 0 20px 25px rgba(0,0,0,0.6); +} + +.table-main h2 { + font-size: 1.1rem; + color: var(--gold); + text-transform: uppercase; + letter-spacing: 1px; + margin-bottom: 30px; +} + +.placeholder-text { + color: rgba(255, 255, 255, 0.2); + font-style: italic; +} + +/* --- RESPONSIVE --- */ +@media (max-width: 600px) { + .yahtzee-table { border-radius: 40px; padding: 20px; } + .neon-dice { font-size: 2.2rem; } +} \ No newline at end of file diff --git a/yahtzee/game/index.html b/yahtzee/game/index.html new file mode 100644 index 0000000..9396224 --- /dev/null +++ b/yahtzee/game/index.html @@ -0,0 +1,14 @@ + + + + + + Partie - Yahtzee PAF + + + + + + + + \ No newline at end of file diff --git a/yahtzee/index.html b/yahtzee/index.html new file mode 100644 index 0000000..04f38e1 --- /dev/null +++ b/yahtzee/index.html @@ -0,0 +1,43 @@ + + + + + + Accueil - Yahtzee PAF + + + + + + +
+
+
+

Welcome to

+
+
Yahtzee PAF
+
+
+
+ +
+
+
+
+ +
+ +

Parties en attente de joueurs

+
+

Aucune table ouverte pour le moment...

+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/yahtzee/js/config.js b/yahtzee/js/config.js new file mode 100644 index 0000000..54ef7d9 --- /dev/null +++ b/yahtzee/js/config.js @@ -0,0 +1,31 @@ +const defaultColors = ['#ff3131', '#d4af37', '#1a2a6c', '#00ff41', '#ff00ff']; + +function updatePlayerInputs() { + const count = document.getElementById('player-count').value; + const container = document.getElementById('players-names-container'); + + // On vide tout sauf le label + container.innerHTML = ''; + + for (let i = 0; i < count; i++) { + const row = document.createElement('div'); + row.className = 'player-row'; + + // Création du sélecteur de couleur + const colorInput = document.createElement('input'); + colorInput.type = 'color'; + colorInput.className = 'color-picker'; + colorInput.value = defaultColors[i] || '#ffffff'; // Couleur par défaut + + // Création du champ nom + const nameInput = document.createElement('input'); + nameInput.type = 'text'; + nameInput.placeholder = 'Joueur ' + (i + 1); + nameInput.className = 'player-input'; + + // Assemblage + row.appendChild(colorInput); + row.appendChild(nameInput); + container.appendChild(row); + } +} \ No newline at end of file diff --git a/yahtzee/js/game.js b/yahtzee/js/game.js new file mode 100644 index 0000000..e69de29 diff --git a/yahtzee/js/index.js b/yahtzee/js/index.js new file mode 100644 index 0000000..e69de29