Skip to content

Commit 3928e45

Browse files
committed
updet And Add Erorr404
1 parent bc0a9c5 commit 3928e45

File tree

8 files changed

+122
-47
lines changed

8 files changed

+122
-47
lines changed

error_page/not_found.html renamed to 404.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
<a class="nav-link" aria-current="page" href="../index.html">Home</a>
4343
</li>
4444
<li class="nav-item">
45-
<a class="nav-link" href="../contactus_page/index.html">Contact</a>
45+
<a class="nav-link" href="./contact_ page/contact.html">Contact</a>
4646
</li>
4747
<li class="nav-item">
48-
<a class="nav-link" href="../about/about.html">About</a>
48+
<a class="nav-link" href="./about/about.html">About</a>
4949
</li>
5050
</ul>
5151
<form class="d-flex" role="search">
@@ -57,7 +57,7 @@
5757
</div>
5858

5959
<div class="person">
60-
<a href="../editProfilePage/EditProfilePage.html"><img src="../image/MR.png"></a>
60+
<a href="../editProfilePage/EditProfilePage.html"><img src="./image/MR.png"></a>
6161
<p id="login-message"></p>
6262
</div>
6363
</form>
@@ -72,8 +72,16 @@
7272
<div class="error_content">
7373
<div class="error_message">404 Not Found</div>
7474
<p>Your visited page not found. You may go home page.</p>
75-
<a href="../Home/index.html" class="go_home_bottom">Back to home page</a>
75+
<!-- <a href="../Home/index.html" class="go_home_bottom">Back to home page</a> -->
76+
<button class="go_home_bottom" onclick="goHome()">Back to home page</button>
7677
</div>
78+
79+
<script>
80+
function goHome() {
81+
window.location.href = "index.html";
82+
}
83+
</script>
84+
7785
<!-- Start footer -->
7886
<div class="footer">
7987
<div class="containers">
@@ -96,9 +104,8 @@ <h5>Support</h5>
96104
<div class="box">
97105
<h5>Account</h5>
98106
<div class="Account-us">
99-
<a href="">My Account</a>
100-
<a href="" style="display: inline-block;">Login</a> / <a href=""
101-
style="display: inline-block;">Register</a>
107+
<a href="./editProfilePage/EditProfilePage.html">My Account</a>
108+
<a href="./login/login.htm" style="display: inline-block;">Login</a> / <a href="./create acount/create.htm"style="display: inline-block;">Register</a>
102109
<a href="">Cart</a>
103110
<a href="">Wishlist</a>
104111
<a href="">Shop</a>

contact_ page/contact.html

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ <h5>Support</h5>
132132
<div class="box">
133133
<h5>Account</h5>
134134
<div class="Account-us">
135-
<a href="">My Account</a>
136-
<a href="" style="display: inline-block;">Login</a> / <a href=""
135+
<a href="../editProfilePage/EditProfilePage.html">My Account</a>
136+
<a href="../login/login.htm" style="display: inline-block;">Login</a> / <a href="../create acount/create.htm"
137137
style="display: inline-block;">Register</a>
138138
<a href="">Cart</a>
139139
<a href="">Wishlist</a>
@@ -177,18 +177,7 @@ <h5>Download App</h5>
177177
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
178178
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
179179
crossorigin="anonymous"></script>
180-
<script>
181-
window.onload = function () {
182-
// Get the full name from the query string
183-
const urlParams = new URLSearchParams(window.location.search);
184-
const name = urlParams.get('name');
185-
if (name) {
186-
document.getElementById('login-message').textContent = ` ${name}`;
187-
} else {
188-
document.getElementById('login-message').textContent = "Guest!";
189-
}
190-
};
191-
</script>
180+
192181
</body>
193182

194183
</html>

