-
Notifications
You must be signed in to change notification settings - Fork 216
/
Personalized.html
227 lines (197 loc) · 7.22 KB
/
Personalized.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Devotion To-Do List</title>
<style>
/* CSS Styles */
body {
font-family: Arial, sans-serif;
background-color: var(--primary-color); /* Light blue background */
color: #2e4a7e; /* Dark blue text */
margin: 0;
padding: 0;
text-align: center;
}
h1 {
color: #3f51b5; /* Krishna's blue */
margin: 20px 0;
font-size: 36px; /* Larger heading */
}
h2 {
font-size: 28px; /* Larger subheading */
color: #3f51b5; /* Krishna's blue */
}
form {
background-color: #e3f2fd; /* Light background color */
border-radius: 10px;
padding: 30px; /* Increased padding */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
display: inline-block;
margin: 20px auto; /* Center the form */
}
label {
display: block;
margin: 15px 0; /* Increased margin */
font-size: 20px; /* Larger font size */
}
input[type="text"] {
padding: 15px; /* Increased padding */
border: 2px solid #ccc; /* Thicker border */
border-radius: 5px;
width: 400px; /* Increased width */
font-size: 18px; /* Larger font size */
}
button {
background-color: #ffeb3b; /* Yellow button */
border: none;
padding: 15px 30px; /* Increased padding */
border-radius: 5px;
cursor: pointer;
font-size: 18px; /* Larger font size */
color: #2e4a7e; /* Dark blue text */
transition: background-color 0.3s;
margin-top: 15px; /* Increased margin */
}
button:hover {
background-color: #ffc107; /* Darker yellow on hover */
}
#taskList {
margin-top: 20px;
background-color: #e3f2fd;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: left;
display: inline-block;
max-width: 600px; /* Limit width of task list */
}
#taskList ul {
list-style-type: none;
padding: 0;
}
#taskList li {
margin: 10px 0; /* Increased margin */
padding: 15px; /* Increased padding */
border: 2px solid #ccc; /* Thicker border */
border-radius: 5px;
background-color: #ffffff; /* White background for list items */
font-size: 18px; /* Larger font size */
}
/* Progress bar styles */
.progress-container {
width: 100%;
background-color: #ddd;
border-radius: 5px;
margin-top: 10px;
}
.progress-bar {
height: 30px; /* Increased height */
width: 0; /* Default to 0% */
background-color: #3f51b5; /* Krishna's blue */
border-radius: 5px;
text-align: center;
color: white;
line-height: 30px; /* Center text vertically */
font-size: 16px; /* Font size for progress text */
}
footer {
margin-top: 30px;
font-size: 1.2em; /* Larger footer text */
color: #3f51b5; /* Krishna's blue */
}
.home-button {
margin-top: 20px;
padding: 15px 30px;
font-size: 18px;
color: white;
background-color: #4CAF50; /* Green button */
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.home-button:hover {
background-color: #45a049; /* Darker green on hover */
}
#icon{
width: 30px;
cursor: pointer;
position: absolute;
right: 50px;
top: 50px;
}
:root{
--primary-color: #f0f8ff;
}
.dark-theme{
--primary-color: #474444;
}
</style>
</head>
<body>
<img src="images/moon.png" id="icon">
<h1>Devotion To-Do List</h1>
<form id="devotionForm">
<label for="task">Add a Task (e.g., Prayer, Chanting):</label>
<input type="text" id="task" name="task" required>
<label for="progress">Progress (e.g., Completed, Halfway, Pending):</label>
<input type="text" id="progress" name="progress" required>
<button type="submit">Add Task</button>
</form>
<h2>Your Tasks:</h2>
<div id="taskList">
<ul id="listItems"></ul> <!-- Unordered list for tasks -->
</div>
<br>
<button class="home-button" onclick="goHome()">Home</button> <!-- Home button -->
<footer>
©<span id="cyear"></span> Shree Krishna - My Strength. All rights reserved.
</footer>
<script>
window.addEventListener('load',()=> {
const year= document.getElementById('cyear');
year.innerHTML=new Date().getFullYear();
});
</script>
<script>
// JavaScript to handle form submission and display the tasks
document.getElementById("devotionForm").addEventListener("submit", function(event) {
event.preventDefault(); // Prevent the form from submitting
const taskInput = document.getElementById("task").value;
const progressInput = document.getElementById("progress").value;
// Create a new list item for the task
const taskList = document.getElementById("listItems");
const listItem = document.createElement("li");
listItem.innerHTML = `<strong>Task:</strong> ${taskInput} <br> <strong>Progress:</strong> ${progressInput}`;
// Create a progress bar
const progressContainer = document.createElement("div");
progressContainer.className = "progress-container";
const progressBar = document.createElement("div");
progressBar.className = "progress-bar";
progressBar.innerHTML = progressInput; // Display progress text
// Set width based on progress
if (progressInput.toLowerCase() === "completed") {
progressBar.style.width = "100%";
} else if (progressInput.toLowerCase() === "halfway") {
progressBar.style.width = "50%";
} else {
progressBar.style.width = "0%"; // Default for "Pending"
}
progressContainer.appendChild(progressBar);
listItem.appendChild(progressContainer);
// Append the new task to the list
taskList.appendChild(listItem);
// Clear the input fields
document.getElementById("task").value = '';
document.getElementById("progress").value = '';
});
// Function to go back to the home page
function goHome() {
window.location.href = 'index.html'; // Change to your home page URL
}
</script>
<script src="script.js"></script>
</body>
</html>