Skip to content

Commit 51479bc

Browse files
committed
Profile icon added and fixed some css
1 parent ebe6dd2 commit 51479bc

7 files changed

+92
-66
lines changed

image.png

255 KB
Loading

index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h2>Create an Account</h2>
1515
<input type="password" id="password" placeholder="Set a password" required>
1616
<button id="registerButton">Sign Up</button>
1717
<div class="redirect">
18-
<button id="redirectToLogin">Already have an account? Log In</button>
18+
<span>Already have an account? <a href="#" id="redirectToLogin">Log In</a></span>
1919
</div>
2020
</div>
2121
<div id="loginPage" class="container">
@@ -26,10 +26,10 @@ <h2>Log In</h2>
2626
<input type="password" id="loginPassword" placeholder="Enter your password" required>
2727
<button id="loginButton">Log In</button>
2828
<div class="redirect">
29-
<button id="redirectToRegister">Don't have an account? Sign Up</button>
29+
<span>Don't have an account? <a href="#" id="redirectToRegister">Sign Up</a></span>
3030
</div>
3131
</div>
3232

3333
<script src="script.js"></script>
3434
</body>
35-
</html>
35+
</html>

landing.css

+43-15
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ a {
6262

6363
.content {
6464
margin: 20px auto;
65-
width: 90%;
65+
width: auto;
6666
max-width: 900px;
6767
background-color: #eef2f3;
6868
background-image: url('https://bestofmotivation.com/wp-content/uploads/2023/03/time-management.png');
@@ -209,34 +209,62 @@ button.delete:hover {
209209
}
210210

211211
.search-bar {
212-
width: 100%;
212+
width: 60%;
213+
max-width: 400px;
213214
padding: 10px;
214-
margin: 10px 0 20px;
215215
border: 1px solid #ccc;
216216
border-radius: 5px;
217-
transition: border-color 0.3s ease;
217+
margin: 0 auto;
218+
display: block;
218219
}
219220

220221
.search-bar:focus {
221222
border-color: #28a745;
222223
outline: none;
223224
box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
224225
}
225-
.help-button, .about-us-button {
226-
background-color: #007bff;
227-
color: white;
228-
border: none;
229-
padding: 10px 20px;
226+
.profile-icon-container {
227+
position: relative;
228+
display: inline-block;
229+
}
230+
231+
.profile-icon {
232+
width: 40px;
233+
height: 40px;
234+
border-radius: 50%;
235+
cursor: pointer;
236+
}
237+
238+
.dropdown-menu {
239+
position: absolute;
240+
right: 0;
241+
top: 50px;
242+
background-color: #fff;
243+
border: 1px solid #ccc;
244+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
230245
border-radius: 5px;
246+
z-index: 1000;
247+
display: flex;
248+
flex-direction: column;
249+
min-width: 150px;
250+
}
251+
252+
.dropdown-menu.hidden {
253+
display: none;
254+
}
255+
256+
.dropdown-item {
257+
padding: 10px 15px;
258+
border: none;
259+
text-align: left;
260+
width: 100%;
261+
background: none;
231262
cursor: pointer;
232-
transition: background-color 0.3s ease, transform 0.3s ease;
233-
margin-left: 10px;
234-
font-size: 1rem;
263+
font-size: 14px;
235264
}
236265

237-
.help-button:hover, .about-us-button:hover {
238-
background-color: #0056b3;
239-
transform: scale(1.05);
266+
.dropdown-item:hover {
267+
background-color: #007bff;
240268
}
241269

242270

landing.html

+15-34
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@
99
<body>
1010
<div class="top-bar">
1111
<h1 id="welcomeMessage">Welcome to Your Time Management System</h1>
12-
<br />
13-
<br />
1412
<div class="top-bar-right">
15-
<a href="profile.html">
16-
<button class = "profile-button">Profile</button>
17-
</a>
18-
<button id="signOutButton" class="sign-out-button">Sign Out</button>
19-
</div>
13+
<div class="profile-icon-container">
14+
<img src="image.png" alt="Profile Icon" id="profileIcon" class="profile-icon">
15+
<div id="dropdownMenu" class="dropdown-menu hidden">
16+
<button class="dropdown-item" onclick="navigateTo('profile.html')">Profile</button>
17+
<button class="dropdown-item" onclick="navigateTo('help.html')">Help</button>
18+
<button class="dropdown-item" onclick="navigateTo('abt.html')">About Us</button>
19+
<button class="dropdown-item" id="signOutButton">Sign Out</button>
20+
</div>
21+
</div>
22+
</div>
2023
</div>
2124

2225
<div class="main">
2326
<main class="content">
24-
<h2>Your Tasks</h2>
2527
<div class="Search">
2628
<h2>Search Tasks</h2>
2729
<input
@@ -31,42 +33,21 @@ <h2>Search Tasks</h2>
3133
placeholder="Search for a task..."
3234
oninput="filterTasks()">
3335
</div><br>
34-
35-
<!-- Updated task input form -->
36+
<h2>Your Tasks</h2>
3637
<div class="task-input">
37-
<input type="text" id="taskInput" placeholder="Add a new task">
38+
<input type="text" id="taskInput" placeholder="Add Task title">
3839
<input type="text" id="taskDescriptionInput" placeholder="Task Description">
39-
40-
<!-- Add Due Date Input -->
4140
<input type="date" id="taskDueDate" placeholder="Due Date">
42-
43-
<!-- Add Priority Dropdown -->
4441
<select id="taskPriority">
4542
<option value="low">Low</option>
4643
<option value="medium">Medium</option>
4744
<option value="high">High</option>
4845
</select>
49-
5046
<button id="addTaskButton">Add Task</button>
51-
5247
</div>
53-
54-
<ul id="taskList" class="task-list">
55-
</ul>
48+
<ul id="taskList" class="task-list"></ul>
5649
</main>
57-
</div>
58-
<footer>
59-
<div class="top-bar">
60-
<div class="top-bar-left">
61-
<h1>Time Management System</h1>
62-
</div>
63-
<div class="top-bar-right">
64-
<a href="help.html"><button class="help-button">Help</button></a>
65-
<a href="abt.html"><button class="about-us-button">About Us</button></a>
66-
</div>
67-
</div>
68-
</footer>
69-
50+
</div>
7051
<script src="landing.js"></script>
7152
</body>
72-
</html>
53+
</html>

landing.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const welcomeMessage = document.getElementById("welcomeMessage");
2+
const profileIcon = document.getElementById("profileIcon");
3+
const dropdownMenu = document.getElementById("dropdownMenu");
24
const signOutButton = document.getElementById("signOutButton");
35
const taskInput = document.getElementById("taskInput");
46
const taskDescriptionInput = document.getElementById("taskDescriptionInput");
@@ -7,8 +9,6 @@ const taskPriority = document.getElementById("taskPriority");
79
const addTaskButton = document.getElementById("addTaskButton");
810
const taskList = document.getElementById("taskList");
911
const searchBar = document.getElementById("searchBar");
10-
11-
// Retrieve the logged-in user safely
1212
const loggedinUser = JSON.parse(localStorage.getItem("loggedinUser"));
1313

1414
if (loggedinUser) {
@@ -17,16 +17,20 @@ if (loggedinUser) {
1717
window.location.href = "index.html";
1818
}
1919

20-
// Profile button logic (ensures only one listener)
21-
const profileButton = document.querySelector('.profile-button');
22-
if (profileButton) {
23-
profileButton.addEventListener('click', () => {
24-
console.log("Navigating to profile.html...");
25-
window.location.href = "profile.html";
26-
});
20+
profileIcon.addEventListener("click", (event) => {
21+
event.stopPropagation();
22+
dropdownMenu.classList.toggle("hidden");
23+
});
24+
25+
document.addEventListener("click", (event) => {
26+
if (!dropdownMenu.contains(event.target) && !profileIcon.contains(event.target)) {
27+
dropdownMenu.classList.add("hidden");
28+
}
29+
});
30+
function navigateTo(url) {
31+
window.location.href = url;
2732
}
2833

29-
// Retrieve tasks from localStorage or initialize an empty array
3034
let tasks = JSON.parse(localStorage.getItem("tasks")) || [];
3135

3236
// Function to save tasks to localStorage
@@ -141,7 +145,7 @@ addTaskButton.addEventListener("click", () => {
141145
dueDate: taskDueDateValue,
142146
priority: taskPriorityValue,
143147
done: false,
144-
username: loggedinUser.username // Associate task with the logged-in user
148+
username: loggedinUser.username /\
145149
};
146150

147151
tasks.push(newTask);

script.js

+12
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,15 @@ if (redirectToRegisterButton) {
112112
registerPage.classList.add("active");
113113
});
114114
}
115+
116+
document.getElementById('redirectToLogin').addEventListener('click', function(e) {
117+
e.preventDefault();
118+
document.getElementById('registerPage').classList.remove('active');
119+
document.getElementById('loginPage').classList.add('active');
120+
});
121+
122+
document.getElementById('redirectToRegister').addEventListener('click', function(e) {
123+
e.preventDefault();
124+
document.getElementById('loginPage').classList.remove('active');
125+
document.getElementById('registerPage').classList.add('active');
126+
});

style.css

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ body {
1313

1414
.container {
1515
width: 330px;
16-
background-color: #ffffff;
16+
background-color: rgba(255, 255, 255, 0.2);
1717
padding: 24px;
1818
border-radius: 10px;
1919
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
2020
display: none;
21-
margin-right: 85px;
21+
margin-right: 85px;
22+
backdrop-filter: blur(2000px);
2223
}
2324

2425
.container.active {
@@ -53,7 +54,7 @@ body {
5354
}
5455

5556
.container button:hover {
56-
background-color: #5a6268;
57+
background-color: #007bff;
5758
}
5859

5960
.message {

0 commit comments

Comments
 (0)