Skip to content

Commit

Permalink
Add features like search, products, shopping cart and others
Browse files Browse the repository at this point in the history
  • Loading branch information
MI-Programmer committed Mar 24, 2024
1 parent 4c8d8ea commit 15f4809
Show file tree
Hide file tree
Showing 8 changed files with 489 additions and 12 deletions.
253 changes: 251 additions & 2 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,93 @@ html {
display: none;
}

/* Navbar Search Form */
.navbar .search-form {
position: absolute;
top: 100%;
right: 7%;
background-color: #fff;
width: 50rem;
height: 5rem;
display: flex;
align-items: center;
transform: scaleY(0);
transform-origin: top;
transition: 0.3s;
}

.navbar .search-form.active {
transform: scaleY(1);
}

.navbar .search-form input {
height: 100%;
width: 100%;
font-size: 1.6rem;
color: var(--bg);
background: #fff;
padding: 1rem;
}

.navbar .search-form label {
cursor: pointer;
font-size: 2rem;
margin-right: 1.5rem;
color: var(--bg);
}

/* Shopping Cart */

.shopping-cart {
position: absolute;
top: 100%;
right: -100%;
height: 100vh;
width: 35rem;
padding: 0 1.5rem;
background-color: #fff;
color: var(--bg);
transition: 0.3s;
}

.shopping-cart.active {
right: 0;
}

.shopping-cart .cart-item {
margin: 2rem 0;
display: flex;
align-items: center;
gap: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px dashed #666;
position: relative;
}

.shopping-cart .cart-item img {
height: 6rem;
border-radius: 50%;
}

.shopping-cart .cart-item h3 {
font-size: 1.6rem;
padding-bottom: 0.5rem;
}

.shopping-cart .cart-item .item-price {
font-size: 1.2rem;
}

.shopping-cart .cart-item .remove-item {
position: absolute;
right: 1rem;
cursor: pointer;
}

.shopping-cart .cart-item .remove-item:hover {
color: var(--primary);
}

/* Hero Section */

.hero {
Expand Down Expand Up @@ -152,16 +239,18 @@ html {
position: relative;
}

/* About, Menu, Contact Section*/
/* About, Menu, products, Contact Section*/

.about,
.menu,
.products,
.contact {
padding: 8rem 7% 1.4rem;
}

.about h2,
.menu h2,
.products h2,
.contact h2 {
text-align: center;
font-size: 2.6rem;
Expand All @@ -170,6 +259,7 @@ html {

.about h2 span,
.menu h2 span,
.products h2 span,
.contact h2 span {
color: var(--primary);
}
Expand Down Expand Up @@ -203,13 +293,15 @@ html {
line-height: 1.6;
}

/* Menu, contact section */
/* Menu, products, contact section */
.menu h2,
.products h2,
.contact h2 {
margin-bottom: 1rem;
}

.menu p,
.products p,
.contact p {
text-align: center;
max-width: 30rem;
Expand Down Expand Up @@ -240,6 +332,76 @@ html {
margin: 1rem auto 0.5rem;
}

/* Products .row */
.products .row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
gap: 1.5rem;
margin-top: 4rem;
}

.products .product-card {
text-align: center;
border: 1px solid #666;
padding: 2rem;
}

.products .product-icons {
display: flex;
justify-content: center;
gap: 0.5rem;
}

.products .product-icons a {
width: 4rem;
height: 4rem;
color: #fff;
margin: 0.3rem;
border: 1px solid #666;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}

.products .product-icons a:hover {
background-color: var(--primary);
border: 1px solid var(--primary);
}

.products .row .product-image {
padding: 1rem 0;
}

.products .row .product-image img {
height: 25rem;
}

.products .product-content h3 {
font-size: 2rem;
}

.products .product-content .product-stars {
font-size: 1.7rem;
padding: 0.8rem;
color: var(--primary);
}

.products .product-content .product-stars .star-full {
fill: var(--primary);
}

.products .product-price {
font-size: 1.3rem;
font-weight: bold;
}

.products .product-price span {
text-decoration: line-through;
font-weight: lighter;
font-size: 1rem;
}

/* Contact section */

.contact .row {
Expand Down Expand Up @@ -325,6 +487,77 @@ footer .credit a {
font-weight: 700;
}

/* Modal Box */
/* Item Detail */
.modal {
display: none;
position: fixed;
z-index: 2000;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100vh;
overflow: auto;
background-color: rgba(0, 0, 0, 0.7);
}

.modal .modal-container {
position: relative;
background-color: #fefefe;
color: var(--bg);
margin: 15% auto 10%;
padding: 1.2rem;
border: 1px solid #666;
width: 80%;
animation: animateModal 0.5s;
}

/* Modal Animation */
@keyframes animateModal {
from {
top: -300px;
opacity: 0;
}
to {
top: 0;
opacity: 1;
}
}

.modal .modal-container .close-icon {
position: absolute;
right: 1rem;
}

.modal .modal-container .modal-content {
display: flex;
flex-wrap: nowrap;
}

.modal .modal-container .modal-content img {
height: 20rem;
margin-right: 2rem;
margin-bottom: 2rem;
}

.modal .modal-container .modal-content p {
font-size: 1.2rem;
line-height: 1.8rem;
margin-top: 1.2rem;
}

.modal .modal-container .modal-content a {
display: flex;
gap: 1rem;
width: 12rem;
background-color: var(--primary);
color: #fff;
margin-top: 1rem;
padding: 1rem 1.6rem;
}

/* Media Queries */

/* Laptop */
Expand Down Expand Up @@ -377,6 +610,10 @@ footer .credit a {
right: 0;
}

.navbar .search-form {
width: 86%;
}

.about .row {
flex-wrap: wrap;
}
Expand Down Expand Up @@ -415,6 +652,14 @@ footer .credit a {
.contact .row form {
padding-top: 0;
}

.modal .modal-container {
margin-bottom: 5%;
}

.modal .modal-container .modal-content {
flex-wrap: wrap;
}
}

/* Mobile Phone */
Expand All @@ -423,4 +668,8 @@ footer .credit a {
html {
font-size: 55%;
}

.modal .modal-container {
margin-bottom: 15%;
}
}
Binary file added img/products/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 img/products/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 img/products/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 img/products/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 15f4809

Please sign in to comment.