Initial Push
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
// On commence par session_start AVANT tout envoi de texte
|
||||||
|
session_start();
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
// Configuration BDD
|
||||||
|
$host = 'localhost';
|
||||||
|
$db = 'yahtzee_paf';
|
||||||
|
$user = 'root';
|
||||||
|
$pass = '';
|
||||||
|
|
||||||
|
$options = [
|
||||||
|
PDO::ATTR_ERRMODE => 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 "":
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'>
|
||||||
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||||
|
<title>Configuration - Yahtzee PAF</title>
|
||||||
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
|
<link rel='stylesheet' type='text/css' media='screen' href='../css/config.css'>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="main-wrapper">
|
||||||
|
<div class="yahtzee-table config-table">
|
||||||
|
<div class="table-inner">
|
||||||
|
<header class="config-header">
|
||||||
|
<div class="dice-icon">🎲</div>
|
||||||
|
<h1>Nouvelle Partie</h1>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<form id="config-form">
|
||||||
|
<div class="input-group">
|
||||||
|
<label for="game-name">Nom de la table</label>
|
||||||
|
<input type="text" id="game-name" placeholder="Ex: La Table des Légendes" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<label for="player-count">Nombre de joueurs</label>
|
||||||
|
<select id="player-count" onchange="updatePlayerInputs()">
|
||||||
|
<option value="1">1 Joueur (Solo)</option>
|
||||||
|
<option value="2" selected>2 Joueurs</option>
|
||||||
|
<option value="3">3 Joueurs</option>
|
||||||
|
<option value="4">4 Joueurs</option>
|
||||||
|
<option value="5">5 Joueurs</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="players-names-container" class="players-list">
|
||||||
|
<label>Participants & Couleurs</label>
|
||||||
|
|
||||||
|
<div class="player-row">
|
||||||
|
<input type="color" class="color-picker" value="#ff3131">
|
||||||
|
<input type="text" placeholder="Joueur 1" class="player-input">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="player-row">
|
||||||
|
<input type="color" class="color-picker" value="#d4af37">
|
||||||
|
<input type="text" placeholder="Joueur 2" class="player-input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="button-footer">
|
||||||
|
<button type="button" class="btn-cancel" onclick="window.location.href='../index.html'">Annuler</button>
|
||||||
|
<button type="submit" class="btn-confirm">Lancer les dés !</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src='../js/config.js'></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -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; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'>
|
||||||
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||||
|
<title>Partie - Yahtzee PAF</title>
|
||||||
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
|
<link rel='stylesheet' type='text/css' media='screen' href='css/game.css'>
|
||||||
|
<script src='main.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html></html>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8'>
|
||||||
|
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
|
||||||
|
<title>Accueil - Yahtzee PAF</title>
|
||||||
|
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||||
|
<link rel='stylesheet' type='text/css' media='screen' href='css/index.css'>
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.png">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="main-wrapper">
|
||||||
|
<header class="yahtzee-table table-header">
|
||||||
|
<div class="table-inner">
|
||||||
|
<h1>Welcome to</h1>
|
||||||
|
<div class="logo-wrapper">
|
||||||
|
<div class="neon-dice">Yahtzee <span>PAF</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="tables-hall">
|
||||||
|
<div class="yahtzee-table table-main">
|
||||||
|
<div class="table-inner">
|
||||||
|
<div class="button-center-wrapper">
|
||||||
|
<button class="btn-main-create" onclick="window.location.href='config/index.html'">
|
||||||
|
Lancer une partie
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>Parties en attente de joueurs</h2>
|
||||||
|
<div id="games_list">
|
||||||
|
<p class="placeholder-text">Aucune table ouverte pour le moment...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src='js/index.js'></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -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 = '<label>Participants & Couleurs</label>';
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user