|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="it"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <title>Forza Quattro - Gioco 2 Player</title> |
| 7 | + <style> |
| 8 | + /* Stili di base per la pagina */ |
| 9 | + body { |
| 10 | + font-family: Arial, sans-serif; |
| 11 | + background: #f0f0f0; |
| 12 | + margin: 0; |
| 13 | + padding: 20px; |
| 14 | + text-align: center; |
| 15 | + } |
| 16 | + #gameContainer { |
| 17 | + margin: 0 auto; |
| 18 | + max-width: 600px; |
| 19 | + position: relative; |
| 20 | + } |
| 21 | + canvas { |
| 22 | + background: #0077b6; |
| 23 | + border: 2px solid #023e8a; |
| 24 | + display: block; |
| 25 | + margin: 20px auto; |
| 26 | + } |
| 27 | + button { |
| 28 | + margin: 5px; |
| 29 | + padding: 10px 20px; |
| 30 | + background-color: #90e0ef; |
| 31 | + border: none; |
| 32 | + border-radius: 5px; |
| 33 | + font-size: 16px; |
| 34 | + cursor: pointer; |
| 35 | + } |
| 36 | + button:hover { |
| 37 | + background-color: #caf0f8; |
| 38 | + } |
| 39 | + input { |
| 40 | + padding: 8px; |
| 41 | + border: 1px solid #ccc; |
| 42 | + border-radius: 4px; |
| 43 | + margin: 5px; |
| 44 | + font-size: 16px; |
| 45 | + } |
| 46 | + #playerSetup { |
| 47 | + margin: 20px; |
| 48 | + } |
| 49 | + /* Stili per le finestre modali (Help e Storico) */ |
| 50 | + .modal { |
| 51 | + display: none; |
| 52 | + position: fixed; |
| 53 | + z-index: 100; |
| 54 | + left: 0; |
| 55 | + top: 0; |
| 56 | + width: 100%; |
| 57 | + height: 100%; |
| 58 | + overflow: auto; |
| 59 | + background-color: rgba(0,0,0,0.4); |
| 60 | + } |
| 61 | + .modal-content { |
| 62 | + background-color: #fff; |
| 63 | + margin: 10% auto; |
| 64 | + padding: 20px; |
| 65 | + border: 1px solid #888; |
| 66 | + width: 80%; |
| 67 | + max-width: 500px; |
| 68 | + text-align: left; |
| 69 | + } |
| 70 | + .close { |
| 71 | + color: #aaa; |
| 72 | + float: right; |
| 73 | + font-size: 28px; |
| 74 | + font-weight: bold; |
| 75 | + cursor: pointer; |
| 76 | + } |
| 77 | + .close:hover, |
| 78 | + .close:focus { |
| 79 | + color: black; |
| 80 | + text-decoration: none; |
| 81 | + } |
| 82 | + /* Stili per la tabella dello storico */ |
| 83 | + table#historyTable { |
| 84 | + width: 100%; |
| 85 | + border-collapse: collapse; |
| 86 | + margin-top: 10px; |
| 87 | + } |
| 88 | + table#historyTable th, table#historyTable td { |
| 89 | + border: 1px solid #ccc; |
| 90 | + padding: 8px; |
| 91 | + text-align: center; |
| 92 | + } |
| 93 | + table#historyTable th { |
| 94 | + background-color: #90e0ef; |
| 95 | + } |
| 96 | + </style> |
| 97 | +</head> |
| 98 | +<body> |
| 99 | + <h1>Forza Quattro - Gioco 2 Player</h1> |
| 100 | + <div id="gameContainer"> |
| 101 | + <!-- Sezione per l'inserimento dei nomi dei giocatori --> |
| 102 | + <div id="playerSetup"> |
| 103 | + <input type="text" id="inputPlayer1" placeholder="Nome Giocatore 1"> |
| 104 | + <input type="text" id="inputPlayer2" placeholder="Nome Giocatore 2"> |
| 105 | + <button id="btnSetNames">Avvia Partita</button> |
| 106 | + </div> |
| 107 | + <!-- Canvas: verrà visualizzato il tabellone dopo l'avvio della partita --> |
| 108 | + <canvas id="gameCanvas" width="560" height="480" style="display: none;"></canvas> |
| 109 | + <!-- Controlli: Nuova Partita, Help, Mostra Storico --> |
| 110 | + <div id="controls" style="display: none;"> |
| 111 | + <button id="btnReset">Nuova Partita</button> |
| 112 | + <button id="btnHelp">Help</button> |
| 113 | + <button id="btnHistory">Mostra Storico</button> |
| 114 | + </div> |
| 115 | + </div> |
| 116 | + <!-- Modale Help --> |
| 117 | + <div id="helpModal" class="modal"> |
| 118 | + <div class="modal-content"> |
| 119 | + <span class="close" id="closeHelp">×</span> |
| 120 | + <h2>Come si gioca a Forza Quattro</h2> |
| 121 | + <p> |
| 122 | + Forza Quattro è un gioco per due giocatori su un tabellone di 7 colonne e 6 righe.<br> |
| 123 | + I giocatori, a turno, scelgono una colonna in cui far cadere la propria pedina.<br> |
| 124 | + La pedina occupa la cella disponibile più bassa nella colonna.<br> |
| 125 | + Vince colui che riesce ad allineare 4 pedine consecutive (in orizzontale, verticale o diagonale).<br> |
| 126 | + Se il tabellone si riempie senza vincitori, la partita finisce in pareggio. |
| 127 | + </p> |
| 128 | + </div> |
| 129 | + </div> |
| 130 | + <!-- Modale Storico --> |
| 131 | + <div id="historyModal" class="modal"> |
| 132 | + <div class="modal-content"> |
| 133 | + <span class="close" id="closeHistory">×</span> |
| 134 | + <h2>Storico Vittorie</h2> |
| 135 | + <div id="historyContent"> |
| 136 | + <!-- In questa area verrà inserita la tabella dei record --> |
| 137 | + </div> |
| 138 | + </div> |
| 139 | + </div> |
| 140 | + <!-- Inclusione del file di logica JavaScript --> |
| 141 | + <script src="script.js"></script> |
| 142 | +</body> |
| 143 | +</html> |
0 commit comments