Spaces:
Running

weather / index.html
guiWWWW's picture
Add 3 files
052a76b verified
Raw History Blame Contribute Delete
26.1 kB
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.weather-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.chart-container {
height: 250px;
}
.menu-item:hover {
background-color: rgba(59, 130, 246, 0.1);
}
.active-menu {
border-left: 4px solid #3b82f6;
background-color: rgba(59, 130, 246, 0.1);
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="hidden md:flex md:flex-shrink-0">
<div class="flex flex-col w-64 bg-white border-r border-gray-200">
<div class="flex items-center justify-center h-16 px-4 bg-blue-600">
<span class="text-white text-xl font-semibold">Weather Dashboard</span>
</div>
<div class="flex flex-col flex-grow px-4 py-4 overflow-y-auto">
<!-- Menu -->
<div class="space-y-1">
<div class="px-2 pt-2 pb-3 space-y-1">
<span class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Menu</span>
</div>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item active-menu">
<i class="fas fa-tachometer-alt mr-3 text-blue-500"></i>
Dashboard
</a>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item">
<i class="fas fa-sync-alt mr-3 text-gray-500"></i>
Atualizar dados
</a>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item">
<i class="fas fa-history mr-3 text-gray-500"></i>
Histórico
</a>
</div>
<div class="mt-8">
<div class="px-2 pt-2 pb-3 space-y-1">
<span class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Configurações</span>
</div>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item">
<i class="fas fa-cog mr-3 text-gray-500"></i>
Preferências
</a>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item">
<i class="fas fa-map-marker-alt mr-3 text-gray-500"></i>
Localização
</a>
</div>
<div class="mt-8">
<div class="px-2 pt-2 pb-3 space-y-1">
<span class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Ajuda</span>
</div>
<a href="#" class="flex items-center px-2 py-2 text-sm font-medium rounded-md menu-item">
<i class="fas fa-info-circle mr-3 text-gray-500"></i>
Sobre
</a>
</div>
</div>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<img class="w-8 h-8 rounded-full" src="https://ui-avatars.com/api/?name=Admin" alt="User">
<div class="ml-3">
<p class="text-sm font-medium text-gray-700">Administrador</p>
<p class="text-xs font-medium text-gray-500">admin@weather.com</p>
</div>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex flex-col flex-1 overflow-hidden">
<!-- Top navigation -->
<div class="flex items-center justify-between h-16 px-4 bg-white border-b border-gray-200">
<div class="flex items-center">
<button class="md:hidden text-gray-500 focus:outline-none">
<i class="fas fa-bars"></i>
</button>
<h1 class="ml-4 text-xl font-semibold text-gray-800">Dashboard</h1>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Buscar localização..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="absolute left-3 top-3 fas fa-search text-gray-400"></i>
</div>
<button class="p-2 text-gray-500 rounded-full hover:bg-gray-100">
<i class="fas fa-bell"></i>
</button>
</div>
</div>
<!-- Main content area -->
<div class="flex-1 overflow-auto p-6 bg-gray-50">
<!-- Current weather -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div class="col-span-1 md:col-span-2 bg-white rounded-xl shadow p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold">Condições Atuais</h2>
<div class="text-sm text-gray-500">
<span class="mr-2">Última atualização: 10:45 AM</span>
<button class="text-blue-500 hover:text-blue-700">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
<div class="flex flex-col md:flex-row items-center">
<div class="flex-shrink-0 mb-4 md:mb-0 md:mr-6">
<div class="text-8xl text-blue-500">
<i class="fas fa-cloud-sun"></i>
</div>
<div class="text-center text-gray-500 mt-2">Parcialmente nublado</div>
</div>
<div class="flex-grow">
<div class="grid grid-cols-2 gap-4">
<div>
<div class="text-5xl font-bold text-gray-800">24°C</div>
<div class="text-gray-500">Sensação térmica: 26°C</div>
</div>
<div class="space-y-2">
<div class="flex items-center">
<i class="fas fa-wind mr-2 text-gray-500"></i>
<span class="text-gray-700">Vento: 12 km/h</span>
</div>
<div class="flex items-center">
<i class="fas fa-tint mr-2 text-gray-500"></i>
<span class="text-gray-700">Umidade: 65%</span>
</div>
<div class="flex items-center">
<i class="fas fa-cloud-rain mr-2 text-gray-500"></i>
<span class="text-gray-700">Precipitação: 10%</span>
</div>
</div>
</div>
<div class="mt-6 pt-4 border-t border-gray-200">
<h3 class="text-lg font-semibold mb-2">Previsão para hoje</h3>
<div class="flex overflow-x-auto space-x-4 pb-2">
<div class="flex flex-col items-center px-4 py-2 bg-blue-50 rounded-lg">
<span class="text-sm text-gray-500">Agora</span>
<i class="fas fa-cloud-sun text-blue-500 my-1"></i>
<span class="font-medium">24°C</span>
</div>
<div class="flex flex-col items-center px-4 py-2">
<span class="text-sm text-gray-500">12h</span>
<i class="fas fa-sun text-yellow-500 my-1"></i>
<span class="font-medium">27°C</span>
</div>
<div class="flex flex-col items-center px-4 py-2">
<span class="text-sm text-gray-500">15h</span>
<i class="fas fa-sun text-yellow-500 my-1"></i>
<span class="font-medium">29°C</span>
</div>
<div class="flex flex-col items-center px-4 py-2">
<span class="text-sm text-gray-500">18h</span>
<i class="fas fa-cloud text-gray-400 my-1"></i>
<span class="font-medium">26°C</span>
</div>
<div class="flex flex-col items-center px-4 py-2">
<span class="text-sm text-gray-500">21h</span>
<i class="fas fa-cloud-moon text-gray-400 my-1"></i>
<span class="font-medium">22°C</span>
</div>
<div class="flex flex-col items-center px-4 py-2">
<span class="text-sm text-gray-500">00h</span>
<i class="fas fa-moon text-gray-400 my-1"></i>
<span class="font-medium">20°C</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow p-6">
<h2 class="text-xl font-semibold mb-4">Localização Atual</h2>
<div class="flex items-center mb-4">
<i class="fas fa-map-marker-alt text-red-500 mr-2"></i>
<span class="font-medium">São Paulo, SP - Brasil</span>
</div>
<div class="h-48 bg-gray-100 rounded-lg mb-4 flex items-center justify-center">
<i class="fas fa-map text-gray-400 text-4xl"></i>
</div>
<div class="space-y-3">
<div class="flex justify-between">
<span class="text-gray-600">Latitude:</span>
<span class="font-medium">-23.5505</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Longitude:</span>
<span class="font-medium">-46.6333</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Altitude:</span>
<span class="font-medium">760m</span>
</div>
<div class="flex justify-between">
<span class="text-gray-600">Fuso horário:</span>
<span class="font-medium">GMT-3</span>
</div>
</div>
<button class="mt-4 w-full py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
<i class="fas fa-edit mr-2"></i> Alterar Localização
</button>
</div>
</div>
<!-- Weather cards -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-xl shadow p-6 weather-card transition duration-300">
<div class="flex items-center justify-between mb-3">
<h3 class="font-medium text-gray-700">Temperatura Máxima</h3>
<i class="fas fa-temperature-high text-red-500"></i>
</div>
<div class="text-3xl font-bold text-gray-800">29°C</div>
<div class="text-sm text-gray-500 mt-1">às 15:00</div>
</div>
<div class="bg-white rounded-xl shadow p-6 weather-card transition duration-300">
<div class="flex items-center justify-between mb-3">
<h3 class="font-medium text-gray-700">Temperatura Mínima</h3>
<i class="fas fa-temperature-low text-blue-500"></i>
</div>
<div class="text-3xl font-bold text-gray-800">18°C</div>
<div class="text-sm text-gray-500 mt-1">às 06:00</div>
</div>
<div class="bg-white rounded-xl shadow p-6 weather-card transition duration-300">
<div class="flex items-center justify-between mb-3">
<h3 class="font-medium text-gray-700">Índice UV</h3>
<i class="fas fa-sun text-yellow-500"></i>
</div>
<div class="text-3xl font-bold text-gray-800">7</div>
<div class="text-sm text-gray-500 mt-1">Alto</div>
</div>
<div class="bg-white rounded-xl shadow p-6 weather-card transition duration-300">
<div class="flex items-center justify-between mb-3">
<h3 class="font-medium text-gray-700">Pressão Atmosférica</h3>
<i class="fas fa-tachometer-alt text-purple-500"></i>
</div>
<div class="text-3xl font-bold text-gray-800">1012 hPa</div>
<div class="text-sm text-gray-500 mt-1">Estável</div>
</div>
</div>
<!-- Charts -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<div class="bg-white rounded-xl shadow p-6">
<h2 class="text-xl font-semibold mb-4">Temperatura (24h)</h2>
<div class="chart-container">
<canvas id="temperatureChart"></canvas>
</div>
</div>
<div class="bg-white rounded-xl shadow p-6">
<h2 class="text-xl font-semibold mb-4">Precipitação (24h)</h2>
<div class="chart-container">
<canvas id="precipitationChart"></canvas>
</div>
</div>
</div>
<!-- Weekly forecast -->
<div class="bg-white rounded-xl shadow p-6">
<h2 class="text-xl font-semibold mb-4">Previsão para 7 dias</h2>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Dia</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Condição</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Máx</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Mín</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Precipitação</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Vento</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">Hoje</td>
<td class="px-6 py-4 whitespace-nowrap">
<i class="fas fa-cloud-sun text-blue-500"></i>
<span class="ml-2">Parc. nublado</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-red-500 font-medium">29°C</td>
<td class="px-6 py-4 whitespace-nowrap text-blue-500 font-medium">18°C</td>
<td class="px-6 py-4 whitespace-nowrap">10%</td>
<td class="px-6 py-4 whitespace-nowrap">12 km/h</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">Amanhã</td>
<td class="px-6 py-4 whitespace-nowrap">
<i class="fas fa-sun text-yellow-500"></i>
<span class="ml-2">Ensolarado</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-red-500 font-medium">31°C</td>
<td class="px-6 py-4 whitespace-nowrap text-blue-500 font-medium">19°C</td>
<td class="px-6 py-4 whitespace-nowrap">0%</td>
<td class="px-6 py-4 whitespace-nowrap">10 km/h</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">Quarta</td>
<td class="px-6 py-4 whitespace-nowrap">
<i class="fas fa-cloud text-gray-400"></i>
<span class="ml-2">Nublado</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-red-500 font-medium">26°C</td>
<td class="px-6 py-4 whitespace-nowrap text-blue-500 font-medium">17°C</td>
<td class="px-6 py-4 whitespace-nowrap">30%</td>
<td class="px-6 py-4 whitespace-nowrap">15 km/h</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">Quinta</td>
<td class="px-6 py-4 whitespace-nowrap">
<i class="fas fa-cloud-rain text-blue-400"></i>
<span class="ml-2">Chuva</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-red-500 font-medium">22°C</td>
<td class="px-6 py-4 whitespace-nowrap text-blue-500 font-medium">16°C</td>
<td class="px-6 py-4 whitespace-nowrap">80%</td>
<td class="px-6 py-4 whitespace-nowrap">20 km/h</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap font-medium">Sexta</td>
<td class="px-6 py-4 whitespace-nowrap">
<i class="fas fa-cloud-sun text-blue-500"></i>
<span class="ml-2">Parc. nublado</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-red-500 font-medium">25°C</td>
<td class="px-6 py-4 whitespace-nowrap text-blue-500 font-medium">15°C</td>
<td class="px-6 py-4 whitespace-nowrap">20%</td>
<td class="px-6 py-4 whitespace-nowrap">12 km/h</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Temperature Chart
const tempCtx = document.getElementById('temperatureChart').getContext('2d');
const tempChart = new Chart(tempCtx, {
type: 'line',
data: {
labels: ['00h', '03h', '06h', '09h', '12h', '15h', '18h', '21h', '00h'],
datasets: [{
label: 'Temperatura (°C)',
data: [18, 17, 18, 22, 26, 29, 26, 22, 20],
borderColor: 'rgb(239, 68, 68)',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
tension: 0.4,
fill: true
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: false
}
}
}
});
// Precipitation Chart
const precipCtx = document.getElementById('precipitationChart').getContext('2d');
const precipChart = new Chart(precipCtx, {
type: 'bar',
data: {
labels: ['00h', '03h', '06h', '09h', '12h', '15h', '18h', '21h', '00h'],
datasets: [{
label: 'Precipitação (%)',
data: [0, 5, 10, 5, 5, 10, 15, 5, 0],
backgroundColor: 'rgba(59, 130, 246, 0.7)'
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true,
max: 100
}
}
}
});
// Mobile menu toggle
document.querySelector('.fa-bars').addEventListener('click', function() {
document.querySelector('.md\\:hidden').classList.toggle('hidden');
});
// Menu item active state
const menuItems = document.querySelectorAll('.menu-item');
menuItems.forEach(item => {
item.addEventListener('click', function() {
menuItems.forEach(i => i.classList.remove('active-menu'));
this.classList.add('active-menu');
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=guiWWWW/weather" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>