/
bat802
/
BroMoon
Обзор
Документация
Войти
/
bat802
/
BroMoon
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
index.html
137 строк
4 KB
bat802
Create: index.html
06 июн 2026, 20:10
Верифицирован
06 июн 2026, 20:10
fdbe2a6
Код
Авторство
О чём код?
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Лунный календарь</title> <style> body { font-family: Arial, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; background: #f0f0f0; } .container { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } h1 { text-align: center; color: #333; } .day-card { background: #f8f9fa; padding: 20px; margin: 20px 0; border-radius: 8px; border-left: 4px solid #007bff; } .day-card.today { border-left-color: #28a745; } .day-card.tomorrow { border-left-color: #ffc107; } .day-title { font-size: 1.3em; font-weight: bold; margin-bottom: 10px; } .content { font-size: 1.1em; color: #555; } .loading { text-align: center; padding: 20px; color: #999; } button { background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-size: 16px; width: 100%; margin-top: 10px; } button:hover { background: #0056b3; } .info { margin-top: 20px; padding: 10px; background: #e9ecef; border-radius: 5px; font-size: 12px; text-align: center; } </style> </head> <body> <div class="container"> <h1>🌙 Лунный календарь</h1> <div class="day-card today"> <div class="day-title">📅 Сегодня (6 июня 2026)</div> <div class="content" id="today">Загрузка...</div> </div> <div class="day-card tomorrow"> <div class="day-title">📅 Завтра (7 июня 2026)</div> <div class="content" id="tomorrow">Загрузка...</div> </div> <button onclick="loadData()">🔄 Обновить</button> <div class="info"> Данные предоставлены сайтом mirkosmosa.ru<br> Обновляется автоматически каждый час </div> </div> <script> const WORKER_URL = 'https://lunar-parser.batyr1580.workers.dev'; async function loadData() { const todayEl = document.getElementById('today'); const tomorrowEl = document.getElementById('tomorrow'); todayEl.innerHTML = '⏳ Загрузка...'; tomorrowEl.innerHTML = '⏳ Загрузка...'; try { const response = await fetch(WORKER_URL); const data = await response.json(); if (data.success) { todayEl.innerHTML = data.today; tomorrowEl.innerHTML = data.tomorrow; // Если завтрашний день не найден, показываем сообщение if (data.tomorrow === 'Не найдено') { tomorrowEl.innerHTML = '⚠️ Данные о завтрашнем дне временно недоступны<br><small>Пожалуйста, проверьте позже</small>'; } } else { throw new Error(data.error); } } catch (error) { todayEl.innerHTML = '❌ Ошибка загрузки данных'; tomorrowEl.innerHTML = '❌ Попробуйте обновить страницу позже'; console.error('Ошибка:', error); } } // Загружаем данные при открытии страницы loadData(); // Обновляем каждый час setInterval(loadData, 60 * 60 * 1000); </script> </body> </html>