Spaces:
Running
Running
Promote version 3c60f32 to main
Browse filesPromoted commit 3c60f3204ac21bc4b6b1695f259d56694347c8bf to main branch
Files changed (2)
- calculator2.html+24-9
- index.html+32-103
52 unmodified lines5354555657585960616263565758596061147 unmodified lines20921021121721221321421521621721821922022122222322422522622722822923023123223323423523652 unmodified lines <span id="current-date" class="font-mono"></span> </div> </div> <div class="flex justify-center mb-6 gap-4"> <a href="index.html" class="bg-primary hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition"> Slinga 2 </a> <a href="calculator2.html" class="bg-secondary hover:bg-green-700 text-white font-bold py-3 px-6 rounded-lg transition"> OSR </a> </div> <button onclick="saveCalculatorState(); window.location.href='index.html'" class="mt-4 bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-2 px-4 rounded-lg transition hovered-element"> <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 inline mr-2 hovered-element"><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> Byt till Slinga 2 </button> </header>
<!-- Rest of the calculator content (same as index.html) -->147 unmodified lines updateTime(); setInterval(updateTime, 1000);
// Initialize the calculator // Toggle functionality document.getElementById('toggle-calculator').addEventListener('click', function() { const slinga2Section = document.getElementById('slinga2-calculator'); const osrSection = document.getElementById('osr-calculator'); const toggleText = document.getElementById('toggle-text'); if (osrSection.classList.contains('hidden')) { // Switch to OSR osrSection.classList.remove('hidden'); slinga2Section.classList.add('hidden'); toggleText.textContent = 'Switch to Slinga 2'; } else { // Switch to Slinga 2 osrSection.classList.add('hidden'); slinga2Section.classList.remove('hidden'); toggleText.textContent = 'Switch to OSR'; } });
// Initialize both calculators initializeCalculator('osr', osrShifts, osrShiftEmployees); initializeCalculator('slinga2', slinga2Shifts, slinga2ShiftEmployees);
function initializeCalculator(prefix, shifts, shiftEmployees) { const shiftContainer = document.getElementById(`${prefix}-shift-container`);54 unmodified lines555657585960616263646558596061626364656669676871697071721 unmodified line747576797778798082 unmodified lines163164165168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258166167168169170146 unmodified lines31731831941132032132232332432532632732832933033133233333433533633733833934034134234334454 unmodified lines </div> </header>
<!-- Navigation --> <div class="flex justify-center mb-6 gap-4"> <a href="index.html" class="bg-primary hover:bg-blue-700 text-white font-bold py-3 px-6 rounded-lg transition"> Slinga 2 </a> <a href="calculator2.html" class="bg-secondary hover:bg-green-700 text-white font-bold py-3 px-6 rounded-lg transition"> OSR </a> <!-- 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 lg:grid-cols-3 gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> <!-- Slinga 2 Calculator --> <div class="calculator-section lg:col-span-1"> <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">1 unmodified line </div> </div>
<div class="bg-white p-4 rounded-xl shadow-lg mb-4"> <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">82 unmodified lines </div> </div>
<!-- Shift Details --> <div class="bg-white p-4 rounded-xl shadow-lg lg:col-span-1"> <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"> <!-- 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>
<!-- Results Section --> <div class="bg-white p-4 rounded-xl shadow-lg lg:col-span-1"> <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> <!-- OSR Calculator --> <div id="osr-calculator" class="calculator-section hidden"> <div class="bg-white p-6 rounded-xl shadow-lg mb-6"> <h2 class="text-2xl font-semibold text-dark mb-4 text-center">OSR</h2> <div id="osr-shift-container" class="grid grid-cols-1 gap-4 mb-6">146 unmodified lines updateTime(); setInterval(updateTime, 1000);
// Initialize the calculator // Toggle functionality document.getElementById('toggle-calculator').addEventListener('click', function() { const slinga2Section = document.getElementById('slinga2-calculator'); const osrSection = document.getElementById('osr-calculator'); const toggleText = document.getElementById('toggle-text'); if (slinga2Section.classList.contains('hidden')) { // Switch to Slinga 2 slinga2Section.classList.remove('hidden'); osrSection.classList.add('hidden'); toggleText.textContent = 'Switch to OSR'; } else { // Switch to OSR slinga2Section.classList.add('hidden'); osrSection.classList.remove('hidden'); toggleText.textContent = 'Switch to Slinga 2'; } });
// Initialize both calculators initializeCalculator('slinga2', slinga2Shifts, slinga2ShiftEmployees); initializeCalculator('osr', osrShifts, osrShiftEmployees);
function initializeCalculator(prefix, shifts, shiftEmployees) { const shiftContainer = document.getElementById(`${prefix}-shift-container`);calculator2.html+24-9
index.html+32-103