timewizard / index.html
cyberZag's picture
add add plese roports page too
52ce0b0 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TimeWizard - Employee Time Tracking</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#4F46E5',
secondary: '#10B981',
dark: '#1E293B',
light: '#F8FAFC'
}
}
}
}
</script>
<style>
.auth-bg {
background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.1) 0%, rgba(255,255,255,1) 90%);
}
.dashboard-bg {
background-color: #F8FAFC;
}
.time-card {
transition: all 0.3s ease;
}
.time-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.sidebar-link.active {
border-left: 4px solid #4F46E5;
background-color: rgba(79, 70, 229, 0.1);
}
</style>
</head>
<body class="font-sans antialiased">
<!-- Authentication Page -->
<div id="auth-page" class="min-h-screen flex items-center justify-center auth-bg">
<div class="w-full max-w-md px-6 py-12 bg-white rounded-xl shadow-lg">
<div class="text-center mb-8">
<div class="w-20 h-20 bg-primary rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="clock" class="text-white w-10 h-10"></i>
</div>
<h1 class="text-3xl font-bold text-dark mb-2">TimeWizard</h1>
<p class="text-gray-600">Manage time like magic ✨</p>
</div>
<form class="space-y-6">
<div>
<label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-feather="mail" class="text-gray-400"></i>
</div>
<input id="email" name="email" type="email" required class="pl-10 w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary">
</div>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-feather="lock" class="text-gray-400"></i>
</div>
<input id="password" name="password" type="password" required class="pl-10 w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-primary focus:border-primary">
</div>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center">
<input id="remember-me" name="remember-me" type="checkbox" class="h-4 w-4 text-primary focus:ring-primary border-gray-300 rounded">
<label for="remember-me" class="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<div class="text-sm">
<a href="#" class="font-medium text-primary hover:text-primary-dark">Forgot password?</a>
</div>
</div>
<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
Sign in
</button>
</div>
</form>
<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-2 bg-white text-gray-500">Or continue with</span>
</div>
</div>
<div class="mt-6 grid grid-cols-2 gap-3">
<div>
<button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-lg shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50">
<i data-feather="github" class="mr-2"></i> GitHub
</button>
</div>
<div>
<button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-lg shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50">
<i data-feather="google" class="mr-2"></i> Google
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Employee Dashboard (hidden by default) -->
<div id="employee-dashboard" class="hidden min-h-screen flex">
<!-- Sidebar -->
<div class="w-64 bg-white shadow-md">
<div class="p-6 flex items-center space-x-3">
<div class="w-10 h-10 bg-primary rounded-full flex items-center justify-center">
<i data-feather="user" class="text-white w-5 h-5"></i>
</div>
<div>
<p class="font-medium text-dark">John Doe</p>
<p class="text-xs text-gray-500">Employee</p>
</div>
</div>
<nav class="mt-8 px-4 space-y-1">
<a href="index.html" class="sidebar-link active flex items-center px-4 py-3 text-sm font-medium text-dark rounded-lg">
<i data-feather="home" class="mr-3 text-primary"></i> Dashboard
</a>
<a href="time-tracking.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="clock" class="mr-3"></i> Time Tracking
</a>
<a href="vacation.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="calendar" class="mr-3"></i> Vacation
</a>
<a href="reports.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="file-text" class="mr-3"></i> Reports
</a>
<a href="settings.html" class="sidebar-link flex items-center px-4 py-3 text-sm font-medium text-gray-600 hover:text-dark rounded-lg">
<i data-feather="settings" class="mr-3"></i> Settings
</a>
</nav>
</div>
<!-- Main Content -->
<div class="flex-1 dashboard-bg p-8">
<div class="flex justify-between items-center mb-8">
<h1 class="text-2xl font-bold text-dark">Dashboard</h1>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full bg-white shadow hover:bg-gray-50">
<i data-feather="bell"></i>
</button>
<button class="p-2 rounded-full bg-white shadow hover:bg-gray-50">
<i data-feather="help-circle"></i>
</button>
</div>
</div>
<!-- Time Tracking Card -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white rounded-xl shadow-md p-6 time-card">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-dark">Today's Time</h2>
<div class="bg-primary bg-opacity-10 p-2 rounded-full">
<i data-feather="clock" class="text-primary w-5 h-5"></i>
</div>
</div>
<div class="text-center py-4">
<p class="text-4xl font-bold text-dark mb-2">7:24</p>
<p class="text-sm text-gray-500">Total hours worked</p>
</div>
<div class="flex justify-between mt-4">
<button class="flex-1 mr-2 bg-primary text-white py-2 px-4 rounded-lg text-sm font-medium hover:bg-primary-dark">
Clock In
</button>
<button class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-lg text-sm font-medium hover:bg-gray-300">
Clock Out
</button>
</div>
</div>
<div class="bg-white rounded-xl shadow-md p-6 time-card">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-dark">Break Time</h2>
<div class="bg-secondary bg-opacity-10 p-2 rounded-full">
<i data-feather="coffee" class="text-secondary w-5 h-5"></i>
</div>
</div>
<div class="text-center py-4">
<p class="text-4xl font-bold text-dark mb-2">0:45</p>
<p class="text-sm text-gray-500">Total break time today</p>
</div>
<div class="flex justify-between mt-4">
<button class="flex-1 mr-2 bg-secondary text-white py-2 px-4 rounded-lg text-sm font-medium hover:bg-secondary-dark">
Start Break
</button>
<button class="flex-1 bg-gray-200 text-gray-700 py-2 px-4 rounded-lg text-sm font-medium hover:bg-gray-300">
End Break
</button>
</div>
</div>
<div class="bg-white rounded-xl shadow-md p-6 time-card">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-medium text-dark">Vacation Days</h2>
<div class="bg-yellow-400 bg-opacity-10 p-2 rounded-full">
<i data-feather="sun" class="text-yellow-400 w-5 h-5"></i>
</div>
</div>
<div class="text-center py-4">
<p class="text-4xl font-bold text-dark mb-2">12/20</p>
<p class="text-sm text-gray-500">Days remaining this year</p>
</div>
<button class="w-full mt-4 bg-yellow-400 text-white py-2 px-4 rounded-lg text-sm font-medium hover:bg-yellow-500">
Request Vacation
</button>
</div>
</div>
<!-- Recent Activity -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex items-center justify-between mb-6">
<h2 class="text-lg font-medium text-dark">Recent Activity</h2>
<button class="text-sm text-primary font-medium hover:text-primary-dark">View All</button>
</div>
<div class="space-y-4">
<div class="flex items-start pb-4 border-b border-gray-100">
<div class="bg-primary bg-opacity-10 p-2 rounded-full mr-4">
<i data-feather="clock" class="text-primary w-5 h-5"></i>
</div>
<div class="flex-1">
<p class="text-sm font-medium text-dark">You clocked in at 9:00 AM</p>
<p class="text-xs text-gray-500">Today, 9:00 AM</p>
</div>
</div>
<div class="flex items-start pb-4 border-b border-gray-100">
<div class="bg-secondary bg-opacity-10 p-2 rounded-full mr-4">
<i data-feather="coffee" class="text-secondary w-5 h-5"></i>
</div>
<div class="flex-1">
<p class="text-sm font-medium text-dark">Break started at 12:30 PM</p>
<p class="text-xs text-gray-500">Today, 12:30 PM</p>
</div>
</div>
<div class="flex items-start pb-4 border-b border-gray-100">
<div class="bg-secondary bg-opacity-10 p-2 rounded-full mr-4">
<i data-feather="coffee" class="text-secondary w-5 h-5"></i>
</div>
<div class="flex-1">
<p class="text-sm font-medium text-dark">Break ended at 1:15 PM</p>
<p class="text-xs text-gray-500">Today, 1:15 PM</p>
</div>
</div>
<div class="flex items-start">
<div class="bg-green-500 bg-opacity-10 p-2 rounded-full mr-4">
<i data-feather="check" class="text-green-500 w-5 h-5"></i>
</div>
<div class="flex-1">
<p class="text-sm font-medium text-dark">Your vacation request for July 15-20 was approved</p>
<p class="text-xs text-gray-500">Yesterday, 3:45 PM</p>
</div>
</div>
</div>
</div>
<!-- Weekly Summary -->
<div class="bg-white rounded-xl shadow-md p-6">
<div class="flex items-center justify-between mb-6">
<h2 class="text-lg font-medium text-dark">Weekly Summary</h2>
<button class="text-sm text-primary font-medium hover:text-primary-dark">Export</button>
</div>
<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">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Clock In</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Clock Out</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total Hours</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Break Time</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">Mon, Jun 12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">9:00 AM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5:30 PM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">0:45</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Complete</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">Tue, Jun 13</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8:45 AM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5:15 PM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">1:00</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Complete</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">Wed, Jun 14</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">9:15 AM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5:45 PM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">0:45</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Complete</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-dark">Thu, Jun 15</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">9:00 AM</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">In Progress</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Admin Dashboard (hidden by default) -->
<div id="admin-dashboard" class="hidden min-h-screen flex">
<!-- Admin content would go here -->
</div>
<script>
feather.replace();
// Sample users database (in a real app, this would be server-side)
const users = [
{ email: 'admin@example.com', password: 'admin123', role: 'admin', name: 'Admin User' },
{ email: 'employee@example.com', password: 'employee123', role: 'employee', name: 'John Doe' }
];
document.querySelector('form').addEventListener('submit', function(e) {
e.preventDefault();
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
// Find user
const user = users.find(u => u.email === email && u.password === password);
if (user) {
// Hide auth page
document.getElementById('auth-page').classList.add('hidden');
// Show appropriate dashboard
if (user.role === 'admin') {
window.location.href = "admin-dashboard.html";
} else {
// Redirect to dashboard page by default
window.location.href = "index.html";
}
} else {
alert('Invalid email or password');
}
});
// Time tracking demo functionality
if (document.getElementById('employee-dashboard')) {
const clockInBtn = document.querySelector('#employee-dashboard button:first-child');
const clockOutBtn = document.querySelector('#employee-dashboard button:nth-child(2)');
const breakStartBtn = document.querySelector('#employee-dashboard button:nth-child(3)');
const breakEndBtn = document.querySelector('#employee-dashboard button:nth-child(4)');
clockInBtn.addEventListener('click', function() {
alert('Clocked in at ' + new Date().toLocaleTimeString());
clockInBtn.disabled = true;
clockOutBtn.disabled = false;
});
clockOutBtn.addEventListener('click', function() {
alert('Clocked out at ' + new Date().toLocaleTimeString());
clockOutBtn.disabled = true;
clockInBtn.disabled = false;
});
breakStartBtn.addEventListener('click', function() {
alert('Break started at ' + new Date().toLocaleTimeString());
breakStartBtn.disabled = true;
breakEndBtn.disabled = false;
});
breakEndBtn.addEventListener('click', function() {
alert('Break ended at ' + new Date().toLocaleTimeString());
breakEndBtn.disabled = true;
breakStartBtn.disabled = false;
});
}
</script>
</body>
</html>