/
dashytka
/
WeatherDashboard
Обзор
Документация
Войти
/
dashytka
/
WeatherDashboard
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
html
275 строк
8 KB
dashytka
create html
25 окт 2025, 14:10
25 окт 2025, 14:10
02782c6
Код
Авторство
О чём код?
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Weather Dashboard</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); min-height: 100vh; padding: 20px; } .container { max-width: 1200px; margin: 0 auto; } .header { text-align: center; color: white; margin-bottom: 30px; } .header h1 { font-size: 2.5rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); } .search-box { display: flex; justify-content: center; margin-bottom: 30px; } .search-input { padding: 12px 20px; font-size: 1rem; border: none; border-radius: 25px 0 0 25px; width: 300px; outline: none; } .search-btn { padding: 12px 25px; background: #00b894; color: white; border: none; border-radius: 0 25px 25px 0; cursor: pointer; font-size: 1rem; transition: background 0.3s; } .search-btn:hover { background: #00a085; } .weather-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; } .weather-card { background: white; border-radius: 15px; padding: 25px; text-align: center; box-shadow: 0 8px 25px rgba(0,0,0,0.1); transition: transform 0.3s; } .weather-card:hover { transform: translateY(-5px); } .weather-card h3 { color: #2d3436; margin-bottom: 15px; font-size: 1.2rem; } .temperature { font-size: 2.5rem; font-weight: bold; color: #0984e3; margin: 15px 0; } .weather-icon { font-size: 3rem; margin: 15px 0; } .details { display: flex; justify-content: space-around; margin-top: 20px; } .detail-item { text-align: center; } .detail-value { font-weight: bold; color: #2d3436; } .detail-label { font-size: 0.8rem; color: #636e72; } .forecast { background: white; border-radius: 15px; padding: 25px; box-shadow: 0 8px 25px rgba(0,0,0,0.1); } .forecast h2 { color: #2d3436; margin-bottom: 20px; text-align: center; } .forecast-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; } .forecast-item { text-align: center; padding: 15px; border-radius: 10px; background: #f8f9fa; } @media (max-width: 768px) { .search-input { width: 200px; } .header h1 { font-size: 2rem; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>🌤️ Weather Dashboard</h1> <p>Real-time weather information and forecasts</p> </div> <div class="search-box"> <input type="text" class="search-input" placeholder="Enter city name..."> <button class="search-btn">Search</button> </div> <div class="weather-cards"> <div class="weather-card"> <h3>Current Weather</h3> <div class="weather-icon">☀️</div> <div class="temperature">24°C</div> <p>Sunny</p> <div class="details"> <div class="detail-item"> <div class="detail-value">65%</div> <div class="detail-label">Humidity</div> </div> <div class="detail-item"> <div class="detail-value">15 km/h</div> <div class="detail-label">Wind</div> </div> </div> </div> <div class="weather-card"> <h3>Feels Like</h3> <div class="weather-icon">🌡️</div> <div class="temperature">26°C</div> <p>Warm</p> <div class="details"> <div class="detail-item"> <div class="detail-value">1013 hPa</div> <div class="detail-label">Pressure</div> </div> <div class="detail-item"> <div class="detail-value">10 km</div> <div class="detail-label">Visibility</div> </div> </div> </div> </div> <div class="forecast"> <h2>5-Day Forecast</h2> <div class="forecast-items"> <div class="forecast-item"> <div>Mon</div> <div class="weather-icon">🌤️</div> <div class="temperature">23°</div> <div>Partly Cloudy</div> </div> <div class="forecast-item"> <div>Tue</div> <div class="weather-icon">🌧️</div> <div class="temperature">19°</div> <div>Light Rain</div> </div> <div class="forecast-item"> <div>Wed</div> <div class="weather-icon">⛅</div> <div class="temperature">22°</div> <div>Cloudy</div> </div> <div class="forecast-item"> <div>Thu</div> <div class="weather-icon">☀️</div> <div class="temperature">25°</div> <div>Sunny</div> </div> <div class="forecast-item"> <div>Fri</div> <div class="weather-icon">🌦️</div> <div class="temperature">21°</div> <div>Showers</div> </div> </div> </div> </div> <script> // Simple weather dashboard functionality document.querySelector('.search-btn').addEventListener('click', function() { const city = document.querySelector('.search-input').value; if (city) { alert(`Searching for weather in: ${city}`); // Here you would typically fetch data from a weather API } }); document.querySelector('.search-input').addEventListener('keypress', function(e) { if (e.key === 'Enter') { document.querySelector('.search-btn').click(); } }); // Update current time function updateTime() { const now = new Date(); document.querySelector('.header p').textContent = `Real-time weather information • ${now.toLocaleDateString()} ${now.toLocaleTimeString()}`; } updateTime(); setInterval(updateTime, 60000); </script> </body> </html>