commit b8bfeba362409326b89bc7c2f7d12553279f6deb
Author: root <root@hub.scroll.pub> Date: 2024-12-30 20:52:12 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..29a788d --- /dev/null +++ b/body.html @@ -0,0 +1,13 @@ +<header> + <h1>VetWordle</h1> + <p>Adivina la palabra veterinaria en 6 intentos</p> +</header> +<main> + <div id="game-board"></div> + <div id="keyboard"></div> + <div id="message"></div> + <button id="reset-button">Reiniciar Juego</button> +</main> +<footer> + <p>Creado con ❤️ para amantes de los animales</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..9839965 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://vetwordle.scroll.pub +metaTags +editButton /edit.html +title VetWordle - Juego de Palabras para Veterinarios +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..46adc5d --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "f8fbd2d3-c85e-4f26-869b-d7cd6b3b18e4", + "object": "chat.completion", + "created": 1735591906, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nvetwordle.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://vetwordle.scroll.pub\nmetaTags\neditButton /edit.html\ntitle VetWordle - Juego de Palabras para Veterinarios\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>VetWordle</h1>\n <p>Adivina la palabra veterinaria en 6 intentos</p>\n</header>\n<main>\n <div id=\"game-board\"></div>\n <div id=\"keyboard\"></div>\n <div id=\"message\"></div>\n <button id=\"reset-button\">Reiniciar Juego</button>\n</main>\n<footer>\n <p>Creado con ❤️ para amantes de los animales</p>\n</footer>\n---style.css---\n:root {\n --primary: #4CAF50;\n --secondary: #2196F3;\n --background: #f5f5f5;\n --text: #333;\n --correct: #4CAF50;\n --present: #FFC107;\n --absent: #9E9E9E;\n}\n\n* {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\nbody {\n font-family: 'Segoe UI', sans-serif;\n background-color: var(--background);\n color: var(--text);\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 1rem;\n}\n\nheader {\n text-align: center;\n margin-bottom: 2rem;\n}\n\nh1 {\n color: var(--primary);\n font-size: 2.5rem;\n}\n\n#game-board {\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n gap: 0.5rem;\n margin-bottom: 2rem;\n}\n\n.row {\n display: grid;\n grid-template-columns: repeat(5, 1fr);\n gap: 0.5rem;\n}\n\n.cell {\n width: 60px;\n height: 60px;\n border: 2px solid var(--secondary);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 2rem;\n font-weight: bold;\n text-transform: uppercase;\n transition: all 0.3s ease;\n}\n\n.cell.correct {\n background-color: var(--correct);\n border-color: var(--correct);\n color: white;\n}\n\n.cell.present {\n background-color: var(--present);\n border-color: var(--present);\n color: white;\n}\n\n.cell.absent {\n background-color: var(--absent);\n border-color: var(--absent);\n color: white;\n}\n\n#keyboard {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin-bottom: 2rem;\n}\n\n.keyboard-row {\n display: flex;\n justify-content: center;\n gap: 0.5rem;\n}\n\n.key {\n padding: 1rem;\n border: none;\n background-color: var(--secondary);\n color: white;\n font-size: 1rem;\n font-weight: bold;\n cursor: pointer;\n border-radius: 5px;\n transition: background-color 0.3s ease;\n}\n\n.key:hover {\n background-color: #1976D2;\n}\n\n#message {\n height: 2rem;\n margin-bottom: 1rem;\n font-weight: bold;\n text-align: center;\n}\n\n#reset-button {\n padding: 1rem 2rem;\n background-color: var(--primary);\n color: white;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s ease;\n}\n\n#reset-button:hover {\n background-color: #45a049;\n}\n\n@media (max-width: 600px) {\n .cell {\n width: 50px;\n height: 50px;\n font-size: 1.5rem;\n }\n\n .key {\n padding: 0.75rem;\n font-size: 0.9rem;\n }\n}\n---script.js---\nconst words = ['gatos', 'perro', 'pulga', 'vacuna', 'zorro'];\nlet secretWord = words[Math.floor(Math.random() * words.length)];\nlet currentAttempt = '';\nlet attempts = [];\nconst maxAttempts = 6;\n\nconst gameBoard = document.getElementById('game-board');\nconst keyboard = document.getElementById('keyboard');\nconst message = document.getElementById('message');\nconst resetButton = document.getElementById('reset-button');\n\nfunction createGameBoard() {\n for (let i = 0; i < maxAttempts; i++) {\n const row = document.createElement('div');\n row.className = 'row';\n for (let j = 0; j < 5; j++) {\n const cell = document.createElement('div');\n cell.className = 'cell';\n row.appendChild(cell);\n }\n gameBoard.appendChild(row);\n }\n}\n\nfunction createKeyboard() {\n const keyboardLayout = [\n ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'],\n ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],\n ['Enter', 'z', 'x', 'c', 'v', 'b', 'n', 'm', '⌫']\n ];\n\n keyboardLayout.forEach(row => {\n const keyboardRow = document.createElement('div');\n keyboardRow.className = 'keyboard-row';\n row.forEach(key => {\n const keyButton = document.createElement('button');\n keyButton.className = 'key';\n keyButton.textContent = key;\n keyButton.addEventListener('click', () => handleKeyPress(key));\n keyboardRow.appendChild(keyButton);\n });\n keyboard.appendChild(keyboardRow);\n });\n}\n\nfunction handleKeyPress(key) {\n if (key === 'Enter') {\n submitAttempt();\n } else if (key === '⌫') {\n currentAttempt = currentAttempt.slice(0, -1);\n } else if (currentAttempt.length < 5) {\n currentAttempt += key;\n }\n updateGameBoard();\n}\n\nfunction submitAttempt() {\n if (currentAttempt.length === 5) {\n attempts.push(currentAttempt);\n if (currentAttempt === secretWord) {\n showMessage('¡Felicidades! ¡Has ganado!');\n endGame();\n } else if (attempts.length === maxAttempts) {\n showMessage(`¡Oh no! La palabra era ${secretWord}`);\n endGame();\n }\n currentAttempt = '';\n updateGameBoard();\n updateKeyboard();\n }\n}\n\nfunction updateGameBoard() {\n const rows = gameBoard.querySelectorAll('.row');\n rows.forEach((row, i) => {\n const cells = row.querySelectorAll('.cell');\n cells.forEach((cell, j) => {\n const attempt = attempts[i];\n if (attempt) {\n cell.textContent = attempt[j] || '';\n if (attempt[j] === secretWord[j]) {\n cell.classList.add('correct');\n } else if (secretWord.includes(attempt[j])) {\n cell.classList.add('present');\n } else {\n cell.classList.add('absent');\n }\n } else if (i === attempts.length) {\n cell.textContent = currentAttempt[j] || '';\n } else {\n cell.textContent = '';\n cell.classList.remove('correct', 'present', 'absent');\n }\n });\n });\n}\n\nfunction updateKeyboard() {\n const keys = keyboard.querySelectorAll('.key');\n keys.forEach(key => {\n const letter = key.textContent;\n if (secretWord.includes(letter)) {\n if (secretWord.indexOf(letter) === currentAttempt.indexOf(letter)) {\n key.classList.add('correct');\n } else {\n key.classList.add('present');\n }\n } else {\n key.classList.add('absent');\n }\n });\n}\n\nfunction showMessage(msg) {\n message.textContent = msg;\n}\n\nfunction endGame() {\n keyboard.querySelectorAll('.key').forEach(key => key.disabled = true);\n}\n\nfunction resetGame() {\n secretWord = words[Math.floor(Math.random() * words.length)];\n currentAttempt = '';\n attempts = [];\n gameBoard.innerHTML = '';\n keyboard.innerHTML = '';\n message.textContent = '';\n createGameBoard();\n createKeyboard();\n}\n\nresetButton.addEventListener('click', resetGame);\n\ncreateGameBoard();\ncreateKeyboard();\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 252, + "completion_tokens": 1872, + "total_tokens": 2124, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 252 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..7134c3f --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# vetwordle.scroll.pub +Website generated by DeepSeek from prompt: genera un wordle completamente operativo con 5 palabras de veterinaria, en español \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..3127b57 --- /dev/null +++ b/script.js @@ -0,0 +1,136 @@ +const words = ['gatos', 'perro', 'pulga', 'vacuna', 'zorro']; +let secretWord = words[Math.floor(Math.random() * words.length)]; +let currentAttempt = ''; +let attempts = []; +const maxAttempts = 6; + +const gameBoard = document.getElementById('game-board'); +const keyboard = document.getElementById('keyboard'); +const message = document.getElementById('message'); +const resetButton = document.getElementById('reset-button'); + +function createGameBoard() { + for (let i = 0; i < maxAttempts; i++) { + const row = document.createElement('div'); + row.className = 'row'; + for (let j = 0; j < 5; j++) { + const cell = document.createElement('div'); + cell.className = 'cell'; + row.appendChild(cell); + } + gameBoard.appendChild(row); + } +} + +function createKeyboard() { + const keyboardLayout = [ + ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'], + ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'], + ['Enter', 'z', 'x', 'c', 'v', 'b', 'n', 'm', '⌫'] + ]; + + keyboardLayout.forEach(row => { + const keyboardRow = document.createElement('div'); + keyboardRow.className = 'keyboard-row'; + row.forEach(key => { + const keyButton = document.createElement('button'); + keyButton.className = 'key'; + keyButton.textContent = key; + keyButton.addEventListener('click', () => handleKeyPress(key)); + keyboardRow.appendChild(keyButton); + }); + keyboard.appendChild(keyboardRow); + }); +} + +function handleKeyPress(key) { + if (key === 'Enter') { + submitAttempt(); + } else if (key === '⌫') { + currentAttempt = currentAttempt.slice(0, -1); + } else if (currentAttempt.length < 5) { + currentAttempt += key; + } + updateGameBoard(); +} + +function submitAttempt() { + if (currentAttempt.length === 5) { + attempts.push(currentAttempt); + if (currentAttempt === secretWord) { + showMessage('¡Felicidades! ¡Has ganado!'); + endGame(); + } else if (attempts.length === maxAttempts) { + showMessage(`¡Oh no! La palabra era ${secretWord}`); + endGame(); + } + currentAttempt = ''; + updateGameBoard(); + updateKeyboard(); + } +} + +function updateGameBoard() { + const rows = gameBoard.querySelectorAll('.row'); + rows.forEach((row, i) => { + const cells = row.querySelectorAll('.cell'); + cells.forEach((cell, j) => { + const attempt = attempts[i]; + if (attempt) { + cell.textContent = attempt[j] || ''; + if (attempt[j] === secretWord[j]) { + cell.classList.add('correct'); + } else if (secretWord.includes(attempt[j])) { + cell.classList.add('present'); + } else { + cell.classList.add('absent'); + } + } else if (i === attempts.length) { + cell.textContent = currentAttempt[j] || ''; + } else { + cell.textContent = ''; + cell.classList.remove('correct', 'present', 'absent'); + } + }); + }); +} + +function updateKeyboard() { + const keys = keyboard.querySelectorAll('.key'); + keys.forEach(key => { + const letter = key.textContent; + if (secretWord.includes(letter)) { + if (secretWord.indexOf(letter) === currentAttempt.indexOf(letter)) { + key.classList.add('correct'); + } else { + key.classList.add('present'); + } + } else { + key.classList.add('absent'); + } + }); +} + +function showMessage(msg) { + message.textContent = msg; +} + +function endGame() { + keyboard.querySelectorAll('.key').forEach(key => key.disabled = true); +} + +function resetGame() { + secretWord = words[Math.floor(Math.random() * words.length)]; + currentAttempt = ''; + attempts = []; + gameBoard.innerHTML = ''; + keyboard.innerHTML = ''; + message.textContent = ''; + createGameBoard(); + createKeyboard(); +} + +resetButton.addEventListener('click', resetGame); + +createGameBoard(); +createKeyboard(); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..6dc9c29 --- /dev/null +++ b/style.css @@ -0,0 +1,145 @@ +:root { + --primary: #4CAF50; + --secondary: #2196F3; + --background: #f5f5f5; + --text: #333; + --correct: #4CAF50; + --present: #FFC107; + --absent: #9E9E9E; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +body { + font-family: 'Segoe UI', sans-serif; + background-color: var(--background); + color: var(--text); + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 1rem; +} + +header { + text-align: center; + margin-bottom: 2rem; +} + +h1 { + color: var(--primary); + font-size: 2.5rem; +} + +#game-board { + display: grid; + grid-template-rows: repeat(6, 1fr); + gap: 0.5rem; + margin-bottom: 2rem; +} + +.row { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 0.5rem; +} + +.cell { + width: 60px; + height: 60px; + border: 2px solid var(--secondary); + display: flex; + align-items: center; + justify-content: center; + font-size: 2rem; + font-weight: bold; + text-transform: uppercase; + transition: all 0.3s ease; +} + +.cell.correct { + background-color: var(--correct); + border-color: var(--correct); + color: white; +} + +.cell.present { + background-color: var(--present); + border-color: var(--present); + color: white; +} + +.cell.absent { + background-color: var(--absent); + border-color: var(--absent); + color: white; +} + +#keyboard { + display: flex; + flex-direction: column; + gap: 0.5rem; + margin-bottom: 2rem; +} + +.keyboard-row { + display: flex; + justify-content: center; + gap: 0.5rem; +} + +.key { + padding: 1rem; + border: none; + background-color: var(--secondary); + color: white; + font-size: 1rem; + font-weight: bold; + cursor: pointer; + border-radius: 5px; + transition: background-color 0.3s ease; +} + +.key:hover { + background-color: #1976D2; +} + +#message { + height: 2rem; + margin-bottom: 1rem; + font-weight: bold; + text-align: center; +} + +#reset-button { + padding: 1rem 2rem; + background-color: var(--primary); + color: white; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 1rem; + transition: background-color 0.3s ease; +} + +#reset-button:hover { + background-color: #45a049; +} + +@media (max-width: 600px) { + .cell { + width: 50px; + height: 50px; + font-size: 1.5rem; + } + + .key { + padding: 0.75rem; + font-size: 0.9rem; + } +} \ No newline at end of file