Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>PRL Date Calculator</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> | |
| .glow-box { | |
| box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); | |
| } | |
| .floating { | |
| animation: floating 3s ease-in-out infinite; | |
| } | |
| @keyframes floating { | |
| 0% { transform: translateY(0px); } | |
| 50% { transform: translateY(-10px); } | |
| 100% { transform: translateY(0px); } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen"> | |
| <div class="container mx-auto px-4 py-12"> | |
| <div class="max-w-2xl mx-auto bg-white rounded-xl glow-box overflow-hidden transition-all duration-300 hover:shadow-xl"> | |
| <div class="p-8"> | |
| <div class="text-center mb-8"> | |
| <div class="flex justify-center mb-4"> | |
| <img src="https://dss.gov.bd/wp-content/uploads/2021/04/dss-logo-1.png" | |
| alt="Department of Social Services Logo" | |
| class="w-16 h-16 object-contain"> | |
| </div> | |
| <h1 class="text-3xl font-bold text-gray-800 mb-2">PRL Date Calculator</h1> | |
| <p class="text-gray-600">Calculate your Pension Release Date (59th birthday - 1 day)</p> | |
| </div> | |
| <div class="mb-8"> | |
| <label for="dob" class="block text-sm font-medium text-gray-700 mb-2"> | |
| <i class="fas fa-calendar-day mr-2 text-indigo-500"></i>Date of Birth | |
| </label> | |
| <input type="date" id="dob" | |
| class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition"> | |
| </div> | |
| <button id="calculateBtn" | |
| class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-3 px-4 rounded-lg transition duration-300 flex items-center justify-center mb-6"> | |
| <i class="fas fa-calculator mr-2"></i> Calculate PRL Date | |
| </button> | |
| <div id="resultContainer" class="hidden bg-indigo-50 border-l-4 border-indigo-500 p-4 rounded-r-lg"> | |
| <h3 class="font-semibold text-indigo-800 mb-2"> | |
| <i class="fas fa-info-circle mr-2"></i>Your PRL Date Details | |
| </h3> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div class="bg-white p-3 rounded-lg shadow-sm"> | |
| <p class="text-sm text-gray-500">Date of Birth</p> | |
| <p id="dobDisplay" class="font-medium text-gray-800"></p> | |
| </div> | |
| <div class="bg-white p-3 rounded-lg shadow-sm"> | |
| <p class="text-sm text-gray-500">59th Birthday</p> | |
| <p id="birthday59th" class="font-medium text-gray-800"></p> | |
| </div> | |
| </div> | |
| <div class="mt-4 bg-gradient-to-r from-indigo-100 to-blue-100 p-4 rounded-lg"> | |
| <p class="text-sm text-indigo-600 font-semibold"> | |
| <i class="fas fa-calendar-check mr-2"></i>PRL Date | |
| </p> | |
| <p id="prlDate" class="text-2xl font-bold text-indigo-800 mt-1"></p> | |
| <p id="timeLeft" class="text-sm text-indigo-600 mt-2"></p> | |
| </div> | |
| </div> | |
| <div id="errorMessage" class="hidden mt-4 bg-red-50 border-l-4 border-red-500 p-4 rounded-r-lg"> | |
| <p class="text-red-700 flex items-center"> | |
| <i class="fas fa-exclamation-circle mr-2"></i> | |
| <span id="errorText"></span> | |
| </p> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 px-8 py-4 text-center text-sm text-gray-500"> | |
| <i class="fas fa-info-circle mr-1"></i> PRL Date = 59th Birthday - 1 day | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const dobInput = document.getElementById('dob'); | |
| const calculateBtn = document.getElementById('calculateBtn'); | |
| const resultContainer = document.getElementById('resultContainer'); | |
| const errorMessage = document.getElementById('errorMessage'); | |
| const dobDisplay = document.getElementById('dobDisplay'); | |
| const birthday59th = document.getElementById('birthday59th'); | |
| const prlDate = document.getElementById('prlDate'); | |
| const timeLeft = document.getElementById('timeLeft'); | |
| const errorText = document.getElementById('errorText'); | |
| calculateBtn.addEventListener('click', calculatePRLDate); | |
| function calculatePRLDate() { | |
| // Hide previous results/errors | |
| resultContainer.classList.add('hidden'); | |
| errorMessage.classList.add('hidden'); | |
| const dob = dobInput.value; | |
| if (!dob) { | |
| showError('Please enter your date of birth'); | |
| return; | |
| } | |
| const dobDate = new Date(dob); | |
| const today = new Date(); | |
| if (dobDate > today) { | |
| showError('Date of birth cannot be in the future'); | |
| return; | |
| } | |
| // Calculate 59th birthday | |
| const birthday59thDate = new Date(dobDate); | |
| birthday59thDate.setFullYear(birthday59thDate.getFullYear() + 59); | |
| // Calculate PRL date (59th birthday - 1 day) | |
| const prlDateObj = new Date(birthday59thDate); | |
| prlDateObj.setDate(prlDateObj.getDate() - 1); | |
| // Display results | |
| dobDisplay.textContent = formatDate(dobDate); | |
| birthday59th.textContent = formatDate(birthday59thDate); | |
| prlDate.textContent = formatDate(prlDateObj); | |
| // Calculate time left between today and PRL date | |
| const timeDiff = prlDateObj - today; | |
| if (timeDiff > 0) { | |
| const daysLeft = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); | |
| const yearsLeft = Math.floor(daysLeft / 365); | |
| const monthsLeft = Math.floor((daysLeft % 365) / 30); | |
| let timeLeftText = `In ${daysLeft} days`; | |
| if (yearsLeft > 0 || monthsLeft > 0) { | |
| timeLeftText = `In `; | |
| if (yearsLeft > 0) { | |
| timeLeftText += `${yearsLeft} year${yearsLeft > 1 ? 's' : ''}`; | |
| if (monthsLeft > 0) { | |
| timeLeftText += ` and `; | |
| } | |
| } | |
| if (monthsLeft > 0) { | |
| timeLeftText += `${monthsLeft} month${monthsLeft > 1 ? 's' : ''}`; | |
| } | |
| timeLeftText += ` (${daysLeft} days)`; | |
| } | |
| timeLeft.textContent = timeLeftText; | |
| } else if (timeDiff === 0) { | |
| timeLeft.textContent = "Today is your PRL Date!"; | |
| } else { | |
| timeLeft.textContent = "Your PRL Date has passed"; | |
| } | |
| resultContainer.classList.remove('hidden'); | |
| } | |
| function formatDate(date) { | |
| const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; | |
| return date.toLocaleDateString('en-US', options); | |
| } | |
| function showError(message) { | |
| errorText.textContent = message; | |
| errorMessage.classList.remove('hidden'); | |
| // Scroll to error message | |
| errorMessage.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
| } | |
| }); | |
| </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=Monirbd2025/office-tools" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |