Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
BLACKSPI committed Jul 2, 2024
1 parent 9257b0a commit 94b39ab
Show file tree
Hide file tree
Showing 6 changed files with 197 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"liveServer.settings.port": 5500
"liveServer.settings.port": 5501
}
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

</head>
<body>

<div id="splash-screen">
<img src="./images/splash.png" alt="Loading Image">
<h1>Loading...</h1>
</div>

<div id="navbar">
<a href="./index.html" class="active">Home</a>
<a href="./introduction.html">Introduction</a>
Expand Down Expand Up @@ -55,3 +57,4 @@ <h1>Magic Book</h1>
</script>
</body>
</html>

1 change: 1 addition & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,4 @@ const signLanguageImages = {
'aw': 'images/AW.png',
'ow': 'images/OW.png'
};

98 changes: 98 additions & 0 deletions sign_in.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign In</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-color: #f0f2f5;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
.container h2 {
margin-bottom: 20px;
}
.container input[type="text"],
.container input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
.container button {
width: 100%;
padding: 10px;
background-color: #007bff;
border: none;
border-radius: 4px;
color: white;
font-size: 16px;
cursor: pointer;
}
.container button:hover {
background-color: #0056b3;
}
.container a {
display: block;
margin-top: 10px;
color: #007bff;
text-decoration: none;
}
.container a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h2>Sign In</h2>
<form onsubmit="signIn(event)">
<input type="text" id="username" placeholder="Username" required>
<input type="password" id="password" placeholder="Password" required>
<button type="submit">Sign In</button>
</form>
<a href="sign_up.html">Don't have an account? Sign Up</a>
</div>
<script>
// Initialize default user credentials if not already set
if (!localStorage.getItem('user')) {
const defaultUser = {
username: 'guest',
password: 'password123'
};
localStorage.setItem('user', JSON.stringify(defaultUser));
}

function signIn(event) {
event.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;

// Retrieve user data (for simplicity, using localStorage)
const user = JSON.parse(localStorage.getItem('user'));

if (user && user.username === username && user.password === password) {
localStorage.setItem('signedIn', 'true');
window.location.href = 'index.html';
} else {
alert('Invalid username or password');
}
}
</script>
</body>
</html>

93 changes: 93 additions & 0 deletions sign_up.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
background-color: #f0f2f5;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
.container h2 {
margin-bottom: 20px;
}
.container input[type="text"],
.container input[type="email"],
.container input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
.container button {
width: 100%;
padding: 10px;
background-color: #007bff;
border: none;
border-radius: 4px;
color: white;
font-size: 16px;
cursor: pointer;
}
.container button:hover {
background-color: #0056b3;
}
.container a {
display: block;
margin-top: 10px;
color: #007bff;
text-decoration: none;
}
.container a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h2>Sign Up</h2>
<form onsubmit="signUp(event)">
<input type="email" id="email" placeholder="Email" required>
<input type="text" id="username" placeholder="Username" required>
<input type="password" id="password" placeholder="Password" required>
<input type="password" id="confirmPassword" placeholder="Confirm Password" required>
<button type="submit">Sign Up</button>
</form>
<a href="sign_in.html">Already have an account? Sign In</a>
</div>
<script>
function signUp(event) {
event.preventDefault();
const email = document.getElementById('email').value;
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const confirmPassword = document.getElementById('confirmPassword').value;

if (password !== confirmPassword) {
alert('Passwords do not match');
return;
}

// Save user data (for simplicity, using localStorage)
localStorage.setItem('user', JSON.stringify({ email, username, password }));
localStorage.setItem('signedIn', 'true');
window.location.href = 'index.html';
}
</script>
</body>
</html>
1 change: 1 addition & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,4 @@ button:hover {




0 comments on commit 94b39ab

Please sign in to comment.