-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogresstracker.html
More file actions
238 lines (200 loc) · 7.57 KB
/
progresstracker.html
File metadata and controls
238 lines (200 loc) · 7.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Progress Tracker | Self-Care Hub</title>
<link rel="stylesheet" href="navbar.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
body {
font-family: 'Poppins', sans-serif;
margin: 0;
background: #201f47;
color: #fff;
display: flex;
flex-direction: column;
min-height: 100vh;
}
.container {
flex: 1;
max-width: 600px;
margin: 40px auto;
background: #16213E;
padding: 25px;
border-radius: 12px;
box-shadow: 0px 0px 15px rgba(255, 0, 150, 0.4);
}
h1 {
text-align: center;
color: #FF3CAC;
}
.goal-inputs {
display: flex;
flex-direction: column;
gap: 10px;
}
input,
select,
button {
padding: 10px;
border: none;
border-radius: 5px;
font-family: 'Poppins', sans-serif;
}
.goal-list {
margin-top: 20px;
}
.goal {
background: #2B86C5;
margin-bottom: 10px;
padding: 15px;
border-radius: 8px;
position: relative;
}
.goal h3 {
margin: 0;
}
.progress-bar {
width: 100%;
background: #fff;
border-radius: 5px;
overflow: hidden;
margin: 8px 0;
}
.progress {
background: linear-gradient(90deg, #FF3CAC, #784BA0);
height: 15px;
width: 0%;
transition: width 0.4s ease;
}
.goal-actions {
display: flex;
justify-content: space-between;
align-items: center;
}
.goal-actions button {
background: #FF3CAC;
color: #fff;
cursor: pointer;
margin-left: 5px;
}
.filter-section {
margin-top: 15px;
display: flex;
gap: 10px;
align-items: center;
}
@media(max-width: 600px) {
.nav-right a {
margin-left: 10px;
}
}
</style>
</head>
<body>
<nav class="navbar">
<input type="checkbox" id="check">
<label for="check" class="checkbtn">
<i class="fas fa-bars"></i>
</label>
<ul class="navbar-list">
<label for="check" class="checkbtn">
<i class="fas fa-xmark"></i>
</label>
<li class="navbar-item"><a href="index.html"><span class="navbar-icon"><i class="fa-solid fa-house"></i>
Home</span></a></li>
<li class="navbar-item relative">
<span class="navbar-icon"><i class="fa-solid fa-heart"></i> Self-Care </span>
<div class="dropdown-content">
<a href="moodtracker.html">Mood Tracker</a>
<a href="motivationalquotes.html">Motivational Quotes</a>
<a href="breathingtool.html">Breathing Tool</a>
<a href="progresstracker.html">Progress Tracker</a>
</div>
</li>
<li class="navbar-item"><a href="focusmode.html"><span class="navbar-icon"><i
class="fa-solid fa-clock"></i> Focus</span></a></li>
<li class="navbar-item"><a href="todolist.html"><span class="navbar-icon"><i
class="fa-solid fa-calendar-days"></i> Plan</span></a></li>
<li class="navbar-item"><a href="Flashcard.html"><span class="navbar-icon"><i
class="fa-solid fa-pencil"></i> Learn</span></a></li>
<li class="navbar-item"><a href="dailytask.html"><span class="navbar-icon"><i class="fa-solid fa-star"></i>
Boost</span></a></li>
</ul>
</nav>
<div class="container">
<h1>Progress Tracker</h1>
<div class="goal-inputs">
<input type="text" id="goalName" placeholder="Goal Title">
<select id="goalType">
<option value="Academic">Academic</option>
<option value="Personal">Personal</option>
<option value="Wellness">Wellness</option>
</select>
<button onclick="addGoal()">Add Goal</button>
</div>
<div class="filter-section">
<label>Filter:</label>
<select id="filterType" onchange="filterGoals()">
<option value="All">All</option>
<option value="Academic">Academic</option>
<option value="Personal">Personal</option>
<option value="Wellness">Wellness</option>
</select>
</div>
<div class="goal-list" id="goalList"></div>
</div>
<script>
let goals = JSON.parse(localStorage.getItem('goals')) || [];
function addGoal() {
const name = document.getElementById('goalName').value;
const type = document.getElementById('goalType').value;
if (name.trim() === "") return;
goals.push({ name, type, progress: 0 });
document.getElementById('goalName').value = '';
saveAndRender();
}
function updateProgress(index, change) {
goals[index].progress = Math.min(100, Math.max(0, goals[index].progress + change));
saveAndRender();
}
function deleteGoal(index) {
goals.splice(index, 1);
saveAndRender();
}
function saveAndRender() {
localStorage.setItem('goals', JSON.stringify(goals));
renderGoals();
}
function renderGoals() {
const list = document.getElementById('goalList');
const filter = document.getElementById('filterType').value;
list.innerHTML = '';
goals.forEach((goal, index) => {
if (filter !== "All" && goal.type !== filter) return;
const goalDiv = document.createElement('div');
goalDiv.className = 'goal';
goalDiv.innerHTML = `
<h3>${goal.name} (${goal.type})</h3>
<div class="progress-bar"><div class="progress" style="width: ${goal.progress}%;"></div></div>
<div class="goal-actions">
<span>${goal.progress}% Complete</span>
<div>
<button onclick="updateProgress(${index}, 10)">+10%</button>
<button onclick="updateProgress(${index}, -10)">-10%</button>
<button onclick="deleteGoal(${index})">Delete</button>
</div>
</div>
`;
list.appendChild(goalDiv);
});
}
function filterGoals() {
renderGoals();
}
renderGoals();
</script>
</body>
</html>