Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EsraaAlzoghby committed Jan 8, 2025
0 parents commit 160e817
Show file tree
Hide file tree
Showing 33 changed files with 2,983 additions and 0 deletions.
9 changes: 9 additions & 0 deletions css/all.min.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions css/bootstrap.min.css

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions css/home.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.FormContainer {
background-image: url("../images/home-bg.jpg");
background-size: 100% 50%;
background-repeat: no-repeat;
min-height: 100vh;
}
.nav-link {
transition: all 0.3s ease;
}
.nav-link:hover {
text-decoration: none;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
transform: scale(1.05);
}
.cardShow{
background-color: #7767F5;
}
46 changes: 46 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.FormContainer {
background-image: url("../images/home-bg.jpg");
background-size: 100% 50%;
background-repeat: no-repeat;
min-height: 100vh;
}
*{
font-family: "Lustria", serif;
font-weight: 400;
font-style: normal;
}
.Form {
backdrop-filter: blur(5px);
}
.display__Products img {
width: 75px;
height: 75px;
border-radius: 50%;
}

#tableBody tr {
transform: translateY(10px);
animation: rowsAnimation forwards 0.5s;
opacity: 0;
}

@keyframes rowsAnimation {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.nav-link {
transition: all 0.3s ease;
}

.nav-link:hover {
text-decoration: none;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
transform: scale(1.05);
}

Binary file added images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/employee-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/employee-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/employee-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/home-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
516 changes: 516 additions & 0 deletions images/login.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mini-market-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,795 changes: 1,795 additions & 0 deletions images/signup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/team-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mini - Market</title>
<!-- fonts google-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Big+Shoulders+Text:wght@100..900&family=Caveat:wght@400..700&family=Cedarville+Cursive&family=Fredericka+the+Great&family=Ga+Maamli&family=Lustria&family=Playwrite+AU+SA:wght@100..400&family=Playwrite+AU+TAS+Guides&family=Playwrite+DE+Grund+Guides&family=Playwrite+US+Modern+Guides&family=Roboto+Flex:opsz,wght@8..144,100..1000&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Shadows+Into+Light&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap" rel="stylesheet"
>
<!-- logo -->
<link rel="shortcut icon" href="images/mini-market-logo.png" type="image/x-icon" />
<!-- Bootstrap -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- font awesome -->
<link rel="stylesheet" href="css/all.min.css" />
<!-- Main Styles -->
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/home-style.css" />


</head>

<body style="background-color: #FEB5B1; ">
<header class="FormContainer">
<nav class="navbar navbar-expand-sm navbar-light z-3" style="background-color:rgba(254,181,177);">
<div class="container">
<img src="images/mini-market-logo.png" alt="" style="width: 30px; height: 30px; object-fit: cover;" >
<a class="navbar-brand ps-1 fs-5" href="./index.html">Mini Market</a>
<button
class="navbar-toggler d-lg-none"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapsibleNavId"
aria-controls="collapsibleNavId"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="collapsibleNavId">
<ul class="navbar-nav ms-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link fs-6" href="./pages/products.html">Products</a>
</li>
</ul>
</div>
</div>
</nav>

<section class="my-5">
<div class="container">
<h1 class="text-white">
<img class="align-middle" width="50px" src="images/mini-market-logo.png" alt="" />
<span class="align-middle" id="textOne" style="color: #604cf8;">Welcome to Mini - Market</span>
</h1>
<h2 class="text-white my-4">
<span class=" rounded-3 px-4 text-white p-2" style="background-color: #604cf8;">All Products: [ <span id="counter"></span> ]</span>
</h2>
<div class="row g-4" id="productContainer"></div>
</div>
</section>
</header>


<!-- Bootstrap -->
<script src="js/bootstrap.bundle.min.js"></script>
<!-- script.js -->
<script src="js/script.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions js/all.min.js

Large diffs are not rendered by default.

100 changes: 100 additions & 0 deletions js/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/** Helper Functions */
function validateEmail(email) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailRegex.test(email);
}

function validatePassword(password) {
return password.length >= 6; // Minimum password length
}

/** Handle Sign Up */
const signUpForm = document.getElementById("signUpForm");
if (signUpForm) {
signUpForm.addEventListener("submit", (e) => {
e.preventDefault();

const name = document.getElementById("signUpName").value.trim();
const email = document.getElementById("signUpEmail").value.trim();
const password = document.getElementById("signUpPassword").value.trim();

// Validation
if (!name || !email || !password) {
alert("All fields are required!");
return;
}
if (!validateEmail(email)) {
alert("Please enter a valid email address!");
return;
}
if (!validatePassword(password)) {
alert("Password must be at least 6 characters long!");
return;
}

let users = JSON.parse(localStorage.getItem("users")) || [];
if (users.some((user) => user.email === email)) {
alert("User already exists with this email!");
} else {
users.push({ name, email, password });
localStorage.setItem("users", JSON.stringify(users));
alert("Sign Up Successful! You can now sign in.");
signUpForm.reset();
window.location.href = "./sign-in.html"; // Redirect to Sign In page
}
});
}

/** Handle Sign In */
const signInForm = document.getElementById("signInForm");
if (signInForm) {
signInForm.addEventListener("submit", (e) => {
e.preventDefault();

const email = document.getElementById("signInEmail").value.trim();
const password = document.getElementById("signInPassword").value.trim();

// Validation
if (!email || !password) {
alert("All fields are required!");
return;
}
if (!validateEmail(email)) {
alert("Please enter a valid email address!");
return;
}

let users = JSON.parse(localStorage.getItem("users")) || [];
const user = users.find((user) => user.email === email && user.password === password);

if (user) {
alert(`Welcome back, ${user.name}!`);
localStorage.setItem("currentUser", JSON.stringify(user));
window.location.href = "../index.html"; // Redirect to Home page
} else {
alert("Invalid email or password!");
}
});
}

/** Check Authentication on Protected Pages */
function checkAuthentication() {
const currentUser = localStorage.getItem("currentUser");
if (!currentUser) {
alert("You must be logged in to access this page!");
window.location.href = "./sign-in.html"; // Redirect to Sign In page
}
}

/** Example: Run checkAuthentication on protected pages */
if (window.location.pathname.includes("index.html")) {
checkAuthentication();
}

/** Handle Logout */
function logout() {
localStorage.removeItem("currentUser");
alert("You have been logged out!");
window.location.href = "./sign-in.html"; // Redirect to Sign In page
}

7 changes: 7 additions & 0 deletions js/bootstrap.bundle.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 160e817

Please sign in to comment.