create acount/create.htm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@
6868
<div class="col-md-4 signup-form mt-5">
6969
<h3 class="mb-3 fw-bold">Create an account</h3>
7070
<p class="text-muted mb-4">Enter your details below</p>
71-
<form>
71+
<form id="signup-form">
7272
<div class="mb-3">
73-
<input type="text" class="form-control" placeholder="Name">
73+
<input type="text" class="form-control" placeholder="Name" id="name">
7474
</div>
7575
<div class="mb-3">
76-
<input type="email" class="form-control" placeholder="Email or Phone Number">
76+
<input type="email" class="form-control" placeholder="Email or Phone Number" id="email">
7777
</div>
7878
<div class="mb-3">
79-
<input type="password" class="form-control" placeholder="Password">
79+
<input type="password" class="form-control" placeholder="Password" id="password">
8080
</div>
8181
<div class="d-grid mb-3">
82-
<button class="btn btn-danger">Create Account</button>
82+
<button type="submit" class="btn btn-danger">Create Account</button>
8383
</div>
8484
<div class="text-center mb-3">
8585
<button type="button" class="btn btn-outline-dark w-100 google-btn">
@@ -119,8 +119,8 @@ <h5>Support</h5>
119119
<div class="box">
120120
<h5>Account</h5>
121121
<div class="Account-us">
122-
<a href="">My Account</a>
123-
<a href="" style="display: inline-block;">Login</a> / <a href=""
122+
<a href="../editProfilePage/EditProfilePage.html">My Account</a>
123+
<a href="../login/login.htm" style="display: inline-block;">Login</a> / <a href="../create acount/create.htm"
124124
style="display: inline-block;">Register</a>
125125
<a href="">Cart</a>
126126
<a href="">Wishlist</a>
@@ -177,6 +177,7 @@ <h5>Download App</h5>
177177
};
178178
</script>
179179
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
180+
<script src="./create.js"></script>
180181
</body>
181182

182183
</html>

create acount/create.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
document.getElementById('signup-form').addEventListener('submit', function (e) {
3+
e.preventDefault();
4+
// يمنع الفورم من الإرسال
5+
6+
const name = document.getElementById('name').value.trim();
7+
const email = document.getElementById('email').value.trim();
8+
const password = document.getElementById('password').value;
9+
10+
if (!name || !email || !password) {
11+
alert("Please fill all fields.");
12+
return;
13+
}
14+
15+
// نجيب الحسابات القديمة
16+
const users = JSON.parse(localStorage.getItem('users')) || [];
17+
18+
// نتاكد مفيش ايميل مكرر
19+
const existingUser = users.find(user => user.email === email);
20+
if (existingUser) {
21+
alert("This email is already registered.");
22+
return;
23+
}
24+
25+
// نضيف الحساب الجديد
26+
users.push({ name, email, password });
27+
28+
// نخزنهم في localStorage
29+
localStorage.setItem('users', JSON.stringify(users));
30+
31+
window.location.href = "../index.html";
32+
33+
34+
});
35+

editProfilePage/EditProfilePage.html

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class="collapse navbar-collapse" id="navbarSupportedContent">
3939
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
4040
<li class="nav-item">
41-
<a class="nav-link active" aria-current="page" href="../index.html">Home</a>
41+
<a class="nav-link " aria-current="page" href="../index.html">Home</a>
4242
</li>
4343
<li class="nav-item">
4444
<a class="nav-link" href="../contact_ page/contact.html">Contact</a>
@@ -144,8 +144,8 @@ <h5>Support</h5>
144144
<div class="box">
145145
<h5>Account</h5>
146146
<div class="Account-us">
147-
<a href="">My Account</a>
148-
<a href="" style="display: inline-block;">Login</a> / <a href="" style="display: inline-block;">Register</a>
147+
<a href="./EditProfilePage.html">My Account</a>
148+
<a href="../login/login.htm" style="display: inline-block;">Login</a> / <a href="../create acount/create.htm" style="display: inline-block;">Register</a>
149149
<a href="">Cart</a>
150150
<a href="">Wishlist</a>
151151
<a href="">Shop</a>
@@ -178,6 +178,28 @@ <h5>Download App</h5>
178178
</div>
179179
</div>
180180
<!-- End footer -->
181+
<!-- swiper js -->
182+
183+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
184+
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
185+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"></script>
186+
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
187+
<!-- js bootstrap -->
188+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
189+
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
190+
crossorigin="anonymous"></script>
191+
<script>
192+
window.onload = function () {
193+
// Get the full name from the query string
194+
const urlParams = new URLSearchParams(window.location.search);
195+
const name = urlParams.get('name');
196+
if (name) {
197+
document.getElementById('login-message').textContent = ` ${name}`;
198+
} else {
199+
document.getElementById('login-message').textContent = "Guest!";
200+
}
201+
};
202+
</script>
181203
</body>
182204

