Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +860 -18
- prompts.txt +0 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: cravecontrol
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,861 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Dashboard | CraveControl</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
|
| 10 |
+
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 12 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 13 |
+
<style>
|
| 14 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
|
| 15 |
+
@keyframes confetti {
|
| 16 |
+
0% { transform: translateY(0) rotate(0deg); opacity: 1; }
|
| 17 |
+
100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
|
| 18 |
+
}
|
| 19 |
+
.confetti {
|
| 20 |
+
position: fixed;
|
| 21 |
+
width: 10px;
|
| 22 |
+
height: 10px;
|
| 23 |
+
background-color: #f00;
|
| 24 |
+
opacity: 0;
|
| 25 |
+
z-index: 9999;
|
| 26 |
+
animation: confetti 2s ease-out forwards;
|
| 27 |
+
}
|
| 28 |
+
.goal-modal,
|
| 29 |
+
.celebration-modal,
|
| 30 |
+
.reminder-modal {
|
| 31 |
+
position: fixed;
|
| 32 |
+
top: 50%;
|
| 33 |
+
left: 50%;
|
| 34 |
+
transform: translate(-50%, -50%);
|
| 35 |
+
background-color: white;
|
| 36 |
+
padding: 2rem;
|
| 37 |
+
border-radius: 12px;
|
| 38 |
+
box-shadow: 0 10px 25px rgba(0,0,0,0.1);
|
| 39 |
+
z-index: 100;
|
| 40 |
+
text-align: center;
|
| 41 |
+
max-width: 90%;
|
| 42 |
+
display: none;
|
| 43 |
+
animation: pulse 0.5s ease-in-out;
|
| 44 |
+
}
|
| 45 |
+
.celebration-modal h3,
|
| 46 |
+
.reminder-modal h3 {
|
| 47 |
+
font-size: 1.5rem;
|
| 48 |
+
margin-bottom: 1rem;
|
| 49 |
+
}
|
| 50 |
+
.celebration-modal h3 {
|
| 51 |
+
color: #4f46e5;
|
| 52 |
+
}
|
| 53 |
+
.reminder-modal h3 {
|
| 54 |
+
color: #ef4444;
|
| 55 |
+
}
|
| 56 |
+
.celebration-close,
|
| 57 |
+
.reminder-close {
|
| 58 |
+
position: absolute;
|
| 59 |
+
top: 0.5rem;
|
| 60 |
+
right: 0.5rem;
|
| 61 |
+
background: none;
|
| 62 |
+
border: none;
|
| 63 |
+
font-size: 1.2rem;
|
| 64 |
+
cursor: pointer;
|
| 65 |
+
color: #6b7280;
|
| 66 |
+
}
|
| 67 |
+
.goal-overlay,
|
| 68 |
+
.celebration-overlay,
|
| 69 |
+
.reminder-overlay {
|
| 70 |
+
position: fixed;
|
| 71 |
+
top: 0;
|
| 72 |
+
left: 0;
|
| 73 |
+
right: 0;
|
| 74 |
+
bottom: 0;
|
| 75 |
+
background-color: rgba(0,0,0,0.5);
|
| 76 |
+
z-index: 99;
|
| 77 |
+
display: none;
|
| 78 |
+
}
|
| 79 |
+
@keyframes pulse {
|
| 80 |
+
0% { transform: translate(-50%, -50%) scale(1); }
|
| 81 |
+
50% { transform: translate(-50%, -50%) scale(1.05); }
|
| 82 |
+
100% { transform: translate(-50%, -50%) scale(1); }
|
| 83 |
+
}
|
| 84 |
+
.shake {
|
| 85 |
+
animation: shake 0.5s ease-in-out;
|
| 86 |
+
}
|
| 87 |
+
@keyframes shake {
|
| 88 |
+
0%, 100% { transform: translate(-50%, -50%); }
|
| 89 |
+
20%, 60% { transform: translate(-52%, -50%); }
|
| 90 |
+
40%, 80% { transform: translate(-48%, -50%); }
|
| 91 |
+
}
|
| 92 |
+
body {
|
| 93 |
+
font-family: 'Poppins', sans-serif;
|
| 94 |
+
position: relative;
|
| 95 |
+
overflow-x: hidden;
|
| 96 |
+
}
|
| 97 |
+
.progress-ring__circle {
|
| 98 |
+
transition: stroke-dashoffset 0.5s;
|
| 99 |
+
transform: rotate(-90deg);
|
| 100 |
+
transform-origin: 50% 50%;
|
| 101 |
+
}
|
| 102 |
+
.candy-stripe {
|
| 103 |
+
background: repeating-linear-gradient(
|
| 104 |
+
45deg,
|
| 105 |
+
rgba(255,255,255,0.1),
|
| 106 |
+
rgba(255,255,255,0.1) 10px,
|
| 107 |
+
rgba(255,255,255,0.15) 10px,
|
| 108 |
+
rgba(255,255,255,0.15) 20px
|
| 109 |
+
);
|
| 110 |
+
}
|
| 111 |
+
.sidebar {
|
| 112 |
+
transition: transform 0.3s ease-in-out;
|
| 113 |
+
z-index: 30;
|
| 114 |
+
overflow-y: auto;
|
| 115 |
+
-webkit-overflow-scrolling: touch;
|
| 116 |
+
}
|
| 117 |
+
.sidebar-overlay {
|
| 118 |
+
position: fixed;
|
| 119 |
+
top: 0;
|
| 120 |
+
left: 0;
|
| 121 |
+
right: 0;
|
| 122 |
+
bottom: 0;
|
| 123 |
+
background-color: rgba(0,0,0,0.5);
|
| 124 |
+
z-index: 20;
|
| 125 |
+
opacity: 0;
|
| 126 |
+
visibility: hidden;
|
| 127 |
+
transition: opacity 0.3s ease, visibility 0.3s ease;
|
| 128 |
+
}
|
| 129 |
+
.sidebar-overlay.active {
|
| 130 |
+
opacity: 1;
|
| 131 |
+
visibility: visible;
|
| 132 |
+
}
|
| 133 |
+
@media (max-width: 768px) {
|
| 134 |
+
.sidebar {
|
| 135 |
+
transform: translateX(-100%);
|
| 136 |
+
position: fixed;
|
| 137 |
+
height: 100vh;
|
| 138 |
+
top: 0;
|
| 139 |
+
left: 0;
|
| 140 |
+
}
|
| 141 |
+
.sidebar.active {
|
| 142 |
+
transform: translateX(0);
|
| 143 |
+
}
|
| 144 |
+
body.sidebar-open {
|
| 145 |
+
overflow: hidden;
|
| 146 |
+
position: fixed;
|
| 147 |
+
width: 100%;
|
| 148 |
+
height: 100%;
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
</style>
|
| 152 |
+
</head>
|
| 153 |
+
<body class="bg-gray-50">
|
| 154 |
+
<!-- Fixed Header with Title and Menu Button -->
|
| 155 |
+
<header class="bg-indigo-600 text-white fixed w-full z-10">
|
| 156 |
+
<div class="p-4 flex items-center justify-center relative">
|
| 157 |
+
<button id="menu-toggle" class="absolute left-4 focus:outline-none">
|
| 158 |
+
<i data-feather="menu" class="w-6 h-6"></i>
|
| 159 |
+
</button>
|
| 160 |
+
<h1 class="text-xl font-bold">CraveControl</h1>
|
| 161 |
+
</div>
|
| 162 |
+
</header>
|
| 163 |
+
<div id="sidebar-overlay" class="sidebar-overlay"></div>
|
| 164 |
+
|
| 165 |
+
<!-- Sidebar -->
|
| 166 |
+
<div class="sidebar fixed inset-y-0 left-0 w-64 bg-white shadow-lg z-20 md:relative md:translate-x-0" style="overflow-y: auto;">
|
| 167 |
+
<div class="p-6 border-b border-gray-200">
|
| 168 |
+
<h1 class="text-2xl font-bold text-indigo-600 flex items-center">
|
| 169 |
+
<i data-feather="zap" class="mr-2"></i>
|
| 170 |
+
CraveControl
|
| 171 |
+
</h1>
|
| 172 |
+
</div>
|
| 173 |
+
<nav class="p-4">
|
| 174 |
+
<div class="mb-8">
|
| 175 |
+
<div class="flex items-center mb-6">
|
| 176 |
+
<img src="http://static.photos/people/200x200/4" alt="User" class="w-10 h-10 rounded-full mr-3">
|
| 177 |
+
<div>
|
| 178 |
+
<p class="font-medium">Welcome back,</p>
|
| 179 |
+
<p class="font-bold">Alex M.</p>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
<div class="bg-indigo-50 rounded-lg p-3 mb-4">
|
| 183 |
+
<div class="flex justify-between items-center mb-1">
|
| 184 |
+
<span class="text-xs font-medium text-indigo-600">Weekly Goal</span>
|
| 185 |
+
<span class="text-xs text-indigo-600">€12/€20</span>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="w-full bg-indigo-100 rounded-full h-2">
|
| 188 |
+
<div class="bg-indigo-600 h-2 rounded-full" style="width: 60%"></div>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
<div class="flex items-center justify-between bg-indigo-600 text-white rounded-lg p-3">
|
| 192 |
+
<div>
|
| 193 |
+
<p class="text-xs">Current Streak</p>
|
| 194 |
+
<p class="font-bold">0 days</p>
|
| 195 |
+
</div>
|
| 196 |
+
<i data-feather="award" class="w-5 h-5"></i>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
|
| 200 |
+
<ul class="space-y-2">
|
| 201 |
+
<li>
|
| 202 |
+
<a href="#" class="flex items-center p-3 rounded-lg bg-indigo-100 text-indigo-700 font-medium">
|
| 203 |
+
<i data-feather="home" class="w-5 h-5 mr-3"></i>
|
| 204 |
+
Dashboard
|
| 205 |
+
</a>
|
| 206 |
+
</li>
|
| 207 |
+
<li>
|
| 208 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 209 |
+
<i data-feather="dollar-sign" class="w-5 h-5 mr-3"></i>
|
| 210 |
+
Savings
|
| 211 |
+
</a>
|
| 212 |
+
</li>
|
| 213 |
+
<li>
|
| 214 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 215 |
+
<i data-feather="target" class="w-5 h-5 mr-3"></i>
|
| 216 |
+
Goals
|
| 217 |
+
</a>
|
| 218 |
+
</li>
|
| 219 |
+
<li>
|
| 220 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 221 |
+
<i data-feather="award" class="w-5 h-5 mr-3"></i>
|
| 222 |
+
Achievements
|
| 223 |
+
</a>
|
| 224 |
+
</li>
|
| 225 |
+
<li>
|
| 226 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 227 |
+
<i data-feather="users" class="w-5 h-5 mr-3"></i>
|
| 228 |
+
Community
|
| 229 |
+
</a>
|
| 230 |
+
</li>
|
| 231 |
+
<li>
|
| 232 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 233 |
+
<i data-feather="bar-chart-2" class="w-5 h-5 mr-3"></i>
|
| 234 |
+
Insights
|
| 235 |
+
</a>
|
| 236 |
+
</li>
|
| 237 |
+
<li>
|
| 238 |
+
<a href="#" class="flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 239 |
+
<i data-feather="settings" class="w-5 h-5 mr-3"></i>
|
| 240 |
+
Settings
|
| 241 |
+
</a>
|
| 242 |
+
</li>
|
| 243 |
+
<li>
|
| 244 |
+
<button onclick="resetApp()" class="w-full flex items-center p-3 rounded-lg text-gray-700 hover:bg-gray-100 transition">
|
| 245 |
+
<i data-feather="refresh-cw" class="w-5 h-5 mr-3"></i>
|
| 246 |
+
Reset App
|
| 247 |
+
</button>
|
| 248 |
+
</li>
|
| 249 |
+
</ul>
|
| 250 |
+
</nav>
|
| 251 |
+
</div>
|
| 252 |
+
|
| 253 |
+
<!-- Main Content -->
|
| 254 |
+
<div class="md:ml-64 pt-16 md:pt-0">
|
| 255 |
+
<!-- Desktop Header -->
|
| 256 |
+
<header class="hidden md:flex items-center justify-between p-6 bg-white border-b border-gray-200">
|
| 257 |
+
<h2 class="text-2xl font-bold text-gray-800">Dashboard</h2>
|
| 258 |
+
<div class="flex items-center space-x-4">
|
| 259 |
+
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 transition">
|
| 260 |
+
<i data-feather="bell" class="w-5 h-5"></i>
|
| 261 |
+
</button>
|
| 262 |
+
<div class="flex items-center">
|
| 263 |
+
<img src="http://static.photos/people/200x200/4" alt="User" class="w-8 h-8 rounded-full mr-2">
|
| 264 |
+
<span class="font-medium">Alex</span>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
</header>
|
| 268 |
+
|
| 269 |
+
<main class="p-6 mt-4 md:mt-0"> <!-- Add margin top for mobile -->
|
| 270 |
+
<!-- Quick Log Section -->
|
| 271 |
+
<div class="bg-white rounded-xl shadow-sm p-6 mb-6" data-aos="fade-up" id="dashboard-stats">
|
| 272 |
+
<div class="flex justify-between items-center mb-4">
|
| 273 |
+
<h3 class="text-lg font-semibold text-gray-800">Log a Resisted Craving</h3>
|
| 274 |
+
<button class="text-sm text-indigo-600 font-medium hover:text-indigo-800 transition">
|
| 275 |
+
View History
|
| 276 |
+
</button>
|
| 277 |
+
</div>
|
| 278 |
+
<form class="space-y-4">
|
| 279 |
+
<div>
|
| 280 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">What did you resist?</label>
|
| 281 |
+
<input type="text" placeholder="e.g. Afternoon coffee" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 282 |
+
</div>
|
| 283 |
+
<div class="grid grid-cols-2 gap-4">
|
| 284 |
+
<div>
|
| 285 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Amount Saved</label>
|
| 286 |
+
<div class="relative">
|
| 287 |
+
<span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">€</span>
|
| 288 |
+
<input type="number" step="0.01" placeholder="0.00" class="w-full pl-8 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 transition">
|
| 289 |
+
</div>
|
| 290 |
+
</div>
|
| 291 |
+
<div>
|
| 292 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Goal</label>
|
| 293 |
+
<select id="goal-select" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 294 |
+
<option value="general">General</option>
|
| 295 |
+
</select>
|
| 296 |
+
</div>
|
| 297 |
+
</div>
|
| 298 |
+
<div>
|
| 299 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Notes (optional)</label>
|
| 300 |
+
<textarea rows="2" placeholder="Why did you have this craving? How did you resist?" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"></textarea>
|
| 301 |
+
</div>
|
| 302 |
+
<div class="flex justify-end">
|
| 303 |
+
<button type="submit" id="log-craving-btn" class="bg-indigo-600 text-white px-6 py-2 rounded-lg font-medium hover:bg-indigo-700 transition flex items-center">
|
| 304 |
+
<i data-feather="plus" class="w-4 h-4 mr-2"></i>
|
| 305 |
+
Add to Savings
|
| 306 |
+
</button>
|
| 307 |
+
</div>
|
| 308 |
+
</form>
|
| 309 |
+
</div>
|
| 310 |
+
|
| 311 |
+
<!-- Stats Overview -->
|
| 312 |
+
<div class="grid md:grid-cols-4 gap-6 mb-6">
|
| 313 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up" data-aos-delay="100">
|
| 314 |
+
<div class="flex justify-between items-start">
|
| 315 |
+
<div>
|
| 316 |
+
<p class="text-sm font-medium text-gray-500">Total Saved</p>
|
| 317 |
+
<p class="text-2xl font-bold text-gray-800">€0.00</p>
|
| 318 |
+
</div>
|
| 319 |
+
<div class="p-2 bg-indigo-100 rounded-lg text-indigo-600">
|
| 320 |
+
<i data-feather="dollar-sign" class="w-5 h-5"></i>
|
| 321 |
+
</div>
|
| 322 |
+
</div>
|
| 323 |
+
<div class="mt-4">
|
| 324 |
+
<p class="text-xs text-gray-500">Start tracking your savings</p>
|
| 325 |
+
</div>
|
| 326 |
+
</div>
|
| 327 |
+
|
| 328 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up" data-aos-delay="200">
|
| 329 |
+
<div class="flex justify-between items-start">
|
| 330 |
+
<div>
|
| 331 |
+
<p class="text-sm font-medium text-gray-500">Current Streak</p>
|
| 332 |
+
<p class="text-2xl font-bold text-gray-800">5 days</p>
|
| 333 |
+
</div>
|
| 334 |
+
<div class="p-2 bg-green-100 rounded-lg text-green-600">
|
| 335 |
+
<i data-feather="calendar" class="w-5 h-5"></i>
|
| 336 |
+
</div>
|
| 337 |
+
</div>
|
| 338 |
+
<div class="mt-4">
|
| 339 |
+
<p class="text-xs text-gray-500">Start your streak today</p>
|
| 340 |
+
</div>
|
| 341 |
+
</div>
|
| 342 |
+
|
| 343 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up" data-aos-delay="300">
|
| 344 |
+
<div class="flex justify-between items-start">
|
| 345 |
+
<div>
|
| 346 |
+
<p class="text-sm font-medium text-gray-500">Cravings Resisted</p>
|
| 347 |
+
<p class="text-2xl font-bold text-gray-800">0</p>
|
| 348 |
+
</div>
|
| 349 |
+
<div class="p-2 bg-purple-100 rounded-lg text-purple-600">
|
| 350 |
+
<i data-feather="check" class="w-5 h-5"></i>
|
| 351 |
+
</div>
|
| 352 |
+
</div>
|
| 353 |
+
<div class="mt-4">
|
| 354 |
+
<p class="text-xs text-gray-500">Log your first craving</p>
|
| 355 |
+
</div>
|
| 356 |
+
</div>
|
| 357 |
+
|
| 358 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up" data-aos-delay="400">
|
| 359 |
+
<div class="flex justify-between items-start">
|
| 360 |
+
<div>
|
| 361 |
+
<p class="text-sm font-medium text-gray-500">Badges Earned</p>
|
| 362 |
+
<p class="text-2xl font-bold text-gray-800">0</p>
|
| 363 |
+
</div>
|
| 364 |
+
<div class="p-2 bg-yellow-100 rounded-lg text-yellow-600">
|
| 365 |
+
<i data-feather="award" class="w-5 h-5"></i>
|
| 366 |
+
</div>
|
| 367 |
+
</div>
|
| 368 |
+
<div class="mt-4">
|
| 369 |
+
<p class="text-xs text-gray-500">Earn your first badge</p>
|
| 370 |
+
</div>
|
| 371 |
+
</div>
|
| 372 |
+
</div>
|
| 373 |
+
|
| 374 |
+
<!-- Goals Progress -->
|
| 375 |
+
<div class="grid md:grid-cols-2 gap-6 mb-6">
|
| 376 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up">
|
| 377 |
+
<div class="flex justify-between items-center mb-4">
|
| 378 |
+
<h3 class="text-lg font-semibold text-gray-800">Active Goals</h3>
|
| 379 |
+
<button class="text-sm text-indigo-600 font-medium hover:text-indigo-800 transition">
|
| 380 |
+
View All
|
| 381 |
+
</button>
|
| 382 |
+
</div>
|
| 383 |
+
|
| 384 |
+
<div class="space-y-4" id="goals-container">
|
| 385 |
+
<div class="text-center py-8 text-gray-500">
|
| 386 |
+
<i data-feather="target" class="w-12 h-12 mx-auto mb-2"></i>
|
| 387 |
+
<p>No active goals</p>
|
| 388 |
+
</div>
|
| 389 |
+
<button onclick="showGoalModal()" class="w-full border-2 border-dashed border-gray-300 rounded-lg p-4 text-gray-500 hover:border-indigo-300 hover:text-indigo-600 transition flex items-center justify-center">
|
| 390 |
+
<i data-feather="plus" class="w-4 h-4 mr-2"></i>
|
| 391 |
+
Add New Goal
|
| 392 |
+
</button>
|
| 393 |
+
</div>
|
| 394 |
+
</div>
|
| 395 |
+
|
| 396 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up" data-aos-delay="200">
|
| 397 |
+
<div class="flex justify-between items-center mb-4">
|
| 398 |
+
<h3 class="text-lg font-semibold text-gray-800">Recent Achievements</h3>
|
| 399 |
+
<button class="text-sm text-indigo-600 font-medium hover:text-indigo-800 transition">
|
| 400 |
+
View All
|
| 401 |
+
</button>
|
| 402 |
+
</div>
|
| 403 |
+
|
| 404 |
+
<div class="space-y-4" id="achievements-container">
|
| 405 |
+
<div class="text-center py-8 text-gray-500">
|
| 406 |
+
<i data-feather="award" class="w-12 h-12 mx-auto mb-2"></i>
|
| 407 |
+
<p>No achievements yet</p>
|
| 408 |
+
</div>
|
| 409 |
+
</div>
|
| 410 |
+
</div>
|
| 411 |
+
</div>
|
| 412 |
+
|
| 413 |
+
<!-- Activity Feed -->
|
| 414 |
+
<div class="bg-white rounded-xl shadow-sm p-6" data-aos="fade-up">
|
| 415 |
+
<div class="flex justify-between items-center mb-4">
|
| 416 |
+
<h3 class="text-lg font-semibold text-gray-800">Recent Activity</h3>
|
| 417 |
+
<button class="text-sm text-indigo-600 font-medium hover:text-indigo-800 transition">
|
| 418 |
+
View All
|
| 419 |
+
</button>
|
| 420 |
+
</div>
|
| 421 |
+
|
| 422 |
+
<div class="space-y-4" id="activity-feed">
|
| 423 |
+
<div class="text-center py-8 text-gray-500">
|
| 424 |
+
<i data-feather="inbox" class="w-12 h-12 mx-auto mb-2"></i>
|
| 425 |
+
<p>No activity yet</p>
|
| 426 |
+
</div>
|
| 427 |
+
</div>
|
| 428 |
+
</div>
|
| 429 |
+
</main>
|
| 430 |
+
</div>
|
| 431 |
+
|
| 432 |
+
<!-- Goal Creation Modal -->
|
| 433 |
+
<div class="goal-overlay" id="goal-overlay"></div>
|
| 434 |
+
<div class="goal-modal" id="goal-modal">
|
| 435 |
+
<button class="goal-close" id="goal-close">×</button>
|
| 436 |
+
<h3>Create New Goal</h3>
|
| 437 |
+
<form id="goal-form" class="space-y-4 mt-4">
|
| 438 |
+
<div>
|
| 439 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Goal Name</label>
|
| 440 |
+
<input type="text" id="goal-name" maxlength="50" placeholder="e.g. Coffee Savings" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 441 |
+
</div>
|
| 442 |
+
<div>
|
| 443 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Target Amount (€)</label>
|
| 444 |
+
<input type="number" id="goal-amount" step="0.01" min="0.01" placeholder="0.00" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
|
| 445 |
+
</div>
|
| 446 |
+
<div class="flex justify-end space-x-3">
|
| 447 |
+
<button type="button" onclick="closeGoalModal()" class="px-4 py-2 border border-gray-300 rounded-lg font-medium hover:bg-gray-50 transition">Cancel</button>
|
| 448 |
+
<button type="submit" class="bg-indigo-600 text-white px-6 py-2 rounded-lg font-medium hover:bg-indigo-700 transition">Save Goal</button>
|
| 449 |
+
</div>
|
| 450 |
+
</form>
|
| 451 |
+
</div>
|
| 452 |
+
|
| 453 |
+
<!-- Celebration Modal -->
|
| 454 |
+
<div class="celebration-overlay" id="celebration-overlay"></div>
|
| 455 |
+
<div class="celebration-modal" id="celebration-modal">
|
| 456 |
+
<button class="celebration-close" id="celebration-close">×</button>
|
| 457 |
+
<h3>You resisted a craving! 🎉</h3>
|
| 458 |
+
<p>Way to go! You're building great habits.</p>
|
| 459 |
+
</div>
|
| 460 |
+
|
| 461 |
+
<!-- Reminder Modal -->
|
| 462 |
+
<div class="reminder-overlay" id="reminder-overlay"></div>
|
| 463 |
+
<div class="reminder-modal" id="reminder-modal">
|
| 464 |
+
<button class="reminder-close" id="reminder-close">×</button>
|
| 465 |
+
<h3>Missing Information! ❗</h3>
|
| 466 |
+
<p>Please fill out all required fields to log your craving.</p>
|
| 467 |
+
</div>
|
| 468 |
+
|
| 469 |
+
<script>
|
| 470 |
+
// Celebration functions
|
| 471 |
+
function createConfetti() {
|
| 472 |
+
const colors = ['#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B', '#FFC107', '#FF9800', '#FF5722'];
|
| 473 |
+
|
| 474 |
+
for (let i = 0; i < 100; i++) {
|
| 475 |
+
const confetti = document.createElement('div');
|
| 476 |
+
confetti.className = 'confetti';
|
| 477 |
+
confetti.style.left = Math.random() * 100 + 'vw';
|
| 478 |
+
confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
|
| 479 |
+
confetti.style.animationDelay = Math.random() * 2 + 's';
|
| 480 |
+
document.body.appendChild(confetti);
|
| 481 |
+
|
| 482 |
+
// Remove confetti after animation
|
| 483 |
+
setTimeout(() => {
|
| 484 |
+
confetti.remove();
|
| 485 |
+
}, 2000);
|
| 486 |
+
}
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
function showCelebration() {
|
| 490 |
+
const modal = document.getElementById('celebration-modal');
|
| 491 |
+
const overlay = document.getElementById('celebration-overlay');
|
| 492 |
+
|
| 493 |
+
modal.style.display = 'block';
|
| 494 |
+
overlay.style.display = 'block';
|
| 495 |
+
createConfetti();
|
| 496 |
+
|
| 497 |
+
// Close modal when clicking overlay
|
| 498 |
+
overlay.addEventListener('click', closeCelebration);
|
| 499 |
+
|
| 500 |
+
// Close modal when clicking close button
|
| 501 |
+
document.getElementById('celebration-close').addEventListener('click', closeCelebration);
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
function closeCelebration() {
|
| 505 |
+
const modal = document.getElementById('celebration-modal');
|
| 506 |
+
const overlay = document.getElementById('celebration-overlay');
|
| 507 |
+
|
| 508 |
+
modal.style.display = 'none';
|
| 509 |
+
overlay.style.display = 'none';
|
| 510 |
+
|
| 511 |
+
// Remove event listeners to prevent memory leaks
|
| 512 |
+
overlay.removeEventListener('click', closeCelebration);
|
| 513 |
+
document.getElementById('celebration-close').removeEventListener('click', closeCelebration);
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
// Goal Management
|
| 517 |
+
let goals = [
|
| 518 |
+
{ id: 'general', name: 'General', target: 0, saved: 0 }
|
| 519 |
+
];
|
| 520 |
+
|
| 521 |
+
function showGoalModal() {
|
| 522 |
+
const modal = document.getElementById('goal-modal');
|
| 523 |
+
const overlay = document.getElementById('goal-overlay');
|
| 524 |
+
|
| 525 |
+
modal.style.display = 'block';
|
| 526 |
+
overlay.style.display = 'block';
|
| 527 |
+
|
| 528 |
+
// Close modal when clicking overlay
|
| 529 |
+
overlay.addEventListener('click', closeGoalModal);
|
| 530 |
+
|
| 531 |
+
// Close modal when clicking close button
|
| 532 |
+
document.getElementById('goal-close').addEventListener('click', closeGoalModal);
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
function closeGoalModal() {
|
| 536 |
+
const modal = document.getElementById('goal-modal');
|
| 537 |
+
const overlay = document.getElementById('goal-overlay');
|
| 538 |
+
|
| 539 |
+
modal.style.display = 'none';
|
| 540 |
+
overlay.style.display = 'none';
|
| 541 |
+
document.getElementById('goal-form').reset();
|
| 542 |
+
|
| 543 |
+
// Remove event listeners to prevent memory leaks
|
| 544 |
+
overlay.removeEventListener('click', closeGoalModal);
|
| 545 |
+
document.getElementById('goal-close').removeEventListener('click', closeGoalModal);
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
function addGoal(name, target) {
|
| 549 |
+
// Validate input
|
| 550 |
+
if (!name || !target || target <= 0) {
|
| 551 |
+
alert('Please enter a valid goal name and target amount');
|
| 552 |
+
return;
|
| 553 |
+
}
|
| 554 |
+
|
| 555 |
+
// Trim name to 50 chars if needed
|
| 556 |
+
name = name.substring(0, 50);
|
| 557 |
+
|
| 558 |
+
const id = 'goal-' + Date.now();
|
| 559 |
+
goals.push({ id, name, target, saved: 0 });
|
| 560 |
+
|
| 561 |
+
// Update dropdown
|
| 562 |
+
const select = document.getElementById('goal-select');
|
| 563 |
+
const option = document.createElement('option');
|
| 564 |
+
option.value = id;
|
| 565 |
+
option.textContent = name;
|
| 566 |
+
select.appendChild(option);
|
| 567 |
+
|
| 568 |
+
// Update goals container
|
| 569 |
+
updateGoalsDisplay();
|
| 570 |
+
closeGoalModal();
|
| 571 |
+
|
| 572 |
+
// Focus on the new goal in dropdown
|
| 573 |
+
select.value = id;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
function updateGoalsDisplay() {
|
| 577 |
+
const container = document.getElementById('goals-container');
|
| 578 |
+
const emptyState = container.querySelector('.text-center');
|
| 579 |
+
|
| 580 |
+
if (emptyState) {
|
| 581 |
+
emptyState.remove();
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
// Clear existing goals (except add button)
|
| 585 |
+
document.querySelectorAll('#goals-container > div:not(button)').forEach(el => el.remove());
|
| 586 |
+
|
| 587 |
+
// Add each goal
|
| 588 |
+
goals.forEach(goal => {
|
| 589 |
+
const goalEl = document.createElement('div');
|
| 590 |
+
goalEl.className = 'bg-gray-50 rounded-lg p-4 border border-gray-200';
|
| 591 |
+
goalEl.innerHTML = `
|
| 592 |
+
<div class="flex justify-between items-center mb-2">
|
| 593 |
+
<h4 class="font-medium">${goal.name}</h4>
|
| 594 |
+
${goal.id !== 'general' ?
|
| 595 |
+
`<button onclick="deleteGoal('${goal.id}')" class="text-gray-400 hover:text-red-500">
|
| 596 |
+
<i data-feather="trash-2" class="w-4 h-4"></i>
|
| 597 |
+
</button>` : ''}
|
| 598 |
+
</div>
|
| 599 |
+
<div class="flex justify-between items-center text-xs mb-1">
|
| 600 |
+
<span class="text-gray-500">Saved: €${goal.saved.toFixed(2)}</span>
|
| 601 |
+
<span class="text-gray-500">Target: €${goal.target.toFixed(2)}</span>
|
| 602 |
+
</div>
|
| 603 |
+
<div class="w-full bg-gray-200 rounded-full h-2">
|
| 604 |
+
<div class="bg-indigo-600 h-2 rounded-full" style="width: ${Math.min(100, (goal.saved / goal.target) * 100)}%"></div>
|
| 605 |
+
</div>
|
| 606 |
+
`;
|
| 607 |
+
container.insertBefore(goalEl, container.lastElementChild);
|
| 608 |
+
feather.replace();
|
| 609 |
+
});
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
function deleteGoal(id) {
|
| 613 |
+
if (id === 'general') return; // Prevent deleting General goal
|
| 614 |
+
|
| 615 |
+
if (confirm('Are you sure you want to delete this goal?')) {
|
| 616 |
+
// Move any savings from this goal to General
|
| 617 |
+
const goalToDelete = goals.find(g => g.id === id);
|
| 618 |
+
if (goalToDelete) {
|
| 619 |
+
const generalGoal = goals.find(g => g.id === 'general');
|
| 620 |
+
if (generalGoal) {
|
| 621 |
+
generalGoal.saved += goalToDelete.saved;
|
| 622 |
+
}
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
goals = goals.filter(goal => goal.id !== id);
|
| 626 |
+
|
| 627 |
+
// Remove from dropdown
|
| 628 |
+
const select = document.getElementById('goal-select');
|
| 629 |
+
const option = select.querySelector(`option[value="${id}"]`);
|
| 630 |
+
if (option) option.remove();
|
| 631 |
+
|
| 632 |
+
// Reset selection to General
|
| 633 |
+
select.value = 'general';
|
| 634 |
+
|
| 635 |
+
updateGoalsDisplay();
|
| 636 |
+
}
|
| 637 |
+
}
|
| 638 |
+
|
| 639 |
+
// Initialize app in reset state
|
| 640 |
+
function resetApp() {
|
| 641 |
+
// Clear all stored data
|
| 642 |
+
localStorage.clear();
|
| 643 |
+
sessionStorage.clear();
|
| 644 |
+
|
| 645 |
+
// Clear all UI elements
|
| 646 |
+
document.querySelectorAll('#activity-feed > div:not(.text-center)').forEach(el => el.remove());
|
| 647 |
+
document.querySelectorAll('#goals-container > div:not(.text-center, button)').forEach(el => el.remove());
|
| 648 |
+
document.querySelectorAll('#achievements-container > div:not(.text-center)').forEach(el => el.remove());
|
| 649 |
+
|
| 650 |
+
// Ensure empty state messages are shown
|
| 651 |
+
if (!document.querySelector('#activity-feed .text-center')) {
|
| 652 |
+
const emptyActivity = document.createElement('div');
|
| 653 |
+
emptyActivity.className = 'text-center py-8 text-gray-500';
|
| 654 |
+
emptyActivity.innerHTML = `
|
| 655 |
+
<i data-feather="inbox" class="w-12 h-12 mx-auto mb-2"></i>
|
| 656 |
+
<p>No activity yet</p>
|
| 657 |
+
`;
|
| 658 |
+
document.getElementById('activity-feed').appendChild(emptyActivity);
|
| 659 |
+
}
|
| 660 |
+
|
| 661 |
+
// Reset all stats to zero
|
| 662 |
+
document.querySelectorAll('[data-stat="total-saved"]').forEach(el => el.textContent = '€0.00');
|
| 663 |
+
document.querySelectorAll('[data-stat="streak"]').forEach(el => el.textContent = '0 days');
|
| 664 |
+
document.querySelectorAll('[data-stat="cravings-resisted"]').forEach(el => el.textContent = '0');
|
| 665 |
+
document.querySelectorAll('[data-stat="badges-earned"]').forEach(el => el.textContent = '0');
|
| 666 |
+
|
| 667 |
+
// Reset weekly goal progress
|
| 668 |
+
document.querySelector('.progress-ring__circle')?.style.setProperty('stroke-dashoffset', '0');
|
| 669 |
+
document.querySelector('.bg-indigo-600.h-2')?.style.setProperty('width', '0%');
|
| 670 |
+
|
| 671 |
+
// Reset form fields
|
| 672 |
+
document.querySelector('form').reset();
|
| 673 |
+
|
| 674 |
+
// Refresh icons
|
| 675 |
+
feather.replace();
|
| 676 |
+
}
|
| 677 |
+
|
| 678 |
+
// Initialize animations and icons
|
| 679 |
+
AOS.init({
|
| 680 |
+
duration: 800,
|
| 681 |
+
easing: 'ease-in-out',
|
| 682 |
+
once: true
|
| 683 |
+
});
|
| 684 |
+
|
| 685 |
+
feather.replace();
|
| 686 |
+
|
| 687 |
+
// Initialize app with General goal
|
| 688 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 689 |
+
// Ensure General goal exists
|
| 690 |
+
if (!goals.some(g => g.id === 'general')) {
|
| 691 |
+
goals.unshift({ id: 'general', name: 'General', target: 0, saved: 0 });
|
| 692 |
+
}
|
| 693 |
+
|
| 694 |
+
// Reset app state
|
| 695 |
+
resetApp();
|
| 696 |
+
|
| 697 |
+
// Update goals display
|
| 698 |
+
updateGoalsDisplay();
|
| 699 |
+
});
|
| 700 |
+
|
| 701 |
+
// Handle form submission
|
| 702 |
+
document.querySelector('form').addEventListener('submit', function(e) {
|
| 703 |
+
e.preventDefault();
|
| 704 |
+
const form = e.target;
|
| 705 |
+
const cravingInput = form.querySelector('input[type="text"]');
|
| 706 |
+
const amountInput = form.querySelector('input[type="number"]');
|
| 707 |
+
|
| 708 |
+
if (!cravingInput.value.trim() || !amountInput.value) {
|
| 709 |
+
showReminder();
|
| 710 |
+
document.getElementById('reminder-modal').classList.add('shake');
|
| 711 |
+
setTimeout(() => {
|
| 712 |
+
document.getElementById('reminder-modal').classList.remove('shake');
|
| 713 |
+
}, 500);
|
| 714 |
+
|
| 715 |
+
// Highlight empty fields
|
| 716 |
+
if (!cravingInput.value.trim()) {
|
| 717 |
+
cravingInput.classList.add('border-red-500');
|
| 718 |
+
cravingInput.focus();
|
| 719 |
+
} else if (!amountInput.value) {
|
| 720 |
+
amountInput.classList.add('border-red-500');
|
| 721 |
+
amountInput.focus();
|
| 722 |
+
}
|
| 723 |
+
return;
|
| 724 |
+
}
|
| 725 |
+
|
| 726 |
+
// Handle goal form submission
|
| 727 |
+
document.getElementById('goal-form').addEventListener('submit', function(e) {
|
| 728 |
+
e.preventDefault();
|
| 729 |
+
const name = document.getElementById('goal-name').value.trim();
|
| 730 |
+
const amount = parseFloat(document.getElementById('goal-amount').value);
|
| 731 |
+
|
| 732 |
+
addGoal(name, amount);
|
| 733 |
+
});
|
| 734 |
+
|
| 735 |
+
// Simulate form submission
|
| 736 |
+
const activityFeed = document.getElementById('activity-feed');
|
| 737 |
+
const emptyState = activityFeed.querySelector('.text-center');
|
| 738 |
+
|
| 739 |
+
if (emptyState) {
|
| 740 |
+
emptyState.remove();
|
| 741 |
+
}
|
| 742 |
+
|
| 743 |
+
// Add new activity
|
| 744 |
+
const newActivity = document.createElement('div');
|
| 745 |
+
newActivity.className = 'flex items-start p-3 border-b border-gray-100';
|
| 746 |
+
newActivity.innerHTML = `
|
| 747 |
+
<div class="p-2 bg-indigo-100 rounded-full mr-3">
|
| 748 |
+
<i data-feather="dollar-sign" class="w-4 h-4 text-indigo-600"></i>
|
| 749 |
+
</div>
|
| 750 |
+
<div class="flex-1">
|
| 751 |
+
<p class="text-sm">
|
| 752 |
+
<span class="font-medium">You</span> resisted <span class="font-medium">${cravingInput.value}</span> and saved <span class="font-medium">€${amountInput.value}</span>
|
| 753 |
+
</p>
|
| 754 |
+
<p class="text-xs text-gray-500 mt-1">Just now</p>
|
| 755 |
+
</div>
|
| 756 |
+
`;
|
| 757 |
+
activityFeed.prepend(newActivity);
|
| 758 |
+
|
| 759 |
+
// Update goal progress
|
| 760 |
+
const goalId = document.getElementById('goal-select').value;
|
| 761 |
+
const amount = parseFloat(amountInput.value);
|
| 762 |
+
const goal = goals.find(g => g.id === goalId);
|
| 763 |
+
|
| 764 |
+
if (goal) {
|
| 765 |
+
goal.saved += amount;
|
| 766 |
+
updateGoalsDisplay();
|
| 767 |
+
|
| 768 |
+
// Update total saved for General goal if this wasn't it
|
| 769 |
+
if (goalId !== 'general') {
|
| 770 |
+
const generalGoal = goals.find(g => g.id === 'general');
|
| 771 |
+
if (generalGoal) {
|
| 772 |
+
generalGoal.saved += amount;
|
| 773 |
+
}
|
| 774 |
+
}
|
| 775 |
+
}
|
| 776 |
+
|
| 777 |
+
// Update stats
|
| 778 |
+
const totalSaved = document.querySelector('[data-stat="total-saved"]');
|
| 779 |
+
const currentTotal = parseFloat(totalSaved.textContent.replace('€', '')) || 0;
|
| 780 |
+
totalSaved.textContent = `€${(currentTotal + parseFloat(amountInput.value)).toFixed(2)}`;
|
| 781 |
+
|
| 782 |
+
const cravingsResisted = document.querySelector('[data-stat="cravings-resisted"]');
|
| 783 |
+
cravingsResisted.textContent = parseInt(cravingsResisted.textContent) + 1;
|
| 784 |
+
|
| 785 |
+
showCelebration();
|
| 786 |
+
|
| 787 |
+
// Reset form
|
| 788 |
+
this.reset();
|
| 789 |
+
cravingInput.classList.remove('border-red-500');
|
| 790 |
+
amountInput.classList.remove('border-red-500');
|
| 791 |
+
});
|
| 792 |
+
|
| 793 |
+
// Reminder functions
|
| 794 |
+
function showReminder() {
|
| 795 |
+
const modal = document.getElementById('reminder-modal');
|
| 796 |
+
const overlay = document.getElementById('reminder-overlay');
|
| 797 |
+
|
| 798 |
+
modal.style.display = 'block';
|
| 799 |
+
overlay.style.display = 'block';
|
| 800 |
+
|
| 801 |
+
// Close modal when clicking overlay
|
| 802 |
+
overlay.addEventListener('click', closeReminder);
|
| 803 |
+
|
| 804 |
+
// Close modal when clicking close button
|
| 805 |
+
document.getElementById('reminder-close').addEventListener('click', closeReminder);
|
| 806 |
+
}
|
| 807 |
+
|
| 808 |
+
function closeReminder() {
|
| 809 |
+
const modal = document.getElementById('reminder-modal');
|
| 810 |
+
const overlay = document.getElementById('reminder-overlay');
|
| 811 |
+
|
| 812 |
+
modal.style.display = 'none';
|
| 813 |
+
overlay.style.display = 'none';
|
| 814 |
+
|
| 815 |
+
// Remove event listeners to prevent memory leaks
|
| 816 |
+
overlay.removeEventListener('click', closeReminder);
|
| 817 |
+
document.getElementById('reminder-close').removeEventListener('click', closeReminder);
|
| 818 |
+
}
|
| 819 |
+
|
| 820 |
+
// Mobile menu toggle
|
| 821 |
+
const menuToggle = document.getElementById('menu-toggle');
|
| 822 |
+
const sidebar = document.querySelector('.sidebar');
|
| 823 |
+
const overlay = document.getElementById('sidebar-overlay');
|
| 824 |
+
|
| 825 |
+
function toggleMenu() {
|
| 826 |
+
const isOpening = !sidebar.classList.contains('active');
|
| 827 |
+
sidebar.classList.toggle('active');
|
| 828 |
+
overlay.classList.toggle('active');
|
| 829 |
+
|
| 830 |
+
if (isOpening) {
|
| 831 |
+
document.body.classList.add('sidebar-open');
|
| 832 |
+
} else {
|
| 833 |
+
document.body.classList.remove('sidebar-open');
|
| 834 |
+
}
|
| 835 |
+
}
|
| 836 |
+
|
| 837 |
+
menuToggle.addEventListener('click', toggleMenu);
|
| 838 |
+
|
| 839 |
+
// Close menu when clicking outside
|
| 840 |
+
overlay.addEventListener('click', toggleMenu);
|
| 841 |
+
|
| 842 |
+
// Swipe to close functionality
|
| 843 |
+
let touchStartX = 0;
|
| 844 |
+
let touchEndX = 0;
|
| 845 |
+
|
| 846 |
+
sidebar.addEventListener('touchstart', e => {
|
| 847 |
+
touchStartX = e.changedTouches[0].screenX;
|
| 848 |
+
}, false);
|
| 849 |
+
|
| 850 |
+
sidebar.addEventListener('touchend', e => {
|
| 851 |
+
touchEndX = e.changedTouches[0].screenX;
|
| 852 |
+
if (touchEndX - touchStartX > 50 && sidebar.classList.contains('active')) {
|
| 853 |
+
toggleMenu();
|
| 854 |
+
}
|
| 855 |
+
}, false);
|
| 856 |
+
</script>
|
| 857 |
+
</body>
|
| 858 |
</html>
|
| 859 |
+
|
| 860 |
+
|
| 861 |
+
|
prompts.txt
ADDED
|
File without changes
|