-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPROJECT.HTML
More file actions
250 lines (225 loc) · 6.96 KB
/
PROJECT.HTML
File metadata and controls
250 lines (225 loc) · 6.96 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
239
240
241
242
243
244
245
246
247
248
249
250
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Progress Tracker</title>
<link
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz@10..48&family=Qwitcher+Grypen:wght@700&family=Tulpen+One&display=swap"
rel="stylesheet"
/>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Global styles */
body {
font-family: Qwitcher Grypen;
background-color: #f0f0f0;
}
header {
background-color: #7e868c;
color: white;
text-align: center;
padding: 1rem 0;
}
main {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
}
/* Goal form styles */
.goal-form {
background-color: rgb(252, 242, 242);
padding: 1rem;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
animation: fadeIn 0.5s ease;
}
.goal-form form {
display: grid;
gap: 1rem;
}
/* Goal list styles */
.goal-list ul {
list-style: none;
padding: 0;
}
.goal-item {
background-color: rgb(252, 242, 242);
padding: 1rem;
margin: 1rem 0;
border-radius: 5px;
box-shadow: 0 0 5px black;
cursor: pointer;
transition: all 0.3s ease;
overflow: hidden;
display: flex;
justify-content: space-between;
align-items: center;
}
.goal-item h3 {
margin: 0;
cursor: pointer;
}
.goal-details {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid #ddd;
transition: max-height 0.5s ease, opacity 0.3s ease;
max-height: 0;
opacity: 0;
overflow: hidden;
}
.goal-item.active .goal-details {
max-height: 1000px;
opacity: 1;
}
.expanded {
transform: scale(1.03);
}
/* Footer styles */
footer {
text-align: center;
background-color: #ccb9a1;
color: white;
padding: 1rem 0;
}
/* Status filter styles */
.status-filter {
margin-top: 1rem;
text-align: center;
}
.status-filter button {
font-family: Qwitcher Grypen;
margin: 0 0.5rem;
padding: 0.5rem 1rem;
background-color: #cda355;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.status-filter button.active {
font-family: Qwitcher Grypen;
background-color: #cda355;
}
/* Animation keyframes */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
</head>
<body>
<header>
<h1>Progress Tracker</h1>
</header>
<main>
<section class="goal-form">
<h2>Create a New Goal</h2>
<form onsubmit="addGoal(event)">
<label for="goalName">Goal Name:</label>
<input type="text" id="goalName" required />
<label for="goalDescription">Description:</label>
<textarea id="goalDescription" required></textarea>
<label for="targetDate">Target Date:</label>
<input type="date" id="targetDate" required />
<button type="submit">Create Goal</button>
</form>
</section>
<section class="goal-list">
<h2>Your Goals</h2>
<div class="status-filter">
<button class="active" onclick="filterGoals('all')">All</button>
<button onclick="filterGoals('active')">Active</button>
<button onclick="filterGoals('completed')">Completed</button>
</div>
<ul id="goalList">
<li class="goal-item active" onclick="toggleExpand(this)">
<h3>Fitness Goal</h3>
<div class="goal-details">
<p>Description: Get in shape</p>
<p>Target Date: 2023-12-31</p>
</div>
</li>
<li class="goal-item active" onclick="toggleExpand(this)">
<h3>Learning Goal</h3>
<div class="goal-details">
<p>Description: Learn Vue.js</p>
<p>Target Date: 2023-10-15</p>
</div>
</li>
<li class="goal-item completed" onclick="toggleExpand(this)">
<h3>Travel Goal</h3>
<div class="goal-details">
<p>Description: Explore new destinations</p>
<p>Target Date: 2023-11-30</p>
</div>
</li>
</ul>
</section>
</main>
<footer>
<p>© 2023 Progress Tracker</p>
</footer>
<script>
function toggleExpand(element) {
element.classList.toggle("active");
}
function filterGoals(status) {
const goalList = document.getElementById("goalList");
const goals = goalList.querySelectorAll(".goal-item");
goals.forEach((goal) => {
if (status === "all" || goal.classList.contains(status)) {
goal.style.display;
goal.style.display = "flex";
} else {
goal.style.display = "none";
}
});
const buttons = document.querySelectorAll(".status-filter button");
buttons.forEach((button) => {
button.classList.remove("active");
});
const activeButton = document.querySelector(
`.status-filter button:contains('${status}')`
);
if (activeButton) {
activeButton.classList.add("active");
}
}
function addGoal(event) {
event.preventDefault();
// Get form values
const goalName = document.getElementById("goalName").value;
const goalDescription =
document.getElementById("goalDescription").value;
const targetDate = document.getElementById("targetDate").value;
// Create a new goal item
const goalList = document.getElementById("goalList");
const newGoalItem = document.createElement("li");
newGoalItem.className = "goal-item active";
newGoalItem.innerHTML = `
<h3>${goalName}</h3>
<div class="goal-details">
<p>Description: ${goalDescription}</p>
<p>Target Date: ${targetDate}</p>
</div>
`;
// Add the new goal to the list
goalList.appendChild(newGoalItem);
// Clear the form inputs
document.getElementById("goalName").value = "";
document.getElementById("goalDescription").value = "";
document.getElementById("targetDate").value = "";
}
</script>
</body>
</html>