Spaces:
Running
Running
Download index.html from AdamK2/anycoder-8b90effc: direct link, hf CLI and curl.
- Browser
- Download file 13.2 kB
-
https://huggingface.co/spaces/AdamK2/anycoder-8b90effc/resolve/main/index.html
- Command line
-
hf download hf://spaces/AdamK2/anycoder-8b90effc/index.html
-
curl -L -o index.html https://huggingface.co/spaces/AdamK2/anycoder-8b90effc/resolve/main/index.html
13.2 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Advent Calendar 2023</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| :root { | |
| --primary-color: #d4145a; | |
| --secondary-color: #00a8cc; | |
| --gold-color: #ffd700; | |
| --dark-green: #0a5f38; | |
| --light-green: #4ade80; | |
| --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| --door-bg: #ffffff; | |
| --door-border: #e5e7eb; | |
| --text-color: #1f2937; | |
| --shadow: 0 10px 25px rgba(0, 0, 0, 0.1); | |
| } | |
| body { | |
| font-family: 'Arial', sans-serif; | |
| background: var(--bg-gradient); | |
| min-height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| padding: 20px; | |
| color: var(--text-color); | |
| overflow-x: hidden; | |
| } | |
| .header { | |
| text-align: center; | |
| margin-bottom: 30px; | |
| position: relative; | |
| } | |
| .anycoder-link { | |
| position: absolute; | |
| top: 10px; | |
| left: 10px; | |
| color: var(--gold-color); | |
| text-decoration: none; | |
| font-weight: bold; | |
| font-size: 14px; | |
| background: rgba(0, 0, 0, 0.2); | |
| padding: 5px 10px; | |
| border-radius: 20px; | |
| transition: all 0.3s ease; | |
| } | |
| .anycoder-link:hover { | |
| background: rgba(0, 0, 0, 0.4); | |
| transform: scale(1.05); | |
| } | |
| h1 { | |
| color: white; | |
| font-size: 2.5rem; | |
| margin-bottom: 10px; | |
| text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); | |
| animation: glow 2s ease-in-out infinite alternate; | |
| } | |
| @keyframes glow { | |
| from { text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--gold-color); } | |
| to { text-shadow: 0 0 20px #fff, 0 0 30px #fff, 0 0 40px var(--gold-color); } | |
| } | |
| .subtitle { | |
| color: rgba(255, 255, 255, 0.9); | |
| font-size: 1.1rem; | |
| margin-bottom: 20px; | |
| } | |
| .calendar-container { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); | |
| gap: 15px; | |
| max-width: 900px; | |
| width: 100%; | |
| padding: 20px; | |
| background: rgba(255, 255, 255, 0.1); | |
| border-radius: 20px; | |
| backdrop-filter: blur(10px); | |
| box-shadow: var(--shadow); | |
| } | |
| .door { | |
| aspect-ratio: 1; | |
| background: var(--door-bg); | |
| border: 2px solid var(--door-border); | |
| border-radius: 10px; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| cursor: pointer; | |
| transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| position: relative; | |
| overflow: hidden; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| } | |
| .door:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); | |
| } | |
| .door-number { | |
| font-size: 1.8rem; | |
| font-weight: bold; | |
| color: var(--dark-green); | |
| z-index: 2; | |
| } | |
| .door.opened { | |
| background: linear-gradient(135deg, var(--light-green), var(--gold-color)); | |
| transform: rotateY(180deg); | |
| cursor: default; | |
| } | |
| .door.opened .door-number { | |
| display: none; | |
| } | |
| .door-content { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| padding: 10px; | |
| text-align: center; | |
| transform: rotateY(180deg); | |
| backface-visibility: hidden; | |
| opacity: 0; | |
| transition: opacity 0.3s ease; | |
| } | |
| .door.opened .door-content { | |
| opacity: 1; | |
| } | |
| .door-icon { | |
| font-size: 2rem; | |
| margin-bottom: 5px; | |
| } | |
| .door-message { | |
| font-size: 0.9rem; | |
| color: white; | |
| font-weight: 500; | |
| } | |
| .door-decoration { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| pointer-events: none; | |
| opacity: 0.3; | |
| } | |
| .door-decoration::before, | |
| .door-decoration::after { | |
| content: ''; | |
| position: absolute; | |
| background: var(--gold-color); | |
| } | |
| .door-decoration::before { | |
| top: 10px; | |
| left: 10px; | |
| right: 10px; | |
| height: 3px; | |
| } | |
| .door-decoration::after { | |
| top: 10px; | |
| left: 10px; | |
| bottom: 10px; | |
| width: 3px; | |
| } | |
| .door.opened .door-decoration { | |
| opacity: 0.6; | |
| } | |
| .controls { | |
| margin-top: 30px; | |
| display: flex; | |
| gap: 15px; | |
| flex-wrap: wrap; | |
| justify-content: center; | |
| } | |
| .btn { | |
| padding: 12px 24px; | |
| background: var(--gold-color); | |
| color: var(--dark-green); | |
| border: none; | |
| border-radius: 30px; | |
| font-weight: bold; | |
| cursor: pointer; | |
| transition: all 0.3s ease; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| } | |
| .btn:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); | |
| } | |
| .btn:active { | |
| transform: translateY(0); | |
| } | |
| .snow { | |
| position: fixed; | |
| top: -10px; | |
| color: white; | |
| font-size: 1em; | |
| opacity: 0.8; | |
| z-index: 1; | |
| animation: fall linear infinite; | |
| } | |
| @keyframes fall { | |
| to { | |
| transform: translateY(100vh) rotate(360deg); | |
| } | |
| } | |
| @media (max-width: 768px) { | |
| h1 { | |
| font-size: 2rem; | |
| } | |
| .door { | |
| min-width: 60px; | |
| } | |
| .door-number { | |
| font-size: 1.4rem; | |
| } | |
| } | |
| @media (max-width: 480px) { | |
| .calendar-container { | |
| gap: 10px; | |
| } | |
| .door { | |
| min-width: 50px; | |
| } | |
| .door-number { | |
| font-size: 1.2rem; | |
| } | |
| } | |
| .confetti { | |
| position: fixed; | |
| width: 10px; | |
| height: 10px; | |
| background: var(--gold-color); | |
| position: absolute; | |
| animation: confetti-fall 3s linear forwards; | |
| } | |
| @keyframes confetti-fall { | |
| 0% { | |
| transform: translateY(-100vh) rotate(0deg); | |
| opacity: 1; | |
| } | |
| 100% { | |
| transform: translateY(100vh) rotate(720deg); | |
| opacity: 0; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="header"> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link" target="_blank">Built with anycoder</a> | |
| <h1>π Advent Calendar 2023 π</h1> | |
| <p class="subtitle">Click on each door to reveal the day's surprise!</p> | |
| </div> | |
| <div class="calendar-container" id="calendar"></div> | |
| <div class="controls"> | |
| <button class="btn" onclick="openAllDoors()">Open All Doors</button> | |
| <button class="btn" onclick="closeAllDoors()">Close All Doors</button> | |
| <button class="btn" onclick="resetCalendar()">Reset Calendar</button> | |
| </div> | |
| <script> | |
| const calendarContainer = document.getElementById('calendar'); | |
| const today = new Date(); | |
| const currentDay = today.getDate(); | |
| const messages = [ | |
| "Merry Christmas!", | |
| "Joy to the World!", | |
| "Ho Ho Ho!", | |
| "Peace on Earth", | |
| "Love & Happiness", | |
| "Winter Wonderland", | |
| "Snowflakes Falling", | |
| "Christmas Magic", | |
| "Family Time", | |
| "Hot Chocolate", | |
| "Christmas Lights", | |
| "Decorations Up!", | |
| "Santa's Coming", | |
| "Gift Wrapping", | |
| "Christmas Carols", | |
| "Christmas Cookies", | |
| "Ice Skating", | |
| "Sleigh Rides", | |
| "Christmas Movies", | |
| "Christmas Tree", | |
| "Christmas Presents", | |
| "Christmas Eve", | |
| "Christmas Morning", | |
| "Christmas Dinner", | |
| "Christmas Cheer", | |
| "Happy Holidays!" | |
| ]; | |
| // Create doors | |
| for (let i = 1; i <= 24; i++) { | |
| const door = document.createElement('div'); | |
| door.className = 'door'; | |
| door.dataset.day = i; | |
| const doorNumber = document.createElement('div'); | |
| doorNumber.className = 'door-number'; | |
| doorNumber.textContent = i; | |
| const doorContent = document.createElement('div'); | |
| doorContent.className = 'door-content'; | |
| const doorIcon = document.createElement('div'); | |
| doorIcon.className = 'door-icon'; | |
| doorIcon.textContent = i % 2 === 0 ? 'π' : 'π'; | |
| const doorMessage = document.createElement('div'); | |
| doorMessage.className = 'door-message'; | |
| doorMessage.textContent = messages[i - 1]; | |
| const doorDecoration = document.createElement('div'); | |
| doorDecoration.className = 'door-decoration'; | |
| doorContent.appendChild(doorIcon); | |
| doorContent.appendChild(doorMessage); | |
| door.appendChild(doorNumber); | |
| door.appendChild(doorContent); | |
| door.appendChild(doorDecoration); | |
| door.addEventListener('click', () => openDoor(door)); | |
| // Auto-open doors for current day and previous days | |
| if (i <= currentDay) { | |
| door.classList.add('opened'); | |
| } | |
| calendarContainer.appendChild(door); | |
| } | |
| function openDoor(door) { | |
| if (!door.classList.contains('opened')) { | |
| door.classList.add('opened'); | |
| createConfetti(); | |
| } | |
| } | |
| function openAllDoors() { | |
| document.querySelectorAll('.door').forEach(door => { | |
| if (!door.classList.contains('opened')) { | |
| door.classList.add('opened'); | |
| createConfetti(); | |
| } | |
| }); | |
| } | |
| function closeAllDoors() { | |
| document.querySelectorAll('.door').forEach(door => { | |
| door.classList.remove('opened'); | |
| }); | |
| } | |
| function resetCalendar() { | |
| closeAllDoors(); | |
| // Auto-open doors for current day | |
| document.querySelectorAll('.door').forEach(door => { | |
| const day = parseInt(door.dataset.day); | |
| if (day <= currentDay) { | |
| door.classList.add('opened'); | |
| } | |
| }); | |
| } | |
| function createConfetti() { | |
| for (let i = 0; i < 20; i++) { | |
| setTimeout(() => { | |
| const confetti = document.createElement('div'); | |
| confetti.className = 'confetti'; | |
| confetti.style.left = Math.random() * 100 + 'vw'; | |
| confetti.style.backgroundColor = ['#ff6b6b', '#4ecdc4', '#45b7d1', '#f9ca24', '#f0932b', '#eb4d4b', '#6ab04c', '#c44569'][Math.floor(Math.random() * 8)]; | |
| confetti.style.animationDuration = (Math.random() * 2 + 2) + 's'; | |
| document.body.appendChild(confetti); | |
| setTimeout(() => { | |
| confetti.remove(); | |
| }, 3000); | |
| }, i * 50); | |
| } | |
| } | |
| // Create snow effect | |
| function createSnow() { | |
| const snow = document.createElement('div'); | |
| snow.className = 'snow'; | |
| snow.textContent = 'β'; | |
| snow.style.left = Math.random() * 100 + 'vw'; | |
| snow.style.animationDuration = Math.random() * 3 + 2 + 's'; | |
| document.body.appendChild(snow); | |
| setTimeout(() => { | |
| snow.remove(); | |
| }, 5000); | |
| } | |
| // Create snow at intervals | |
| setInterval(createSnow, 300); | |
| // Add some initial confetti for excitement | |
| setTimeout(() => { | |
| createConfetti(); | |
| }, 1000); | |
| </script> | |
| </body> | |
| </html> |