Skip to content

Commit

Permalink
fix bug: opened cart is not centered on login page
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed Jan 18, 2024
1 parent 1b107b6 commit 132e1f5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 34 deletions.
26 changes: 9 additions & 17 deletions public/styles/views/Login.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ body > main {
padding: 1rem 0;
}

article {
#login-form {
padding: 0;
overflow: hidden;
transform: translateX(-100%);
}

article div {
#login-form div {
padding: 1rem;
}

Expand All @@ -22,7 +21,7 @@ article div {
padding: 1.25rem 0;
}

article div {
#login-form div {
padding: 1.25rem;
}
}
Expand All @@ -32,7 +31,7 @@ article div {
padding: 1.5rem 0;
}

article div {
#login-form div {
padding: 1.5rem;
}
}
Expand All @@ -42,7 +41,7 @@ article div {
padding: 1.75rem 0;
}

article div {
#login-form div {
padding: 1.75rem;
}
}
Expand All @@ -52,29 +51,22 @@ article div {
padding: 2rem 0;
}

article div {
#login-form div {
padding: 2rem;
}
}

/* Nav */
summary[role="link"].secondary:is([aria-current], :hover, :active, :focus) {
background-color: transparent;
/*noinspection CssUnresolvedCustomProperty*/
color: var(--secondary-hover); /* defined in picocss */
}

/* Hero Image */
article div:nth-of-type(2) {
#login-form div:nth-of-type(2) {
display: none;
background-color: #374956;
background-image: url("https://images.unsplash.com/photo-1702234893452-52302797f873?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw0MHx8fGVufDB8fHx8fA%3D%3D");
background-image: url("../../assets/img/login-milkshake.avif");
background-position: center;
background-size: cover;
}

@media (min-width: 992px) {
.grid > div:nth-of-type(2) {
#login-form > div:nth-of-type(2) {
display: block;
}
}
Expand Down
45 changes: 28 additions & 17 deletions src/views/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,36 @@
* @var string $defaultName Default name in registration form
* @var string $defaultPassword Default password in registration form
*/

?>

<main class="container">
<article class="grid" data-aos="fade-left" data-aos-easing="linear" data-aos-duration="500">
<article id="login-form" class="grid" data-aos="fade-left" data-aos-easing="linear" data-aos-duration="500">
<div>
<h1>Sign in</h1>
<form method="post">
<input type="text" name="name" placeholder="Name" aria-label="Name" autocomplete="nickname"
value="<?php echo $defaultName; ?>" required/>
value="<?php
echo $defaultName; ?>" required/>

<?php if (!empty($errors['name'])) : ?>
<small class="warning"><?php echo $errors['name'] ?></small>
<?php endif; ?>
<?php
if (!empty($errors['name'])) : ?>
<small class="warning"><?php
echo $errors['name'] ?></small>
<?php
endif; ?>


<input type="password" name="password" placeholder="Password" aria-label="Password"
autocomplete="current-password" value="<?php echo $defaultPassword; ?>" required/>
autocomplete="current-password" value="<?php
echo $defaultPassword; ?>" required/>

<?php if (!empty($errors['password'])) : ?>
<small class="warning"><?php echo $errors['password'] ?></small>
<?php endif; ?>
<?php
if (!empty($errors['password'])) : ?>
<small class="warning"><?php
echo $errors['password'] ?></small>
<?php
endif; ?>

<fieldset>
<label for="remember">
Expand All @@ -33,19 +42,21 @@
</label>
</fieldset>
<button name="login_submit" type="submit" class="contrast">Login</button>
<?php if (!empty($errors['other'])) : ?>
<small class="warning"><?php echo $errors['other'] ?></small>
<?php endif; ?>

<div><small>Don't have an account yet? <a href="<?= ROOT ?>/register">Register</a></small></div>
<?php
if (!empty($errors['other'])) : ?>
<small class="warning"><?php
echo $errors['other'] ?></small>
<?php
endif; ?>
<small>Don't have an account yet? <a href="<?= ROOT ?>/register">Register</a></small>
</form>
</div>
<div></div>
</article>
</main>

<script>
document.addEventListener('DOMContentLoaded', function () {
AOS.init();
});
document.addEventListener("DOMContentLoaded", function() {
AOS.init();
});
</script>

0 comments on commit 132e1f5

Please sign in to comment.