Recrie uma versão online do jogo "Dungeons & Dragons Starter Set: Welcome to the Hellfire Club" . lançado oficialmente no segundo semestre de 2025.
e01b3f1 verified Download script.js from DeleanMafra/hellfire-dice-demons-online: direct link, hf CLI and curl.
- Browser
- Download file 1.45 kB
-
https://huggingface.co/spaces/DeleanMafra/hellfire-dice-demons-online/resolve/main/script.js
- Command line
-
hf download hf://spaces/DeleanMafra/hellfire-dice-demons-online/script.js
-
curl -L -o script.js https://huggingface.co/spaces/DeleanMafra/hellfire-dice-demons-online/resolve/main/script.js
1.45 kB
| document.addEventListener('DOMContentLoaded', () => { | |
| // Dice roller functionality | |
| const diceTypes = [4, 6, 8, 10, 12, 20, 100]; | |
| diceTypes.forEach(dice => { | |
| document.getElementById(`d${dice}`)?.addEventListener('click', () => { | |
| const result = Math.floor(Math.random() * dice) + 1; | |
| const resultElement = document.getElementById('dice-result'); | |
| if(resultElement) { | |
| resultElement.textContent = result; | |
| resultElement.classList.add('dice-roll'); | |
| setTimeout(() => { | |
| resultElement.classList.remove('dice-roll'); | |
| }, 500); | |
| } | |
| }); | |
| }); | |
| // Character sheet tabs | |
| const tabButtons = document.querySelectorAll('.sheet-tab'); | |
| tabButtons.forEach(button => { | |
| button.addEventListener('click', () => { | |
| const tabName = button.getAttribute('data-tab'); | |
| document.querySelectorAll('.sheet-content').forEach(content => { | |
| content.classList.add('hidden'); | |
| }); | |
| document.getElementById(tabName)?.classList.remove('hidden'); | |
| tabButtons.forEach(btn => { | |
| btn.classList.remove('bg-red-600'); | |
| btn.classList.add('bg-gray-700'); | |
| }); | |
| button.classList.remove('bg-gray-700'); | |
| button.classList.add('bg-red-600'); | |
| }); | |
| }); | |
| }); |