commit 08de70b3c0d0f8f00fbe9f82d5e98fb8e03a7696
Author: root <root@hub.scroll.pub>
Date: 2024-12-27 13:52:59 +0000
Subject: Initial commit
diff --git a/body.html b/body.html
new file mode 100644
index 0000000..4cd8125
--- /dev/null
+++ b/body.html
@@ -0,0 +1,37 @@
+<header>
+ <h1>Urinoir Placement Simulator</h1>
+ <p>Test your urinal selection skills in this interactive game!</p>
+</header>
+
+<main>
+ <section id="setup">
+ <label for="urinalCount">Number of Urinals:</label>
+ <input type="range" id="urinalCount" min="3" max="10" value="5">
+ <span id="countDisplay">5</span>
+ <button id="startGame">Start Game</button>
+ </section>
+
+ <section id="game" class="hidden">
+ <div id="urinalRow"></div>
+ <button id="nextRound" class="hidden">Next Round</button>
+ <div id="scoreBoard">
+ <h2>Score: <span id="score">0</span></h2>
+ <p id="feedback"></p>
+ </div>
+ </section>
+
+ <section id="instructions">
+ <h2>How to Play</h2>
+ <ol>
+ <li>Choose the number of urinals</li>
+ <li>Click Start Game</li>
+ <li>Select the best available urinal</li>
+ <li>Earn points based on your choices</li>
+ </ol>
+ <p>Remember: The goal is to maximize privacy while following social norms!</p>
+ </section>
+</main>
+
+<footer>
+ <p>A fun simulation of public restroom etiquette</p>
+</footer>
\ No newline at end of file
diff --git a/index.scroll b/index.scroll
new file mode 100644
index 0000000..337785c
--- /dev/null
+++ b/index.scroll
@@ -0,0 +1,8 @@
+buildHtml
+baseUrl https://urinoir.scroll.pub
+metaTags
+editButton /edit.html
+title Urinoir Placement Simulator
+style.css
+body.html
+script.js
\ No newline at end of file
diff --git a/readme.scroll b/readme.scroll
new file mode 100644
index 0000000..3bed521
--- /dev/null
+++ b/readme.scroll
@@ -0,0 +1,2 @@
+# urinoir.scroll.pub
+Website generated by DeepSeek from prompt: crée moi une simulation de placement d'homme pour choisir un urinoir dans des toilettes publiques en fonction de ceux qui sont pris. crée moi un curseur pour choisir le nombre d'urinoir puis génère ensuite les combinaisons possibles.J améliore le en le rendant plus graphique et des fois on a pas le choix de se mettre à côté de quelqu'un.présente le sous la forme d'un jeu où l'utilisateur est noté en fonction du choix qu'il fait dans une situation donnée
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644
index 0000000..e9f837c
--- /dev/null
+++ b/script.js
@@ -0,0 +1,109 @@
+const setupSection = document.getElementById('setup');
+const gameSection = document.getElementById('game');
+const urinalRow = document.getElementById('urinalRow');
+const urinalCountInput = document.getElementById('urinalCount');
+const countDisplay = document.getElementById('countDisplay');
+const startGameBtn = document.getElementById('startGame');
+const nextRoundBtn = document.getElementById('nextRound');
+const scoreDisplay = document.getElementById('score');
+const feedbackDisplay = document.getElementById('feedback');
+
+let score = 0;
+let currentRound = 0;
+let totalRounds = 5;
+let urinalCount = 5;
+
+urinalCountInput.addEventListener('input', () => {
+ urinalCount = parseInt(urinalCountInput.value);
+ countDisplay.textContent = urinalCount;
+});
+
+startGameBtn.addEventListener('click', () => {
+ setupSection.classList.add('hidden');
+ gameSection.classList.remove('hidden');
+ score = 0;
+ currentRound = 0;
+ scoreDisplay.textContent = score;
+ startNewRound();
+});
+
+function startNewRound() {
+ urinalRow.innerHTML = '';
+ const occupiedUrinals = generateOccupiedUrinals();
+
+ for (let i = 0; i < urinalCount; i++) {
+ const urinal = document.createElement('div');
+ urinal.classList.add('urinal');
+ if (occupiedUrinals.includes(i)) {
+ urinal.classList.add('occupied');
+ } else {
+ urinal.addEventListener('click', () => selectUrinal(i, occupiedUrinals));
+ }
+ urinalRow.appendChild(urinal);
+ }
+
+ nextRoundBtn.classList.add('hidden');
+}
+
+function generateOccupiedUrinals() {
+ const occupied = [];
+ const count = Math.floor(Math.random() * (urinalCount - 1)) + 1;
+
+ while (occupied.length < count) {
+ const index = Math.floor(Math.random() * urinalCount);
+ if (!occupied.includes(index)) {
+ occupied.push(index);
+ }
+ }
+
+ return occupied;
+}
+
+function selectUrinal(index, occupiedUrinals) {
+ const urinals = Array.from(urinalRow.children);
+ urinals[index].classList.add('selected');
+
+ const scoreChange = calculateScore(index, occupiedUrinals);
+ score += scoreChange;
+ scoreDisplay.textContent = score;
+
+ showFeedback(scoreChange);
+
+ setTimeout(() => {
+ currentRound++;
+ if (currentRound < totalRounds) {
+ startNewRound();
+ } else {
+ endGame();
+ }
+ }, 1000);
+}
+
+function calculateScore(index, occupiedUrinals) {
+ const adjacent = [index - 1, index + 1];
+ const isAdjacentOccupied = adjacent.some(i => occupiedUrinals.includes(i));
+
+ if (isAdjacentOccupied) {
+ return 1;
+ } else {
+ return 3;
+ }
+}
+
+function showFeedback(scoreChange) {
+ if (scoreChange === 3) {
+ feedbackDisplay.textContent = "Great choice! Maximum privacy.";
+ } else if (scoreChange === 1) {
+ feedbackDisplay.textContent = "Okay, but you're next to someone.";
+ }
+}
+
+function endGame() {
+ feedbackDisplay.textContent = `Game over! Final score: ${score}`;
+ nextRoundBtn.classList.remove('hidden');
+ nextRoundBtn.textContent = "Play Again";
+ nextRoundBtn.addEventListener('click', () => {
+ setupSection.classList.remove('hidden');
+ gameSection.classList.add('hidden');
+ }, { once: true });
+}
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..3bd0b01
--- /dev/null
+++ b/style.css
@@ -0,0 +1,120 @@
+:root {
+ --primary: #4a90e2;
+ --secondary: #f5a623;
+ --background: #f8f9fa;
+ --text: #333;
+ --border: #ddd;
+}
+
+body {
+ font-family: 'Segoe UI', system-ui, sans-serif;
+ line-height: 1.6;
+ margin: 0;
+ padding: 20px;
+ background-color: var(--background);
+ color: var(--text);
+ max-width: 800px;
+ margin: 0 auto;
+}
+
+header {
+ text-align: center;
+ margin-bottom: 2rem;
+}
+
+h1 {
+ color: var(--primary);
+ font-size: 2.5rem;
+ margin-bottom: 0.5rem;
+}
+
+#setup {
+ background: white;
+ padding: 1.5rem;
+ border-radius: 8px;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ margin-bottom: 2rem;
+ text-align: center;
+}
+
+input[type="range"] {
+ width: 60%;
+ margin: 0 1rem;
+}
+
+#urinalRow {
+ display: flex;
+ justify-content: center;
+ gap: 10px;
+ margin: 2rem 0;
+}
+
+.urinal {
+ width: 50px;
+ height: 100px;
+ background-color: var(--primary);
+ border-radius: 4px;
+ cursor: pointer;
+ transition: transform 0.2s;
+ position: relative;
+}
+
+.urinal.occupied {
+ background-color: var(--secondary);
+ cursor: not-allowed;
+}
+
+.urinal.selected {
+ transform: scale(1.1);
+ box-shadow: 0 0 0 3px var(--primary);
+}
+
+#scoreBoard {
+ text-align: center;
+ margin: 2rem 0;
+}
+
+#score {
+ color: var(--primary);
+ font-size: 2rem;
+}
+
+button {
+ background-color: var(--primary);
+ color: white;
+ border: none;
+ padding: 0.8rem 1.5rem;
+ border-radius: 4px;
+ cursor: pointer;
+ font-size: 1rem;
+ transition: background-color 0.2s;
+}
+
+button:hover {
+ background-color: #357abd;
+}
+
+.hidden {
+ display: none;
+}
+
+footer {
+ text-align: center;
+ margin-top: 3rem;
+ color: #666;
+}
+
+@media (max-width: 600px) {
+ h1 {
+ font-size: 2rem;
+ }
+
+ #urinalRow {
+ gap: 5px;
+ }
+
+ .urinal {
+ width: 40px;
+ height: 80px;
+ }
+}
\ No newline at end of file