Changes to urinoir.scroll.pub

root
root
26 days ago
Initial commit
body.html
Changed around line 1
+
+

Urinoir Placement Simulator

+

Test your urinal selection skills in this interactive game!

+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+

Score: 0

+

+
+
+
+
+

How to Play

+
    +
  1. Choose the number of urinals
  2. +
  3. Click Start Game
  4. +
  5. Select the best available urinal
  6. +
  7. Earn points based on your choices
  8. +
    +

    Remember: The goal is to maximize privacy while following social norms!

    +
    +
    +
    +
    +

    A fun simulation of public restroom etiquette

    +
    index.scroll
    Changed around line 1
    + buildHtml
    + baseUrl https://urinoir.scroll.pub
    + metaTags
    + editButton /edit.html
    + title Urinoir Placement Simulator
    + style.css
    + body.html
    + script.js
    readme.scroll
    Changed around line 1
    + # 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
    script.js
    Changed around line 1
    + 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 });
    + }
    style.css
    Changed around line 1
    + :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;
    + }
    + }