Skip to content

Commit

Permalink
Adding some features
Browse files Browse the repository at this point in the history
  • Loading branch information
guanshiyin28 committed Dec 16, 2024
1 parent c40f0ee commit 32c650d
Show file tree
Hide file tree
Showing 4 changed files with 469 additions and 10 deletions.
263 changes: 259 additions & 4 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,94 @@ body {
display: none;
}

/* Navbar Search form */
.navbar .search-form {
position: absolute;
top: 115%;
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);
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 img {
height: 6rem;
border-radius: 50%;
}

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

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

.shopping-cart .remove-item {
position: absolute;
right: 1rem;
font-size: 1.2rem;
cursor: pointer;
color: var(--bg);
transition: 0.3s;
}

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

/* Hero Section */
.hero {
min-height: 100vh;
Expand Down Expand Up @@ -150,12 +238,14 @@ body {
/* About Section */
.about,
.menu,
.products,
.contact {
padding: 6rem 7% 1.4rem;
}

.about h2,
.menu h2,
.products h2,
.contact h2 {
text-align: center;
font-size: 2rem;
Expand All @@ -164,6 +254,7 @@ body {

.about h2 span,
.menu h2 span,
.products h2 span,
.contact h2 span {
color: var(--primary);
}
Expand Down Expand Up @@ -199,11 +290,13 @@ body {

/* Menu 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 @@ -237,6 +330,79 @@ body {
font-size: 0.8rem;
}

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

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

.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 #fff;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
transition: 0.4s;
}

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

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

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

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

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

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

.products .product-price {
font-size: 1.2rem;
font-weight: 700;
}

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

/* Contact Section */
.contact .row {
display: flex;
Expand All @@ -251,8 +417,8 @@ body {
}

.contact .row form {
flex: 1 1 45rem;
padding: 5rem 2rem;
flex: 1 1 30rem;
padding: 2rem 4rem;
text-align: center;
}

Expand All @@ -268,7 +434,7 @@ body {
.contact .row form .input-group input {
width: 100%;
padding: 2rem;
font-size: 1.7rem;
font-size: 1rem;
background: none;
color: #fff;
}
Expand All @@ -277,10 +443,16 @@ body {
margin-top: 3rem;
display: inline-block;
padding: 1rem 3rem;
font-size: 1.7rem;
font-size: 1rem;
color: #fff;
background-color: var(--primary);
border-radius: 0.5rem;
cursor: pointer;
transition: 0.3s;
}

.contact .row form .btn:hover {
background-color: var(--bg);
}

/* Footer */
Expand Down Expand Up @@ -323,6 +495,80 @@ footer .credit a {
font-weight: 700;
}

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

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

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

to {
top: 0px;
opacity: 1;
}
}

.modal-container .close-icon {
position: absolute;
top: 0.5rem;
right: 1rem;
cursor: pointer;
}

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

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

.modal-content p {
font-size: 0.9rem;
line-height: 1.5;
margin-top: 1rem;
}

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

/* Media Queries */
/* Laptop */
@media (max-width: 1366px) {
Expand Down Expand Up @@ -371,6 +617,11 @@ footer .credit a {
transform: scaleX(0.2);
}

.navbar .search-form {
width: 90%;
right: 2rem;
}

.about .row {
flex-wrap: wrap;
}
Expand Down Expand Up @@ -411,6 +662,10 @@ footer .credit a {
padding-top: 0;
}

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

/* Mobile Phone */
@media (max-width: 450px) {
html {
Expand Down
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.
Loading

0 comments on commit 32c650d

Please sign in to comment.