183205
</html>

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ <h5>Support</h5>
229229
<div class="box">
230230
<h5>Account</h5>
231231
<div class="Account-us">
232-
<a href="../editProfilePage/EditProfilePage.html">My Account</a>
233-
<a href="../login/login.htm" style="display: inline-block;">Login</a> / <a href="../create acount/create.htm" style="display: inline-block;">Register</a>
232+
<a href="./editProfilePage/EditProfilePage.html">My Account</a>
233+
<a href="./login/login.htm" style="display: inline-block;">Login</a> / <a href="./create acount/create.htm" style="display: inline-block;">Register</a>
234234
<a href="">Cart</a>
235235
<a href="">Wishlist</a>
236236
<a href="">Shop</a>

login/login.htm

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@
6767
<div class="col-md-4 login-form mt-5">
6868
<h3 class="mb-3 fw-bold">Log in to <span class="text-danger">Exclusive</span></h3>
6969
<p class="text-muted mb-4">Enter your details below</p>
70-
<form>
70+
<form id="login-form">
7171
<div class="mb-3">
72-
<input type="email" class="form-control" placeholder="Email or Phone Number">
72+
<input type="email" class="form-control" placeholder="Email or Phone Number" id="email">
7373
</div>
7474
<div class="mb-3">
75-
<input type="password" class="form-control" placeholder="Password">
75+
<input type="password" class="form-control" placeholder="Password" id="password">
7676
</div>
7777
<div class="d-flex justify-content-between align-items-center mb-3">
7878
<button class="btn btn-danger px-4">Log In</button>
@@ -105,8 +105,8 @@ <h5>Support</h5>
105105
<div class="box">
106106
<h5>Account</h5>
107107
<div class="Account-us">
108-
<a href="">My Account</a>
109-
<a href="" style="display: inline-block;">Login</a> / <a href=""
108+
<a href="../editProfilePage/EditProfilePage.html">My Account</a>
109+
<a href="../login/login.htm" style="display: inline-block;">Login</a> / <a href="../create acount/create.htm"
110110
style="display: inline-block;">Register</a>
111111
<a href="">Cart</a>
112112
<a href="">Wishlist</a>
@@ -140,17 +140,17 @@ <h5>Download App</h5>
140140
</div>
141141
</div>
142142
<!-- End footer -->
143-
<!-- swiper js -->
143+
<!-- swiper js -->
144144

145-
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
146-
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
147-
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"></script>
148-
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
149-
<!-- js bootstrap -->
150-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
145+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
146+
<script src="https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
147+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Counter-Up/1.0.0/jquery.counterup.min.js"></script>
148+
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
149+
<!-- js bootstrap -->
150+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
151151
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
152152
crossorigin="anonymous"></script>
153-
<script>
153+
<script>
154154
window.onload = function () {
155155
// Get the full name from the query string
156156
const urlParams = new URLSearchParams(window.location.search);
@@ -161,7 +161,9 @@ <h5>Download App</h5>
161161
document.getElementById('login-message').textContent = "Guest!";
162162
}
163163
};
164-
</script>
164+
</script>
165+
<script src="./login.js"></script>
166+
165167
</body>
166168

167169
</html>

login/login.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
document.getElementById('login-form').addEventListener('submit', function (e) {
2+
e.preventDefault();
3+
4+
const email = document.getElementById('email').value.trim();
5+
const password = document.getElementById('password').value;
6+
7+
const users = JSON.parse(localStorage.getItem('users')) || [];
8+
9+
const validUser = users.find(user => user.email === email && user.password === password);
10+
11+
if (validUser) {
12+
// alert("Login successful!");
13+
localStorage.setItem("loggedInUser", JSON.stringify(validUser));
14+
window.location.href = "./index.html";
15+
16+
} else {
17+
alert("Invalid email or password.");
18+
}
19+
});

0 commit comments

Comments
 (0)