Spaces:
Running
Running
Download index.html from tframe/deskrefresh: direct link, hf CLI and curl.
- Browser
- Download file 72.7 kB
-
https://huggingface.co/spaces/tframe/deskrefresh/resolve/main/index.html
- Command line
-
hf download hf://spaces/tframe/deskrefresh/index.html
-
curl -L -o index.html https://huggingface.co/spaces/tframe/deskrefresh/resolve/main/index.html
72.7 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Desk Refresh</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://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#10b981',
secondary: '#059669',
accent: '#6ee7b7',
light: '#ecfdf5',
dark: '#064e3b',
}
}
}
}
</script>
<style>
.exercise-card {
transition: all 0.3s ease;
}
.exercise-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
.animate-pulse-slow {
animation: pulse 3s infinite;
}
.routine-item {
cursor: grab;
transition: all 0.2s ease;
flex: 0 0 auto;
width: 180px;
}
.routine-item:active {
cursor: grabbing;
}
.routine-item.dragging {
opacity: 0.5;
background-color: '#d1fae5';
}
.routine-scroll-container {
display: flex;
overflow-x: auto;
padding-bottom: 10px;
gap: 12px;
}
.routine-scroll-container::-webkit-scrollbar {
height: 6px;
}
.routine-scroll-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
.routine-scroll-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 10px;
}
.routine-scroll-container::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.favorite-btn.active {
color: #f59e0b;
}
.activity-icon {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: #d1fae5;
color: #059669;
}
.auth-modal {
background-color: rgba(0,0,0,0.7);
}
.auth-content {
animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
.timer-adjust-btn {
transition: all 0.2s ease;
}
.timer-adjust-btn:active {
transform: scale(0.95);
}
.hidden-row {
display: none;
}
</style>
</head>
<body class="font-sans bg-gray-50">
<!-- Auth Modal -->
<div id="auth-modal" class="fixed inset-0 auth-modal flex items-center justify-center z-50 hidden">
<div class="auth-content bg-white rounded-xl shadow-2xl w-full max-w-md p-8">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Welcome to Desk Refresh</h2>
<button id="close-auth" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div id="login-form">
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Email</label>
<input type="email" id="login-email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="your@email.com">
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Password</label>
<input type="password" id="login-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
</div>
<button id="login-btn" class="w-full bg-primary hover:bg-secondary text-white px-6 py-3 rounded-lg font-medium mb-4">
Log In
</button>
<p class="text-center text-gray-600 mb-4">Don't have an account? <button id="show-signup" class="text-primary font-medium">Sign up</button></p>
<div class="text-center">
<button class="text-sm text-gray-500 hover:text-gray-700">Forgot password?</button>
</div>
</div>
<div id="signup-form" class="hidden">
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Name</label>
<input type="text" id="signup-name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Your Name">
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Email</label>
<input type="email" id="signup-email" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="your@email.com">
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Password</label>
<input type="password" id="signup-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Confirm Password</label>
<input type="password" id="signup-confirm-password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••">
</div>
<button id="signup-btn" class="w-full bg-primary hover:bg-secondary text-white px-6 py-3 rounded-lg font-medium mb-4">
Create Account
</button>
<p class="text-center text-gray-600">Already have an account? <button id="show-login" class="text-primary font-medium">Log in</button></p>
</div>
</div>
</div>
<div class="container mx-auto px-4 py-8 max-w-6xl" id="main-content" class="hidden">
<!-- Header -->
<header class="flex flex-col md:flex-row justify-between items-center mb-12">
<div class="flex items-center mb-6 md:mb-0">
<i class="fas fa-leaf text-3xl text-primary mr-3"></i>
<h1 class="text-3xl font-bold text-gray-800">Desk Refresh</h1>
</div>
<div class="flex items-center space-x-4">
<div class="relative group">
<button id="profile-btn" class="flex items-center space-x-2">
<div class="w-10 h-10 rounded-full bg-primary flex items-center justify-center text-white font-semibold" id="avatar">U</div>
<span class="hidden md:inline" id="username">User</span>
</button>
<div class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 hidden group-hover:block">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profile</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
<a href="#" id="logout-btn" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Log out</a>
</div>
</div>
<button id="stats-btn" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-chart-line mr-2"></i> Stats
</button>
</div>
</header>
<!-- Main Dashboard -->
<main>
<!-- Current Activity -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex flex-col md:flex-row items-center">
<div class="md:w-1/3 mb-6 md:mb-0 flex flex-col items-center">
<div class="mb-4 text-center">
<span id="next-activity" class="text-xl font-semibold text-gray-700">Next: Stretch</span>
<p id="current-activity" class="text-gray-600 text-sm">You're currently working. Your next break is scheduled soon.</p>
</div>
<div class="flex items-center">
<button id="decrease-time" class="timer-adjust-btn bg-gray-100 hover:bg-gray-200 text-gray-800 p-3 rounded-lg mr-4">
<i class="fas fa-minus"></i>
</button>
<div class="relative w-32 h-32">
<svg class="w-full h-full" viewBox="0 0 100 100">
<!-- Background circle -->
<circle class="text-gray-200" stroke-width="8" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
<!-- Progress circle -->
<circle id="progress-circle" class="text-primary" stroke-width="8" stroke-dasharray="251.2" stroke-dashoffset="125.6" stroke-linecap="round" stroke="currentColor" fill="transparent" r="40" cx="50" cy="50" />
</svg>
<div class="absolute inset-0 flex items-center justify-center">
<span id="time-remaining" class="text-2xl font-bold text-primary">24:30</span>
</div>
</div>
<button id="increase-time" class="timer-adjust-btn bg-gray-100 hover:bg-gray-200 text-gray-800 p-3 rounded-lg ml-4">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="flex space-x-4 mt-4">
<button id="skip-btn" class="bg-white hover:bg-gray-100 text-gray-800 p-3 rounded-lg border border-gray-300 flex items-center justify-center" title="Skip">
<i class="fas fa-forward"></i>
</button>
<button id="pause-btn" class="bg-primary hover:bg-secondary text-white p-3 rounded-lg flex items-center justify-center" title="Pause">
<i class="fas fa-pause"></i>
</button>
<button id="take-break-now" class="bg-white hover:bg-gray-100 text-gray-800 p-3 rounded-lg border border-gray-300 flex items-center justify-center" title="Take Break Now">
<i class="fas fa-coffee"></i>
</button>
</div>
</div>
<div class="md:w-2/3 md:pl-8">
<h2 class="text-2xl font-bold text-gray-800 mb-4">Current Activity</h2>
<div class="mb-6">
<div class="flex items-center mb-4">
<div class="w-12 h-12 rounded-full bg-light flex items-center justify-center mr-4">
<i class="fas fa-desktop text-primary text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Focus Work</h3>
<p class="text-sm text-gray-500">Deep work session</p>
</div>
</div>
<div class="flex items-center">
<div class="w-12 h-12 rounded-full bg-light flex items-center justify-center mr-4">
<i class="fas fa-hands-helping text-primary text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Neck Stretches</h3>
<p class="text-sm text-gray-500">Next in 24:30</p>
</div>
</div>
</div>
<div class="bg-light rounded-lg p-4">
<h4 class="font-medium text-gray-700 mb-2">Today's Progress</h4>
<div class="w-full bg-gray-200 rounded-full h-2.5 mb-2">
<div class="bg-primary h-2.5 rounded-full" style="width: 45%"></div>
</div>
<div class="flex justify-between text-sm text-gray-600">
<span>2/5 breaks completed</span>
<span>45%</span>
</div>
</div>
</div>
</div>
</div>
<!-- My Routine Section -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-6">
<div class="mb-4 md:mb-0">
<h2 class="text-2xl font-bold text-gray-800">My Wellness Routine</h2>
<div class="flex items-center mt-2">
<select id="routine-selector" class="border border-gray-300 rounded-lg px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary">
<option value="morning">Morning Routine</option>
<option value="afternoon">Afternoon Routine</option>
<option value="evening">Evening Routine</option>
<option value="custom">Custom Routine</option>
</select>
<span class="ml-3 text-sm text-gray-600">Total time: <span id="routine-total-time">5</span> min</span>
</div>
</div>
<button id="save-routine" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg text-sm flex items-center">
<i class="fas fa-save mr-2"></i> Save Routine
</button>
</div>
<div id="routine-container" class="routine-scroll-container">
<!-- Routine items will be added here -->
<div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
<div class="flex items-center justify-between mb-2">
<div class="activity-icon">
<i class="fas fa-hands-helping text-xs"></i>
</div>
<button class="text-gray-400 hover:text-red-500 text-sm">
<i class="fas fa-times"></i>
</button>
</div>
<h3 class="font-semibold text-gray-800 text-sm mb-1">Neck Stretches</h3>
<p class="text-xs text-gray-500">2 min</p>
</div>
<div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
<div class="flex items-center justify-between mb-2">
<div class="activity-icon">
<i class="fas fa-lungs text-xs"></i>
</div>
<button class="text-gray-400 hover:text-red-500 text-sm">
<i class="fas fa-times"></i>
</button>
</div>
<h3 class="font-semibold text-gray-800 text-sm mb-1">Deep Breathing</h3>
<p class="text-xs text-gray-500">1 min</p>
</div>
<div class="routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200">
<div class="flex items-center justify-between mb-2">
<div class="activity-icon">
<i class="fas fa-eye text-xs"></i>
</div>
<button class="text-gray-400 hover:text-red-500 text-sm">
<i class="fas fa-times"></i>
</button>
</div>
<h3 class="font-semibold text-gray-800 text-sm mb-1">Eye Exercises</h3>
<p class="text-xs text-gray-500">2 min</p>
</div>
</div>
<p id="empty-routine-message" class="text-center text-gray-500 py-6 hidden">Your routine is empty. Add exercises from the library below.</p>
</div>
<!-- Quick Actions -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
<div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
<div class="bg-accent rounded-full p-3 mr-4">
<i class="fas fa-glass-whiskey text-white text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Water Reminder</h3>
<p class="text-sm text-gray-600">Log water intake</p>
</div>
</div>
<div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
<div class="bg-accent rounded-full p-3 mr-4">
<i class="fas fa-walking text-white text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Quick Stretch</h3>
<p class="text-sm text-gray-600">2 min routine</p>
</div>
</div>
<div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
<div class="bg-accent rounded-full p-3 mr-4">
<i class="fas fa-spa text-white text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Breathe</h3>
<p class="text-sm text-gray-600">1 min meditation</p>
</div>
</div>
<div class="bg-white rounded-lg shadow-md p-4 flex items-center cursor-pointer hover:bg-light transition-colors">
<div class="bg-accent rounded-full p-3 mr-4">
<i class="fas fa-eye text-white text-xl"></i>
</div>
<div>
<h3 class="font-semibold text-gray-800">Eye Rest</h3>
<p class="text-sm text-gray-600">20-20-20 rule</p>
</div>
</div>
</div>
<!-- Activities Library -->
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<div class="flex flex-col md:flex-row md:items-center md:justify-between mb-6">
<h2 class="text-2xl font-bold text-gray-800 mb-4 md:mb-0">Activities</h2>
<div class="flex flex-col sm:flex-row gap-3">
<div class="relative">
<input type="text" id="exercise-search" placeholder="Search activities..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent w-full">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<select id="exercise-filter" class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
<option value="all">All Activities</option>
<option value="favorites">Favorites</option>
<option value="stretching">Stretching</option>
<option value="breathing">Breathing</option>
<option value="yoga">Chair Yoga</option>
<option value="eye">Eye Care</option>
<option value="strength">Strength</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="exercise-container">
<!-- Activity Card 1 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-hands-helping text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Neck Stretches</h3>
<p class="text-gray-600 mb-3">Gentle neck movements to relieve tension from prolonged sitting.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 2 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="breathing">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-lungs text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Deep Breathing</h3>
<p class="text-gray-600 mb-3">4-7-8 breathing technique to reduce stress and increase focus.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 3 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-hands text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Wrist & Finger</h3>
<p class="text-gray-600 mb-3">Exercises to prevent carpal tunnel and improve circulation.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 3 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 4 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="yoga">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-chair text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Chair Yoga</h3>
<p class="text-gray-600 mb-3">Simple yoga poses you can do without leaving your desk.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 5 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 5 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="eye">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-eye text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="fas fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Eye Exercises</h3>
<p class="text-gray-600 mb-3">Reduce eye strain with the 20-20-20 rule and other techniques.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 6 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="hydration">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-water text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Hydration Reminder</h3>
<p class="text-gray-600 mb-3">Regular reminders to drink water throughout your workday.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> -</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 7 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-arrows-alt-h text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Side Stretches</h3>
<p class="text-gray-600 mb-3">Lateral stretches to relieve tension in your torso and back.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 8 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-undo text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Neck Rotations</h3>
<p class="text-gray-600 mb-3">Slow neck rotations to improve mobility and reduce stiffness.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 9 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="strength">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-dumbbell text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Desk Push-ups</h3>
<p class="text-gray-600 mb-3">Modified push-ups using your desk to strengthen upper body.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 3 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 10 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-running text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Leg Extensions</h3>
<p class="text-gray-600 mb-3">Seated leg extensions to improve circulation in your legs.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 11 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="stretching">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-hands-praying text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Shoulder Rolls</h3>
<p class="text-gray-600 mb-3">Circular shoulder movements to release upper body tension.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 1 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
<!-- Activity Card 12 -->
<div class="exercise-card bg-light rounded-lg overflow-hidden hidden-row" data-category="breathing">
<div class="h-40 bg-primary flex items-center justify-center relative">
<i class="fas fa-wind text-white text-5xl animate-pulse-slow"></i>
<button class="favorite-btn absolute top-3 right-3 text-white hover:text-yellow-300 text-xl">
<i class="far fa-star"></i>
</button>
</div>
<div class="p-4">
<h3 class="font-bold text-lg text-gray-800 mb-2">Box Breathing</h3>
<p class="text-gray-600 mb-3">4-4-4-4 breathing pattern to calm the nervous system.</p>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-500"><i class="fas fa-clock mr-1"></i> 2 min</span>
<button class="add-to-routine text-primary hover:text-secondary text-sm font-medium">Add to Routine</button>
</div>
</div>
</div>
</div>
<div class="text-center mt-6">
<button id="load-more" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg">
Load More Activities
</button>
</div>
</div>
</main>
</div>
<!-- Add to Routine Modal -->
<div id="add-to-routine-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
<div class="bg-white rounded-xl shadow-2xl w-full max-w-md p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-bold text-gray-800">Add to Routine</h3>
<button id="close-add-to-routine" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Select Routine</label>
<select id="target-routine" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
<option value="morning">Morning Routine</option>
<option value="afternoon">Afternoon Routine</option>
<option value="evening">Evening Routine</option>
<option value="custom">Custom Routine</option>
</select>
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Duration (minutes)</label>
<input type="number" id="exercise-duration" min="1" max="10" value="2" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
</div>
<div class="flex justify-end">
<button id="confirm-add-to-routine" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg font-medium">
Add to Routine
</button>
</div>
</div>
</div>
<!-- Stats Modal -->
<div id="stats-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
<div class="bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-y-auto">
<div class="p-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-2xl font-bold text-gray-800">Your Wellness Stats</h3>
<button id="close-stats" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div class="p-6">
<!-- Weekly Overview -->
<div class="mb-8">
<h4 class="text-xl font-semibold text-gray-800 mb-4">Weekly Overview</h4>
<div class="bg-light rounded-lg p-4">
<div class="grid grid-cols-7 gap-2 mb-4">
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Mon</div>
<div class="h-24 bg-primary rounded" style="height: 60%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Tue</div>
<div class="h-24 bg-primary rounded" style="height: 80%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1 Wed">Wed</div>
<div class="h-24 bg-primary rounded" style="height: 45%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Thu</div>
<div class="h-24 bg-primary rounded" style="height: 70%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Fri</div>
<div class="h-24 bg-primary rounded" style="height: 90%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Sat</div>
<div class="h-24 bg-gray-200 rounded" style="height: 10%;"></div>
</div>
<div class="text-center">
<div class="text-xs text-gray-500 mb-1">Sun</div>
<div class="h-24 bg-gray-200 rounded" style="height: 5%;"></div>
</div>
</div>
<div class="flex justify-between text-sm text-gray-600">
<span>0%</span>
<span>Wellness Goal Completion</span>
<span>100%</span>
</div>
</div>
</div>
<!-- Activity Breakdown -->
<div class="mb-8">
<h4 class="text-xl font-semibold text-gray-800 mb-4">Activity Breakdown</h4>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-light rounded-lg p-4">
<h5 class="font-medium text-gray-700 mb-2">Breaks Taken</h5>
<div class="text-3xl font-bold text-primary mb-2">24</div>
<div class="text-sm text-gray-500">+3 from last week</div>
</div>
<div class="bg-light rounded-lg p-4">
<h5 class="font-medium text-gray-700 mb-2">Water Intake</h5>
<div class="text-3xl font-bold text-primary mb-2">5.2L</div>
<div class="text-sm text-gray-500">-0.8L from last week</div>
</div>
<div class="bg-light rounded-lg p-4">
<h5 class="font-medium text-gray-700 mb-2">Stretching</h5>
<div class="text-3xl font-bold text-primary mb-2">18 min</div>
<div class="text-sm text-gray-500">+5 min from last week</div>
</div>
<div class="bg-light rounded-lg p-4">
<h5 class="font-medium text-gray-700 mb-2">Eye Exercises</h5>
<div class="text-3xl font-bold text-primary mb-2">12</div>
<div class="text-sm text-gray-500">+4 from last week</div>
</div>
</div>
</div>
<!-- Achievements -->
<div>
<h4 class="text-xl font-semibold text-gray-800 mb-4">Achievements</h4>
<div class="grid grid-cols-2 sm:grid-cols-3 gap-4">
<div class="bg-yellow-50 border border-yellow-100 rounded-lg p-3 text-center">
<div class="text-yellow-500 mb-2">
<i class="fas fa-trophy text-2xl"></i>
</div>
<h5 class="font-medium text-gray-700 mb-1">5-Day Streak</h5>
<p class="text-xs text-gray-500">Completed all breaks for 5 days</p>
</div>
<div class="bg-blue-50 border border-blue-100 rounded-lg p-3 text-center">
<div class="text-blue-500 mb-2">
<i class="fas fa-check-circle text-2xl"></i>
</div>
<h5 class="font-medium text-gray-700 mb-1">Hydration Pro</h5>
<p class="text-xs text-gray-500">Drank 2L+ for 3 days</p>
</div>
<div class="bg-purple-50 border border-purple-100 rounded-lg p-3 text-center">
<div class="text-purple-500 mb-2">
<i class="fas fa-star text-2xl"></i>
</div>
<h5 class="font-medium text-gray-700 mb-1">Stretch Master</h5>
<p class="text-xs text-gray-500">Completed 20+ stretches</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Save Routine Modal -->
<div id="save-routine-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden z-50">
<div class="bg-white rounded-xl shadow-2xl w-full max-w-md max-h-[90vh] overflow-y-auto">
<div class="p-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-2xl font-bold text-gray-800">Save Your Routine</h3>
<button id="close-save-routine" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div class="p-6">
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Routine Name</label>
<input type="text" id="routine-name" placeholder="e.g. Morning Refresh" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent">
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Description</label>
<textarea id="routine-description" placeholder="Brief description of your routine" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent h-24"></textarea>
</div>
<div class="mb-6">
<h4 class="text-lg font-semibold text-gray-800 mb-3">Routine Summary</h4>
<div class="bg-light rounded-lg p-4">
<div class="flex justify-between items-center mb-3">
<span class="font-medium text-gray-700">Total Time:</span>
<span class="font-bold text-primary">5 minutes</span>
</div>
<div class="mb-3">
<span class="font-medium text-gray-700">Activities Included:</span>
<div class="flex flex-wrap gap-2 mt-2">
<div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
<div class="activity-icon mr-2">
<i class="fas fa-hands-helping text-xs"></i>
</div>
Stretching
</div>
<div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
<div class="activity-icon mr-2">
<i class="fas fa-lungs text-xs"></i>
</div>
Breathing
</div>
<div class="flex items-center bg-white px-3 py-1 rounded-full text-sm">
<div class="activity-icon mr-2">
<i class="fas fa-eye text-xs"></i>
</div>
Eye Care
</div>
</div>
</div>
<div>
<span class="font-medium text-gray-700">Exercises:</span>
<ul class="list-disc list-inside text-sm text-gray-600 mt-1 pl-2">
<li>Neck Stretches (2 min)</li>
<li>Deep Breathing (1 min)</li>
<li>Eye Exercises (2 min)</li>
</ul>
</div>
</div>
</div>
</div>
<div class="p-6 border-t border-gray-200 flex justify-end">
<button id="confirm-save-routine" class="bg-primary hover:bg-secondary text-white px-6 py-2 rounded-lg font-medium">
Save Routine
</button>
</div>
</div>
</div>
<!-- Break Notification -->
<div id="break-notification" class="fixed bottom-4 right-4 bg-white rounded-xl shadow-2xl p-6 max-w-sm hidden z-50">
<div class="flex justify-between items-start mb-4">
<h3 class="text-xl font-bold text-gray-800">Time for a Break!</h3>
<button id="close-notification" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<p class="text-gray-600 mb-6">You've been working for 45 minutes. Let's do some neck stretches to relieve tension.</p>
<div class="flex space-x-3">
<button id="snooze-break" class="bg-white hover:bg-gray-100 text-gray-800 px-4 py-2 rounded-lg border border-gray-300">
Snooze (5 min)
</button>
<button id="start-break" class="bg-primary hover:bg-secondary text-white px-4 py-2 rounded-lg">
Start Break
</button>
</div>
</div>
<script>
// Auth state
let currentUser = null;
let isAuthenticated = false;
let isTimerPaused = false;
// DOM Elements
const authModal = document.getElementById('auth-modal');
const closeAuth = document.getElementById('close-auth');
const loginForm = document.getElementById('login-form');
const signupForm = document.getElementById('signup-form');
const showSignup = document.getElementById('show-signup');
const showLogin = document.getElementById('show-login');
const loginBtn = document.getElementById('login-btn');
const signupBtn = document.getElementById('signup-btn');
const logoutBtn = document.getElementById('logout-btn');
const mainContent = document.getElementById('main-content');
const profileBtn = document.getElementById('profile-btn');
const avatar = document.getElementById('avatar');
const usernameDisplay = document.getElementById('username');
const settingsBtn = document.getElementById('settings-btn');
const settingsModal = document.getElementById('settings-modal');
const closeSettings = document.getElementById('close-settings');
const saveSettings = document.getElementById('save-settings');
const statsBtn = document.getElementById('stats-btn');
const statsModal = document.getElementById('stats-modal');
const closeStats = document.getElementById('close-stats');
const breakNotification = document.getElementById('break-notification');
const closeNotification = document.getElementById('close-notification');
const snoozeBreak = document.getElementById('snooze-break');
const startBreak = document.getElementById('start-break');
const takeBreakNow = document.getElementById('take-break-now');
const skipBtn = document.getElementById('skip-btn');
const pauseBtn = document.getElementById('pause-btn');
// Timer adjustment buttons
const decreaseTimeBtn = document.getElementById('decrease-time');
const increaseTimeBtn = document.getElementById('increase-time');
// Routine elements
const routineContainer = document.getElementById('routine-container');
const emptyRoutineMessage = document.getElementById('empty-routine-message');
const saveRoutineBtn = document.getElementById('save-routine');
const routineSelector = document.getElementById('routine-selector');
const routineTotalTime = document.getElementById('routine-total-time');
// Add to routine modal elements
const addToRoutineModal = document.getElementById('add-to-routine-modal');
const closeAddToRoutine = document.getElementById('close-add-to-routine');
const confirmAddToRoutine = document.getElementById('confirm-add-to-routine');
const targetRoutine = document.getElementById('target-routine');
const exerciseDuration = document.getElementById('exercise-duration');
// Save routine modal elements
const saveRoutineModal = document.getElementById('save-routine-modal');
const closeSaveRoutine = document.getElementById('close-save-routine');
const confirmSaveRoutine = document.getElementById('confirm-save-routine');
// Activities library elements
const exerciseSearch = document.getElementById('exercise-search');
const exerciseFilter = document.getElementById('exercise-filter');
const exerciseContainer = document.getElementById('exercise-container');
const loadMoreBtn = document.getElementById('load-more');
// Timer variables
let workDuration = 45 * 60; // 45 minutes in seconds
let breakDuration = 5 * 60; // 5 minutes in seconds
let timeLeft = workDuration;
let timer;
let isWorking = true;
// Timer adjustment variables
let decreaseInterval;
let increaseInterval;
let holdTimeout;
let isHolding = false;
// Current exercise being added to routine
let currentExerciseToAdd = null;
// Sample routines data
const routines = {
morning: {
name: "Morning Routine",
description: "Start your day with energy and focus",
exercises: [
{ title: "Neck Stretches", duration: "2 min", icon: "hands-helping" },
{ title: "Deep Breathing", duration: "1 min", icon: "lungs" },
{ title: "Eye Exercises", duration: "2 min", icon: "eye" }
]
},
afternoon: {
name: "Afternoon Routine",
description: "Recharge during your midday slump",
exercises: [
{ title: "Chair Yoga", duration: "3 min", icon: "chair" },
{ title: "Wrist & Finger", duration: "2 min", icon: "hands" }
]
},
evening: {
name: "Evening Routine",
description: "Wind down after work",
exercises: [
{ title: "Deep Breathing", duration: "2 min", icon: "lungs" },
{ title: "Shoulder Rolls", duration: "1 min", icon: "hands-praying" }
]
},
custom: {
name: "Custom Routine",
description: "Your personalized wellness routine",
exercises: []
}
};
// Initialize SortableJS for drag and drop routine items
new Sortable(routineContainer, {
animation: 150,
handle: '.activity-icon',
ghostClass: 'dragging',
onEnd: function() {
updateEmptyRoutineMessage();
updateRoutineStats();
}
});
// Show auth modal on page load
window.addEventListener('load', () => {
authModal.classList.remove('hidden');
});
// Auth modal handlers
closeAuth.addEventListener('click', () => {
if (!isAuthenticated) return; // Don't allow closing if not authenticated
authModal.classList.add('hidden');
});
showSignup.addEventListener('click', () => {
loginForm.classList.add('hidden');
signupForm.classList.remove('hidden');
});
showLogin.addEventListener('click', () => {
signupForm.classList.add('hidden');
loginForm.classList.remove('hidden');
});
loginBtn.addEventListener('click', () => {
const email = document.getElementById('login-email').value;
const password = document.getElementById('login-password').value;
if (!email || !password) {
alert('Please enter both email and password');
return;
}
// In a real app, you would validate credentials with a backend
currentUser = {
name: email.split('@')[0],
email: email
};
isAuthenticated = true;
// Update UI
avatar.textContent = currentUser.name.charAt(0).toUpperCase();
usernameDisplay.textContent = currentUser.name;
// Hide auth modal and show main content
authModal.classList.add('hidden');
mainContent.classList.remove('hidden');
});
signupBtn.addEventListener('click', () => {
const name = document.getElementById('signup-name').value;
const email = document.getElementById('signup-email').value;
const password = document.getElementById('signup-password').value;
const confirmPassword = document.getElementById('signup-confirm-password').value;
if (!name || !email || !password || !confirmPassword) {
alert('Please fill in all fields');
return;
}
if (password !== confirmPassword) {
alert('Passwords do not match');
return;
}
// In a real app, you would create the account with a backend
currentUser = {
name: name,
email: email
};
isAuthenticated = true;
// Update UI
avatar.textContent = currentUser.name.charAt(0).toUpperCase();
usernameDisplay.textContent = currentUser.name;
// Hide auth modal and show main content
authModal.classList.add('hidden');
mainContent.classList.remove('hidden');
});
logoutBtn.addEventListener('click', () => {
isAuthenticated = false;
currentUser = null;
mainContent.classList.add('hidden');
authModal.classList.remove('hidden');
});
// Modal handlers
statsBtn.addEventListener('click', () => {
statsModal.classList.remove('hidden');
});
closeStats.addEventListener('click', () => {
statsModal.classList.add('hidden');
});
// Routine selector handler
routineSelector.addEventListener('change', function() {
loadRoutine(this.value);
});
// Save routine handlers
saveRoutineBtn.addEventListener('click', () => {
saveRoutineModal.classList.remove('hidden');
updateRoutineStats();
});
closeSaveRoutine.addEventListener('click', () => {
saveRoutineModal.classList.add('hidden');
});
confirmSaveRoutine.addEventListener('click', () => {
const routineName = document.getElementById('routine-name').value;
const routineDescription = document.getElementById('routine-description').value;
if (!routineName) {
alert('Please enter a name for your routine');
return;
}
// In a real app, you would save the routine to localStorage or a backend
alert(`Routine "${routineName}" saved successfully!`);
saveRoutineModal.classList.add('hidden');
// Update the routine selector
const newOption = document.createElement('option');
newOption.value = routineName.toLowerCase().replace(/\s+/g, '-');
newOption.textContent = routineName;
routineSelector.appendChild(newOption);
routineSelector.value = newOption.value;
});
// Add to routine modal handlers
closeAddToRoutine.addEventListener('click', () => {
addToRoutineModal.classList.add('hidden');
currentExerciseToAdd = null;
});
confirmAddToRoutine.addEventListener('click', () => {
if (!currentExerciseToAdd) return;
const duration = exerciseDuration.value || '2';
const routineId = targetRoutine.value;
// Add to the selected routine
const exerciseCard = currentExerciseToAdd.closest('.exercise-card');
const title = exerciseCard.querySelector('h3').textContent;
const icon = exerciseCard.querySelector('.fa-3x').classList[1].replace('fa-', '');
// In a real app, you would add to the routine data structure
addToRoutine(title, duration + ' min', icon);
addToRoutineModal.classList.add('hidden');
currentExerciseToAdd = null;
});
// Notification handlers
closeNotification.addEventListener('click', () => {
breakNotification.classList.add('hidden');
});
snoozeBreak.addEventListener('click', () => {
breakNotification.classList.add('hidden');
// Snooze for 5 minutes
timeLeft = 5 * 60;
startTimer();
});
startBreak.addEventListener('click', () => {
breakNotification.classList.add('hidden');
isWorking = false;
timeLeft = breakDuration;
updateActivityDisplay("Take a Break", "Time to stretch and relax!");
startTimer();
});
// Dashboard button handlers
takeBreakNow.addEventListener('click', () => {
isWorking = false;
timeLeft = breakDuration;
updateActivityDisplay("Take a Break", "Time to stretch and relax!");
startTimer();
});
skipBtn.addEventListener('click', () => {
isWorking = true;
timeLeft = workDuration;
updateActivityDisplay("Focus Time", "You're currently working. Your next break is scheduled soon.");
startTimer();
});
pauseBtn.addEventListener('click', () => {
if (isTimerPaused) {
// Resume timer
isTimerPaused = false;
pauseBtn.innerHTML = '<i class="fas fa-pause"></i>';
pauseBtn.title = "Pause";
startTimer();
} else {
// Pause timer
isTimerPaused = true;
clearInterval(timer);
pauseBtn.innerHTML = '<i class="fas fa-play"></i>';
pauseBtn.title = "Resume";
}
});
// Timer adjustment handlers
decreaseTimeBtn.addEventListener('mousedown', startDecreasingTime);
decreaseTimeBtn.addEventListener('touchstart', startDecreasingTime);
decreaseTimeBtn.addEventListener('mouseup', stopAdjustingTime);
decreaseTimeBtn.addEventListener('mouseleave', stopAdjustingTime);
decreaseTimeBtn.addEventListener('touchend', stopAdjustingTime);
increaseTimeBtn.addEventListener('mousedown', startIncreasingTime);
increaseTimeBtn.addEventListener('touchstart', startIncreasingTime);
increaseTimeBtn.addEventListener('mouseup', stopAdjustingTime);
increaseTimeBtn.addEventListener('mouseleave', stopAdjustingTime);
increaseTimeBtn.addEventListener('touchend', stopAdjustingTime);
function startDecreasingTime() {
adjustTime(-1);
holdTimeout = setTimeout(() => {
isHolding = true;
decreaseInterval = setInterval(() => {
adjustTime(-5); // Faster decrease after holding for 2 seconds
}, 100);
}, 2000);
}
function startIncreasingTime() {
adjustTime(1);
holdTimeout = setTimeout(() => {
isHolding = true;
increaseInterval = setInterval(() => {
adjustTime(5); // Faster increase after holding for 2 seconds
}, 100);
}, 2000);
}
function stopAdjustingTime() {
clearTimeout(holdTimeout);
clearInterval(decreaseInterval);
clearInterval(increaseInterval);
isHolding = false;
}
function adjustTime(seconds) {
timeLeft = Math.max(0, timeLeft + seconds);
updateTimerDisplay();
}
// Load more activities handler
loadMoreBtn.addEventListener('click', () => {
const hiddenCards = document.querySelectorAll('.exercise-card.hidden-row');
const cardsToShow = Math.min(3, hiddenCards.length);
for (let i = 0; i < cardsToShow; i++) {
hiddenCards[i].classList.remove('hidden-row');
}
// Hide button if no more cards to show
if (hiddenCards.length <= 3) {
loadMoreBtn.classList.add('hidden');
}
});
// Add event listeners to all "Add to Routine" buttons
document.querySelectorAll('.add-to-routine').forEach(button => {
button.addEventListener('click', function() {
currentExerciseToAdd = this;
addToRoutineModal.classList.remove('hidden');
// Set default duration based on exercise
const durationText = this.closest('.exercise-card').querySelector('.text-sm.text-gray-500').textContent;
const defaultDuration = durationText.includes('min') ? durationText.split(' ')[0] : '2';
exerciseDuration.value = defaultDuration;
});
});
// Add event listeners to all favorite buttons
document.querySelectorAll('.favorite-btn').forEach(button => {
button.addEventListener('click', function() {
this.classList.toggle('active');
const icon = this.querySelector('i');
if (icon.classList.contains('far')) {
icon.classList.remove('far');
icon.classList.add('fas');
} else {
icon.classList.remove('fas');
icon.classList.add('far');
}
// In a real app, you would save the favorite status
});
});
// Add event listeners to all remove buttons in routine items
routineContainer.addEventListener('click', function(e) {
if (e.target.closest('.routine-item') && e.target.closest('.fa-times')) {
e.target.closest('.routine-item').remove();
updateEmptyRoutineMessage();
updateRoutineStats();
}
});
function loadRoutine(routineId) {
routineContainer.innerHTML = '';
const routine = routines[routineId];
if (!routine) return;
routine.exercises.forEach(exercise => {
addToRoutine(exercise.title, exercise.duration, exercise.icon);
});
updateEmptyRoutineMessage();
updateRoutineStats();
}
function addToRoutine(title, duration, icon) {
emptyRoutineMessage.classList.add('hidden');
const routineItem = document.createElement('div');
routineItem.className = 'routine-item bg-light rounded-lg p-3 flex flex-col border border-gray-200';
routineItem.innerHTML = `
<div class="flex items-center justify-between mb-2">
<div class="activity-icon">
<i class="fas fa-${icon} text-xs"></i>
</div>
<button class="text-gray-400 hover:text-red-500 text-sm">
<i class="fas fa-times"></i>
</button>
</div>
<h3 class="font-semibold text-gray-800 text-sm mb-1">${title}</h3>
<p class="text-xs text-gray-500">${duration}</p>
`;
routineContainer.appendChild(routineItem);
updateRoutineStats();
}
function updateEmptyRoutineMessage() {
if (routineContainer.children.length === 0) {
emptyRoutineMessage.classList.remove('hidden');
} else {
emptyRoutineMessage.classList.add('hidden');
}
}
function updateRoutineStats() {
let totalTime = 0;
const exercises = [];
const activityTypes = new Set();
document.querySelectorAll('.routine-item').forEach(item => {
const durationText = item.querySelector('.text-xs.text-gray-500').textContent;
const duration = parseInt(durationText) || 0;
totalTime += duration;
const title = item.querySelector('h3').textContent;
exercises.push(title + ' (' + durationText + ')');
const iconClass = item.querySelector('.activity-icon i').classList[1];
if (iconClass.includes('hands')) activityTypes.add('Stretching');
if (iconClass.includes('lungs')) activityTypes.add('Breathing');
if (iconClass.includes('eye')) activityTypes.add('Eye Care');
if (iconClass.includes('chair')) activityTypes.add('Yoga');
if (iconClass.includes('water')) activityTypes.add('Hydration');
});
// Update the total time display
routineTotalTime.textContent = totalTime;
// Update the summary in the save modal
if (saveRoutineModal) {
const totalTimeElement = saveRoutineModal.querySelector('.bg-light .font-bold.text-primary');
if (totalTimeElement) {
totalTimeElement.textContent = totalTime + ' minutes';
}
const activitiesContainer = saveRoutineModal.querySelector('.flex-wrap.gap-2');
if (activitiesContainer) {
activitiesContainer.innerHTML = '';
activityTypes.forEach(type => {
let icon = 'spa';
if (type === 'Stretching') icon = 'hands-helping';
if (type === 'Breathing') icon = 'lungs';
if (type === 'Eye Care') icon = 'eye';
if (type === 'Yoga') icon = 'chair';
if (type === 'Hydration') icon = 'water';
const activityPill = document.createElement('div');
activityPill.className = 'flex items-center bg-white px-3 py-1 rounded-full text-sm';
activityPill.innerHTML = `
<div class="activity-icon mr-2">
<i class="fas fa-${icon} text-xs"></i>
</div>
${type}
`;
activitiesContainer.appendChild(activityPill);
});
}
const exercisesList = saveRoutineModal.querySelector('.list-disc');
if (exercisesList) {
exercisesList.innerHTML = exercises.map(ex => `<li>${ex}</li>`).join('');
}
}
}
// Activities library search and filter
exerciseSearch.addEventListener('input', filterExercises);
exerciseFilter.addEventListener('change', filterExercises);
function filterExercises() {
const searchTerm = exerciseSearch.value.toLowerCase();
const filterValue = exerciseFilter.value;
document.querySelectorAll('.exercise-card').forEach(card => {
const title = card.querySelector('h3').textContent.toLowerCase();
const description = card.querySelector('p').textContent.toLowerCase();
const category = card.dataset.category;
const isFavorite = card.querySelector('.favorite-btn').classList.contains('active');
const matchesSearch = title.includes(searchTerm) || description.includes(searchTerm);
const matchesFilter = filterValue === 'all' ||
(filterValue === 'favorites' && isFavorite) ||
(filterValue !== 'favorites' && category === filterValue);
if (matchesSearch && matchesFilter) {
card.style.display = 'block';
} else {
card.style.display = 'none';
}
});
}
// Timer functions
function startTimer() {
if (isTimerPaused) return;
clearInterval(timer);
timer = setInterval(updateTimer, 1000);
}
function updateTimer() {
if (isTimerPaused) return;
timeLeft--;
if (timeLeft <= 0) {
clearInterval(timer);
if (isWorking) {
// Time for a break
breakNotification.classList.remove('hidden');
} else {
// Break is over, back to work
isWorking = true;
timeLeft = workDuration;
updateActivityDisplay("Focus Time", "You're currently working. Your next break is scheduled soon.");
startTimer();
}
}
updateTimerDisplay();
}
function updateTimerDisplay() {
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
document.getElementById('time-remaining').textContent =
`${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
// Update progress circle
const totalTime = isWorking ? workDuration : breakDuration;
const progress = (totalTime - timeLeft) / totalTime;
const circumference = 251.2; // 2 * π * r (where r=40)
const offset = circumference - (progress * circumference);
document.getElementById('progress-circle').style.strokeDashoffset = offset;
}
function updateActivityDisplay(nextActivity, currentActivity) {
document.getElementById('next-activity').textContent = `Next: ${nextActivity}`;
document.getElementById('current-activity').innerHTML = `<p class="text-gray-600">${currentActivity}</p>`;
}
// Initialize
updateActivityDisplay("Stretch", "You're currently working. Your next break is scheduled soon.");
startTimer();
updateEmptyRoutineMessage();
loadRoutine('morning');
// Set one exercise as favorite by default for demo
document.querySelector('.exercise-card[data-category="eye"] .favorite-btn').classList.add('active');
</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=tframe/deskrefresh" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Desk Refresh</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://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#10b981',
secondary: '#059669',
accent: '#6ee7b7',
light: '#ecfdf5',
dark: '#064e3b',
}
}
}
}
</script>
<style>
.exercise-card {
transition: all 0.3s ease;
}
.exercise-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
.animate-pulse-slow {
animation: pulse 3s infinite;
}
.routine-item {
cursor: grab;
transition: all 0.2s ease;
flex: 0 0 auto;
width: 180px;
}
.routine-item:active {
cursor: grabbing;
}
.routine-item.dragging {
opacity: 0.5;
background-color: '#d1fae5';
}
.routine-scroll-container {
display: flex;
overflow-x: auto;
padding-bottom: 10px;
gap: 12px;
}
.routine-scroll-container::-webkit-scrollbar {
height: 6px;
}
.routine-scroll-container::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
.routine-scroll-container::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 10px;
}
.routine-scroll-container::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.7;
}
}
.favorite-btn.active {
color: #f59e0b;
}
.activity-icon {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: #d1fae5;
color: #059669;
}
.auth-modal {
background-color: rgba(0,0,0,0.7);
}
.auth-content {
animation: fadeIn 0.3s ease-out;
}