BabloOG commited on
Commit
00aab42
·
verified ·
1 Parent(s): 9ca987d

<!DOCTYPE html>

Browse files

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ShiftSync Calculator 1</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: '#3B82F6',
secondary: '#10B981',
dark: '#1F2937',
light: '#F3F4F6'
}
}
}
}
</script>
<style>
.shift-card {
transition: all 0.3s ease;
}
.shift-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.time-input {
background-color: rgba(255, 255, 255, 0.9);
border: 1px solid #E5E7EB;
}
</style>
</head>
<body class="bg-gradient-to-br from-blue-50 to-green-50 min-h-screen">
<div class="container mx-auto px-4 py-4 max-w-5xl">
<!-- Header -->
<header class="mb-4 text-center">
<div class="flex items-center justify-center gap-4">
<img src="https://huggingface.co/spaces/BabloOG/TamroMatematik/resolve/main/images/gorilla.png" alt="Logo" class="w-16 h-16 object-contain">
<h1 class="text-4xl font-bold text-dark mb-2">Tamro <span class="text-primary">Shift Calculator</span></h1>
</div>
<div class="mt-4 flex justify-center items-center space-x-4">
<div class="px-4 py-2 bg-primary text-white rounded-lg shadow animate-pulse">
<span id="current-time" class="font-mono"></span>
<span class="ml-2">CET (Sweden)</span>
</div>
<div class="px-4 py-2 bg-secondary text-white rounded-lg shadow">
<span id="current-date" class="font-mono"></span>
</div>
</div>
</header>

<!-- Toggle Button -->
<div class="flex justify-center mb-6">
<button id="toggle-calculator" class="bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-3 px-6 rounded-lg transition flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-repeat mr-2"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg>
<span id="toggle-text">Switch to OSR</span>
</button>
</div>

<!-- Calculator Sections -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Slinga 2 Calculator -->
<div id="slinga2-calculator" class="calculator-section">
<div class="bg-white p-4 rounded-xl shadow-lg mb-4">
<h2 class="text-2xl font-semibold text-dark mb-4 text-center">Slinga 2</h2>
<div id="slinga2-shift-container" class="grid grid-cols-1 gap-4 mb-6">
<!-- Slinga 2 shifts will be dynamically inserted here -->
</div>
</div>

<div class="bg-white p-4 rounded-xl shadow-lg">
<h2 class="text-2xl font-semibold text-dark mb-4">Shift Details</h2>

<div class="mb-4 space-y-2">
<div class="space-y-2">
<label class="block text-gray-700">Start Time</label>
<input type="time" id="slinga2-start-time" class="time-input w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
</div>

<div class="space-y-2">
<label class="block text-gray-700">End Time</label>
<input type="time" id="slinga2-end-time" class="time-input w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent">
</div>

<div class="space-y-2">
<div id="slinga2-break-input-container">
<!-- Slinga 2 break times will be dynamically inserted here -->
</div>
<button id="slinga2-add-break-btn" class="mt-2 bg-gray-100 hover:bg-gray-200 text-gray-700 py-1 px-3 rounded-lg transition flex items-center">
<i data-feather="plus" class="w-4 h-4 mr-1"></i> Add Break
</button>
</div>
</div>

<div class="mb-4">
<h3 class="text-lg font-medium text-dark mb-2">Adjust Time</h3>
<div class="grid grid-cols-4 gap-2">
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="-5">-5 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="-15">-15 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="-30">-30 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="-60">-60 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="5">+5 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="15">+15 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="30">+30 min</button>
<button class="time-adjust-btn bg-gray-100 hover:bg-gray-200 py-2 px-3 rounded-lg transition" data-minutes="60">+60 min</button>
</div>
</div>

<div class="mb-6">
<h3 class="text-lg font-medium text-dark mb-2">Employees for <span id="slinga2-selected-shift-name" class="text-primary">No Shift Selected</span></h3>
<div class="flex items-center space-x-4">
<button id="slinga2-decrease-employees" class="bg-red-100 hover:bg-red-200 text-red-700 p-2 rounded-full transition">
<i data-feather="minus"></i>
</button>
<span id="slinga2-employee-count" class="text-2xl font-bold">0</span>
<button id="slinga2-increase-employees" class="bg-green-100 hover:bg-green-200 text-green-700 p-2 rounded-full transition">
<i data-feather="plus"></i>
</button>
</div>
</div>

<div class="bg-blue-50 p-3 rounded-lg mb-3">
<h3 class="text-lg font-medium text-dark mb-2">Shift Hours</h3>
<div class="flex justify-between items-center">
<span class="text-gray-600">Selected Shift:</span>
<span id="slinga2-hours-per-employee" class="text-2xl font-bold text-primary">0h 0m</span>
</div>
<div class="flex justify-between items-center mt-2">
<span class="text-gray-600">All Shifts Total:</span>
<span id="slinga2-total-hours-all" class="text-2xl font-bold text-secondary">0h 0m</span>
</div>
<div class="flex justify-between items-center mt-2">
<span class="text-gray-600">Remaining Today:</span>
<span id="slinga2-remaining-today" class="text-2xl font-bold text-blue-700">0h 0m</span>
</div>
</div>

<div class="bg-purple-50 p-3 rounded-lg">
<h3 class="text-lg font-medium text-dark mb-2">Hourly Rate Calculator</h3>
<div class="flex items-center space-x-2 mb-2">
<span class="text-gray-600">Total Amount:</span>
<input type="number" id="slinga2-total-amount" class="time-input w-24 px-3 py-1 border rounded-lg" placeholder="rader">
</div>
<div class="flex space-x-2 mb-2">
<button id="slinga2-calculate-rate-btn" class="bg-purple-100 hover:bg-purple-200 text-purple-700 py-2 px-4 rounded-lg transition flex-1">
Total Hours Rate
</button>
<button id="slinga2-calculate-remaining-rate-btn" class="bg-indigo-100 hover:bg-indigo-200 text-indigo-700 py-2 px-4 rounded-lg transition flex-1">
Remaining Rate
</button>
</div>
<div class="mt-2 flex justify-between items-center">
<span class="text-gray-600">Hourly Rate:</span>
<span id="slinga2-hourly-rate" class="text-xl font-bold text-purple-700">0 rader/hour</span>
</div>
</div>
</div>
</div>

<!-- OSR Calculator -->

2 files changed +628 -23
Files changed (2)
README.md+8-5
index.html+620-18