Skip to content

Commit

Permalink
Merge branch 'main' into Sandali
Browse files Browse the repository at this point in the history
  • Loading branch information
nsavinda authored Sep 28, 2023
2 parents 8a9bc0f + 83646c6 commit 5c784d8
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 21 deletions.
2 changes: 1 addition & 1 deletion app/controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private function setcookie(array $userData): void{
print_r($userData);
$token = JWT::encode($userData, SECRET_KEY, 'HS256');

setcookie('jwt_auth_token', $token, time() + 3600, '/', '', false, true);
setcookie('jwt_auth_token', $token, time() + 36000, '/', '', false, true);

// echo json_encode(['token' => $token]);

Expand Down
8 changes: 7 additions & 1 deletion app/views/home.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@
<br>
<a href="<?= ROOT_DIR ?>/signup" title="Signup">Signup</a>
<br>
<a href="<?= ROOT_DIR ?>/logout" title="Logout">Logout</a> -->
<a href="<?= ROOT_DIR ?>/logout" title="Logout">Logout</a> -->

<?php
require_once('../app/views/layout/footer.php');


?>
1 change: 1 addition & 0 deletions app/views/layout/footer.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

</body>
</html>
51 changes: 33 additions & 18 deletions app/views/login.view.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<form action="<?=ROOT_DIR?>/login" method="post">
<?php
require_once('../app/views/layout/header.php');


?>
<div class="login-container">
<!-- <h1>Login</h1> -->
<form class="login-form" action="<?=ROOT_DIR?>/login" method="post">
<h2>Login</h2>


<?php if(isset($errors)): ?>
<div> <?= implode('<br>', $errors)?> </div>
<?php endif; ?>

<label for="email">Email</label>
<input type="text" name="email" id="username">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<input type="submit" name="submit" value="Login">
<input type="text" name="email" id="email" placeholder="Email" required>
<label for="password" >Password</label>
<input type="password" name="password" id="password" placeholder="Password" required>
<div class="message-text">
<a href="#">Forgot your password?</a>
</div>
<input type="submit" name="submit" value="login">

<p>
Don't have an account? <a href="<?=ROOT_DIR?>/signup">Signup</a>
<p>


</form>
<a href="<?=ROOT_DIR?>/signup" title="Signup">Signup</a>
<a href="<?=ROOT_DIR?>" title="Home">Home</a>
</body>
</html>
<!-- <a href="<?=ROOT_DIR?>/signup" title="Signup">Signup</a>
<a href="<?=ROOT_DIR?>" title="Home">Home</a> -->
</div>



<?php
require_once('../app/views/layout/footer.php');


?>



93 changes: 93 additions & 0 deletions public/Login/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
body {
margin: 0;
padding: 0;
font-family: "Montserrat", sans-serif;
background-color: #f8f8f8;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.background-square {
display: flex;
justify-content: center;
align-items: center;
width: 1300px;
height: 600px;
border-radius: 10px;
background: #ECECEC;
backdrop-filter: blur(67px);
}

.login-form {
max-width: 450px;
padding: 40px;
border-radius: 10px;
background-color: #fff;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.login-form h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
text-transform: uppercase;
letter-spacing: 3px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
display: block;
background-color: #ECECEC;
width: 350px;
padding: 10px;
margin-bottom: 10px;
border: none;
border-radius: 5px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.login-form input[type="submit"] {
display: block;
width: 100%;
padding: 10px;
border: 1px solid #BCAB86;
border-radius: 5px;
background-color: #88915D;
color: #fff;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;

}

.login-form input[type="submit"]:hover {
border: 1px solid #BCAB86;
background-color: #ECECEC;
color: #4C5039;
}

.login-form p {
text-align: center;
margin-top: 10px;
font-size: 12px;
}

.login-form a {
color: #333;
text-decoration: none;
transition: color 0.3s ease;
text-align: right;
}

.login-form a:hover {
color: #88915D;
}

.message-text {
text-align: right;
margin-top: 10px;
margin-bottom: 10px;
font-size: 10px;
}
30 changes: 30 additions & 0 deletions public/Login/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="login.css" rel="stylesheet">
</head>

<body>
<div class="background-square">
<form class="login-form">
<h2>Login</h2>
<input type="text" placeholder="Email" required />
<input type="password" placeholder="Password" required />
<div class="message-text">
<a href="#">Forgot your password?</a>
</div>

<input type="submit" value="Login" />
<p>
Don't have an account? <a href="#">Signup</a>
<p>

</form>
</div>
</body>

</html>
91 changes: 90 additions & 1 deletion public/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ body {
line-height: 117.9%; /* 33.012px */
}


.about-title {
color: #4C5039;
text-shadow: 0px 2.5296311378479004px 2.5296311378479004px rgba(0, 0, 0, 0.25);
Expand Down Expand Up @@ -204,4 +205,92 @@ body {
font-weight: 500;
line-height: 117.9%;
margin-bottom: 0%!important;
}
}



/* Login Page */

.login-container {
display: flex;
justify-content: center;
align-items: center;
width: 1300px;
height: 600px;
border-radius: 10px;
background: #ECECEC;
backdrop-filter: blur(67px);
}

.login-form {
max-width: 450px;
padding: 40px;
border-radius: 10px;
background-color: #fff;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.login-form h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
text-transform: uppercase;
letter-spacing: 3px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
display: block;
background-color: #ECECEC;
width: 350px;
padding: 10px;
margin-bottom: 10px;
border: none;
border-radius: 5px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.login-form input[type="submit"] {
display: block;
width: 100%;
padding: 10px;
border: 1px solid #BCAB86;
border-radius: 5px;
background-color: #88915D;
color: #fff;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;

}

.login-form input[type="submit"]:hover {
border: 1px solid #BCAB86;
background-color: #ECECEC;
color: #4C5039;
}

.login-form p {
text-align: center;
margin-top: 10px;
font-size: 12px;
}

.login-form a {
color: #333;
text-decoration: none;
transition: color 0.3s ease;
text-align: right;
}

.login-form a:hover {
color: #88915D;
}

.message-text {
text-align: right;
margin-top: 10px;
margin-bottom: 10px;
font-size: 10px;
}

0 comments on commit 5c784d8

Please sign in to comment.