-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15f1977
commit 90c2c0f
Showing
3 changed files
with
121 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
document.getElementById('loginForm').addEventListener('submit', function(event) { | ||
event.preventDefault(); | ||
|
||
const username = document.getElementById('username').value; | ||
const email = document.getElementById('email').value; | ||
const bio = document.getElementById('bio').value; | ||
|
||
// Hide login form and show welcome message | ||
document.getElementById('login-container').style.display = 'none'; | ||
document.getElementById('welcome-container').style.display = 'block'; | ||
|
||
// Display a welcome message with the username | ||
document.getElementById('userMessage').innerText = `Welcome, ${username}!`; | ||
|
||
// Store user details for the account view | ||
document.getElementById('accountUsername').innerText = username; | ||
document.getElementById('accountEmail').innerText = email; | ||
document.getElementById('accountBio').innerText = bio; | ||
}); | ||
|
||
document.getElementById('viewAccountBtn').addEventListener('click', function() { | ||
document.getElementById('welcome-container').style.display = 'none'; | ||
document.getElementById('account-container').style.display = 'block'; | ||
}); | ||
|
||
document.getElementById('logoutBtn').addEventListener('click', function() { | ||
// Reset to initial view | ||
document.getElementById('account-container').style.display = 'none'; | ||
document.getElementById('login-container').style.display = 'block'; | ||
document.getElementById('loginForm').reset(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f0f2f5; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
width: 400px; | ||
padding: 20px; | ||
background: #fff; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
border-radius: 8px; | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
color: #333; | ||
} | ||
|
||
form { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
label { | ||
margin: 10px 0 5px; | ||
text-align: left; | ||
color: #555; | ||
} | ||
|
||
input, textarea { | ||
padding: 10px; | ||
margin-bottom: 10px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
|
||
button { | ||
padding: 10px; | ||
background-color: #007bff; | ||
border: none; | ||
color: #fff; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
#account-container, #welcome-container { | ||
margin-top: 20px; | ||
} |