Spaces:
Running

maxfama / index.html
Leosozza's picture
Add 3 files
0b6bfd4 verified
Raw History Blame Contribute Delete
28.3 kB
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TrackTeam - Monitoramento de Equipes Externas</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">
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script>
<style>
.map-container {
height: 400px;
width: 100%;
border-radius: 0.5rem;
}
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .sidebar-text {
display: none;
}
.sidebar.collapsed .logo-text {
display: none;
}
.sidebar.collapsed .nav-item {
justify-content: center;
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
.online-dot {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
margin-right: 5px;
}
.offline {
background-color: #ef4444;
}
.online {
background-color: #10b981;
}
.busy {
background-color: #f59e0b;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-blue-800 text-white w-64 flex flex-col">
<div class="p-4 flex items-center">
<i class="fas fa-users-cog text-2xl mr-3"></i>
<span class="logo-text text-xl font-bold">TrackTeam</span>
</div>
<nav class="flex-1 mt-6">
<div class="nav-item px-6 py-3 flex items-center hover:bg-blue-700 cursor-pointer active-nav-item">
<i class="fas fa-map-marked-alt mr-3"></i>
<span class="sidebar-text">Mapa em Tempo Real</span>
</div>
<div class="nav-item px-6 py-3 flex items-center hover:bg-blue-700 cursor-pointer">
<i class="fas fa-users mr-3"></i>
<span class="sidebar-text">Gerenciar Equipe</span>
</div>
<div class="nav-item px-6 py-3 flex items-center hover:bg-blue-700 cursor-pointer">
<i class="fas fa-map-pin mr-3"></i>
<span class="sidebar-text">Locais de Trabalho</span>
</div>
<div class="nav-item px-6 py-3 flex items-center hover:bg-blue-700 cursor-pointer">
<i class="fas fa-chart-line mr-3"></i>
<span class="sidebar-text">Relatórios</span>
</div>
<div class="nav-item px-6 py-3 flex items-center hover:bg-blue-700 cursor-pointer">
<i class="fas fa-cog mr-3"></i>
<span class="sidebar-text">Configurações</span>
</div>
</nav>
<div class="p-4 border-t border-blue-700">
<div class="flex items-center">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full mr-2">
<div>
<span class="sidebar-text text-sm font-medium">Admin</span>
<span class="sidebar-text block text-xs text-blue-200">admin@trackteam.com</span>
</div>
</div>
</div>
<button id="toggleSidebar" class="p-2 text-blue-200 hover:text-white">
<i class="fas fa-chevron-left"></i>
</button>
</div>
<!-- Main Content -->
<div class="flex-1 overflow-auto">
<!-- Header -->
<header class="bg-white shadow-sm">
<div class="flex justify-between items-center px-6 py-4">
<h1 class="text-2xl font-semibold text-gray-800">Mapa em Tempo Real</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Buscar..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<div class="relative">
<i class="fas fa-bell text-xl text-gray-600 cursor-pointer"></i>
<span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">3</span>
</div>
</div>
</div>
</header>
<!-- Dashboard Content -->
<main class="p-6">
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Equipe Ativa</p>
<h3 class="text-2xl font-bold">24</h3>
</div>
<div class="bg-blue-100 p-3 rounded-full">
<i class="fas fa-users text-blue-600"></i>
</div>
</div>
<div class="mt-2">
<span class="text-green-500 text-sm font-medium"><i class="fas fa-arrow-up"></i> 12%</span>
<span class="text-gray-500 text-sm ml-2">vs ontem</span>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Em Deslocamento</p>
<h3 class="text-2xl font-bold">15</h3>
</div>
<div class="bg-green-100 p-3 rounded-full">
<i class="fas fa-walking text-green-600"></i>
</div>
</div>
<div class="mt-2">
<span class="text-red-500 text-sm font-medium"><i class="fas fa-arrow-down"></i> 5%</span>
<span class="text-gray-500 text-sm ml-2">vs ontem</span>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Em Atendimento</p>
<h3 class="text-2xl font-bold">8</h3>
</div>
<div class="bg-purple-100 p-3 rounded-full">
<i class="fas fa-briefcase text-purple-600"></i>
</div>
</div>
<div class="mt-2">
<span class="text-green-500 text-sm font-medium"><i class="fas fa-arrow-up"></i> 20%</span>
<span class="text-gray-500 text-sm ml-2">vs ontem</span>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500">Locais Cadastrados</p>
<h3 class="text-2xl font-bold">42</h3>
</div>
<div class="bg-yellow-100 p-3 rounded-full">
<i class="fas fa-map-marked-alt text-yellow-600"></i>
</div>
</div>
<div class="mt-2">
<span class="text-green-500 text-sm font-medium"><i class="fas fa-arrow-up"></i> 8%</span>
<span class="text-gray-500 text-sm ml-2">vs ontem</span>
</div>
</div>
</div>
<!-- Map and Team List -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Map Section -->
<div class="lg:col-span-2 bg-white rounded-lg shadow p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold text-gray-800">Localização em Tempo Real</h2>
<div class="flex space-x-2">
<button class="px-3 py-1 bg-blue-100 text-blue-600 rounded-md text-sm">Hoje</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Semana</button>
<button class="px-3 py-1 bg-gray-100 text-gray-600 rounded-md text-sm">Mês</button>
</div>
</div>
<div id="map" class="map-container"></div>
<div class="mt-4 flex justify-between items-center">
<div class="flex space-x-2">
<div class="flex items-center">
<span class="online-dot online"></span>
<span class="text-sm">Online</span>
</div>
<div class="flex items-center">
<span class="online-dot busy"></span>
<span class="text-sm">Ocupado</span>
</div>
<div class="flex items-center">
<span class="online-dot offline"></span>
<span class="text-sm">Offline</span>
</div>
</div>
<button id="refreshMap" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">
<i class="fas fa-sync-alt mr-2"></i>Atualizar Mapa
</button>
</div>
</div>
<!-- Team List Section -->
<div class="bg-white rounded-lg shadow p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold text-gray-800">Equipe Ativa</h2>
<button id="addTeamMember" class="px-3 py-1 bg-green-100 text-green-600 rounded-md text-sm">
<i class="fas fa-plus mr-1"></i>Adicionar
</button>
</div>
<div class="space-y-4 max-h-[500px] overflow-y-auto">
<!-- Team Member 1 -->
<div class="flex items-center p-3 border rounded-lg hover:bg-gray-50 cursor-pointer">
<img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Team Member" class="w-10 h-10 rounded-full mr-3">
<div class="flex-1">
<h4 class="font-medium">João Silva</h4>
<p class="text-sm text-gray-500">Técnico de Campo</p>
</div>
<div class="flex items-center">
<span class="online-dot online"></span>
<span class="text-xs text-gray-500">2 min atrás</span>
</div>
</div>
<!-- Team Member 2 -->
<div class="flex items-center p-3 border rounded-lg hover:bg-gray-50 cursor-pointer">
<img src="https://randomuser.me/api/portraits/women/2.jpg" alt="Team Member" class="w-10 h-10 rounded-full mr-3">
<div class="flex-1">
<h4 class="font-medium">Maria Oliveira</h4>
<p class="text-sm text-gray-500">Supervisora</p>
</div>
<div class="flex items-center">
<span class="online-dot busy"></span>
<span class="text-xs text-gray-500">5 min atrás</span>
</div>
</div>
<!-- Team Member 3 -->
<div class="flex items-center p-3 border rounded-lg hover:bg-gray-50 cursor-pointer">
<img src="https://randomuser.me/api/portraits/men/3.jpg" alt="Team Member" class="w-10 h-10 rounded-full mr-3">
<div class="flex-1">
<h4 class="font-medium">Carlos Souza</h4>
<p class="text-sm text-gray-500">Instalador</p>
</div>
<div class="flex items-center">
<span class="online-dot online"></span>
<span class="text-xs text-gray-500">1 min atrás</span>
</div>
</div>
<!-- Team Member 4 -->
<div class="flex items-center p-3 border rounded-lg hover:bg-gray-50 cursor-pointer">
<img src="https://randomuser.me/api/portraits/women/4.jpg" alt="Team Member" class="w-10 h-10 rounded-full mr-3">
<div class="flex-1">
<h4 class="font-medium">Ana Costa</h4>
<p class="text-sm text-gray-500">Técnica</p>
</div>
<div class="flex items-center">
<span class="online-dot offline"></span>
<span class="text-xs text-gray-500">1h atrás</span>
</div>
</div>
<!-- Team Member 5 -->
<div class="flex items-center p-3 border rounded-lg hover:bg-gray-50 cursor-pointer">
<img src="https://randomuser.me/api/portraits/men/5.jpg" alt="Team Member" class="w-10 h-10 rounded-full mr-3">
<div class="flex-1">
<h4 class="font-medium">Pedro Alves</h4>
<p class="text-sm text-gray-500">Instalador</p>
</div>
<div class="flex items-center">
<span class="online-dot online"></span>
<span class="text-xs text-gray-500">3 min atrás</span>
</div>
</div>
</div>
</div>
</div>
<!-- Recent Activities -->
<div class="mt-6 bg-white rounded-lg shadow p-6">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Atividades Recentes</h2>
<div class="space-y-4">
<div class="flex items-start">
<div class="bg-blue-100 p-2 rounded-full mr-3">
<i class="fas fa-map-marker-alt text-blue-600"></i>
</div>
<div>
<p class="font-medium">João Silva chegou ao local de trabalho</p>
<p class="text-sm text-gray-500">Av. Paulista, 1000 - 2 minutos atrás</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-green-100 p-2 rounded-full mr-3">
<i class="fas fa-check-circle text-green-600"></i>
</div>
<div>
<p class="font-medium">Maria Oliveira completou o serviço #4567</p>
<p class="text-sm text-gray-500">Rua Augusta, 200 - 15 minutos atrás</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-yellow-100 p-2 rounded-full mr-3">
<i class="fas fa-exclamation-triangle text-yellow-600"></i>
</div>
<div>
<p class="font-medium">Carlos Souza reportou um problema</p>
<p class="text-sm text-gray-500">Rua Oscar Freire, 500 - 25 minutos atrás</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-purple-100 p-2 rounded-full mr-3">
<i class="fas fa-route text-purple-600"></i>
</div>
<div>
<p class="font-medium">Pedro Alves iniciou deslocamento</p>
<p class="text-sm text-gray-500">Para Rua Haddock Lobo, 300 - 40 minutos atrás</p>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<!-- Add Team Member Modal -->
<div id="teamMemberModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-md">
<div class="flex justify-between items-center border-b px-6 py-4">
<h3 class="text-lg font-semibold">Adicionar Membro da Equipe</h3>
<button id="closeTeamModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<div class="p-6">
<form id="teamMemberForm">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-2" for="memberName">Nome Completo</label>
<input type="text" id="memberName" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-2" for="memberEmail">E-mail</label>
<input type="email" id="memberEmail" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-2" for="memberPhone">Telefone</label>
<input type="tel" id="memberPhone" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-2" for="memberRole">Cargo</label>
<select id="memberRole" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">Selecione um cargo</option>
<option value="Técnico">Técnico</option>
<option value="Supervisor">Supervisor</option>
<option value="Instalador">Instalador</option>
<option value="Auxiliar">Auxiliar</option>
</select>
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-medium mb-2" for="memberPhoto">Foto</label>
<input type="file" id="memberPhoto" class="w-full px-3 py-2 border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<div class="flex justify-end space-x-3 mt-6">
<button type="button" id="cancelTeamMember" class="px-4 py-2 border rounded-md hover:bg-gray-50">Cancelar</button>
<button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">Salvar</button>
</div>
</form>
</div>
</div>
</div>
<script>
// Initialize map
function initMap() {
const map = new google.maps.Map(document.getElementById("map"), {
center: { lat: -23.5505, lng: -46.6333 }, // São Paulo coordinates
zoom: 12,
styles: [
{
featureType: "poi",
stylers: [{ visibility: "off" }]
}
]
});
// Add sample markers for team members
const teamMembers = [
{ name: "João Silva", position: { lat: -23.563, lng: -46.654 }, status: "online", role: "Técnico" },
{ name: "Maria Oliveira", position: { lat: -23.568, lng: -46.640 }, status: "busy", role: "Supervisora" },
{ name: "Carlos Souza", position: { lat: -23.555, lng: -46.633 }, status: "online", role: "Instalador" },
{ name: "Ana Costa", position: { lat: -23.542, lng: -46.645 }, status: "offline", role: "Técnica" },
{ name: "Pedro Alves", position: { lat: -23.558, lng: -46.625 }, status: "online", role: "Instalador" }
];
const icons = {
online: {
url: "https://maps.google.com/mapfiles/ms/icons/green-dot.png"
},
busy: {
url: "https://maps.google.com/mapfiles/ms/icons/yellow-dot.png"
},
offline: {
url: "https://maps.google.com/mapfiles/ms/icons/red-dot.png"
}
};
teamMembers.forEach(member => {
const marker = new google.maps.Marker({
position: member.position,
map: map,
title: member.name,
icon: icons[member.status]
});
const infoWindow = new google.maps.InfoWindow({
content: `
<div class="p-2">
<h4 class="font-bold">${member.name}</h4>
<p class="text-sm">${member.role}</p>
<p class="text-xs mt-1">
<span class="inline-block w-2 h-2 rounded-full ${member.status === 'online' ? 'bg-green-500' : member.status === 'busy' ? 'bg-yellow-500' : 'bg-red-500'} mr-1"></span>
${member.status === 'online' ? 'Online' : member.status === 'busy' ? 'Ocupado' : 'Offline'}
</p>
</div>
`
});
marker.addListener("click", () => {
infoWindow.open(map, marker);
});
});
// Add sample work locations
const workLocations = [
{ name: "Av. Paulista, 1000", position: { lat: -23.561, lng: -46.656 } },
{ name: "Rua Augusta, 200", position: { lat: -23.558, lng: -46.660 } },
{ name: "Rua Oscar Freire, 500", position: { lat: -23.555, lng: -46.675 } },
{ name: "Rua Haddock Lobo, 300", position: { lat: -23.552, lng: -46.663 } }
];
workLocations.forEach(location => {
new google.maps.Marker({
position: location.position,
map: map,
title: location.name,
icon: {
url: "https://maps.google.com/mapfiles/ms/icons/blue-dot.png"
}
});
});
}
// Toggle sidebar
document.getElementById('toggleSidebar').addEventListener('click', function() {
const sidebar = document.querySelector('.sidebar');
sidebar.classList.toggle('collapsed');
const icon = this.querySelector('i');
if (sidebar.classList.contains('collapsed')) {
icon.classList.remove('fa-chevron-left');
icon.classList.add('fa-chevron-right');
} else {
icon.classList.remove('fa-chevron-right');
icon.classList.add('fa-chevron-left');
}
});
// Team member modal
document.getElementById('addTeamMember').addEventListener('click', function() {
document.getElementById('teamMemberModal').classList.remove('hidden');
});
document.getElementById('closeTeamModal').addEventListener('click', function() {
document.getElementById('teamMemberModal').classList.add('hidden');
});
document.getElementById('cancelTeamMember').addEventListener('click', function() {
document.getElementById('teamMemberModal').classList.add('hidden');
});
document.getElementById('teamMemberForm').addEventListener('submit', function(e) {
e.preventDefault();
alert('Membro da equipe adicionado com sucesso!');
document.getElementById('teamMemberModal').classList.add('hidden');
this.reset();
});
// Refresh map button
document.getElementById('refreshMap').addEventListener('click', function() {
this.innerHTML = '<i class="fas fa-sync-alt animate-spin mr-2"></i>Atualizando...';
setTimeout(() => {
this.innerHTML = '<i class="fas fa-sync-alt mr-2"></i>Atualizar Mapa';
alert('Mapa atualizado com sucesso!');
}, 1500);
});
// Initialize map when window loads
window.onload = function() {
initMap();
};
</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=Leosozza/maxfama" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>