Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
john-smilga committed Mar 24, 2019
0 parents commit 35cba59
Show file tree
Hide file tree
Showing 12 changed files with 336 additions and 0 deletions.
Binary file added images/hero-bcg.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions images/logo.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/product-1.jpeg
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/product-2.jpeg
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/product-3.jpeg
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/product-4.jpeg
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/product-5.jpeg
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/product-6.jpeg
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/product-7.jpeg
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/product-8.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
264 changes: 264 additions & 0 deletions main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
@import url("https://fonts.googleapis.com/css?family=Lato:400,700");

:root {
--primaryColor: #f09d51;
--mainWhite: #fff;
--mainBlack: #222;
--mainGrey: #ececec;
--mainSpacing: 0.1rem;
--mainTransition: all 0.3s linear;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
color: var(--mainBlack);
background: var(--mainWhite);
font-family: "Lato", sans-serif;
}
/* --------------- Navbar ---------------- */
.navbar {
background: var(--mainWhite);
position: sticky;
top: 0;
height: 60px;
width: 100%;
display: flex;
align-items: center;
background: rgb(231, 226, 221);
z-index: 1;
}
.navbar-center {
width: 100%;
max-width: 1170px;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 1.5rem;
}
.nav-icon {
font-size: 1.5rem;
}
.cart-btn {
position: relative;
cursor: pointer;
}
.cart-items {
position: absolute;
top: -8px;
right: -8px;
background: var(--primaryColor);
padding: 0 5px;
border-radius: 30%;
color: var(--mainWhite);
}
/* --------------- End of Navbar ---------------- */
/* --------------- Hero ---------------- */
.hero {
min-height: calc(100vh - 60px);
background: url("./images/hero-bcg.jpeg") center/cover no-repeat;
display: flex;
align-items: center;
justify-content: center;
}
.banner {
text-align: center;
background: rgba(255, 255, 255, 0.8);
display: inline-block;
padding: 2rem;
}
.banner-title {
font-size: 3.4rem;
text-transform: uppercase;
letter-spacing: var(--mainSpacing);
margin-bottom: 3rem;
}
.banner-btn {
padding: 1rem 3rem;
text-transform: uppercase;
letter-spacing: var(--mainSpacing);
font-size: 1rem;
background: var(--primaryColor);
color: var(--mainBlack);
border: 1px solid var(--primaryColor);
transition: var(--mainTransition);
cursor: pointer;
}
.banner-btn:hover {
background: transparent;
color: var(--primaryColor);
}
/* --------------- End of Hero ---------------- */

/* --------------- Cart ---------------- */
.cart-overlay {
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%;
background: transparent;
transition: var(--mainTransition);
background: rgb(240, 157, 81, 0.5);
z-index: 2;
visibility: hidden;
}
.cart {
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%;
overflow: scroll;
background: var(--mainWhite);
z-index: 3;
background: rgb(231, 226, 221);
padding: 1.5rem;
transition: var(--mainTransition);
transform: translateX(100%);
}
.showCart {
transform: translateX(0);
}
.transparentBcg {
visibility: visible;
}
@media screen and (min-width: 768px) {
.cart {
width: 30vw;
min-width: 450px;
}
}

.close-cart {
font-size: 1.7rem;
cursor: pointer;
}
.cart h2 {
text-transform: capitalize;
text-align: center;
letter-spacing: var(--mainSpacing);
margin-bottom: 2rem;
}
/*---------- Cart Item -------------------- */
.cart-item {
display: grid;
align-items: center;
grid-template-columns: auto 1fr auto;
grid-column-gap: 1.5rem;
margin: 1.5rem 0;
}
.cart-item img {
width: 75px;
height: 75px;
}
.cart-item h4 {
font-size: 0.85rem;
text-transform: capitalize;
letter-spacing: var(--mainSpacing);
}
.cart-item h5 {
margin: 0.5rem 0;
letter-spacing: var(--mainSpacing);
}
.item-amount {
text-align: center;
}
.remove-item {
color: grey;
cursor: pointer;
}
.fa-chevron-up,
.fa-chevron-down {
color: var(--primaryColor);
cursor: pointer;
}
/*---------- End of Cart Item -------------------- */

.cart-footer {
margin-top: 2rem;
letter-spacing: var(--mainSpacing);
text-align: center;
}
.cart-footer h3 {
text-transform: capitalize;
margin-bottom: 1rem;
}

/* --------------- End of Cart ---------------- */

/* --------------- Products ---------------- */

.products {
padding: 4rem 0;
}
.section-title h2 {
text-align: center;
font-size: 2.5rem;
margin-bottom: 5rem;
text-transform: capitalize;
letter-spacing: var(--mainSpacing);
}
.products-center {
width: 90vw;
margin: 0 auto;
max-width: 1170px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
grid-column-gap: 1.5rem;
grid-row-gap: 2rem;
}
.img-container {
position: relative;
overflow: hidden;
}
.bag-btn {
position: absolute;
top: 70%;
right: 0;
background: var(--primaryColor);
border: none;
text-transform: uppercase;
padding: 0.5rem 0.75rem;
letter-spacing: var(--mainSpacing);
font-weight: bold;
transition: var(--mainTransition);
transform: translateX(101%);
cursor: pointer;
}
.bag-btn:hover {
color: var(--mainWhite);
}
.fa-shopping-cart {
margin-right: 0.5rem;
}
.img-container:hover .bag-btn {
transform: translateX(0);
}
.product-img {
display: block;
width: 100%;
min-height: 12rem;
transition: var(--mainTransition);
}
.img-container:hover .product-img {
opacity: 0.5;
}

.product h3 {
text-transform: capitalize;
font-size: 1.1rem;
margin-top: 1rem;
letter-spacing: var(--mainSpacing);
text-align: center;
}

.product h4 {
margin-top: 0.7rem;
letter-spacing: var(--mainSpacing);
color: var(--primaryColor);
text-align: center;
}
68 changes: 68 additions & 0 deletions products.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"items": [
{
"sys": { "id": "1" },
"fields": {
"title": "queen panel bed",
"price": 10.99,
"image": { "fields": { "file": { "url": "./images/product-1.jpeg" } } }
}
},
{
"sys": { "id": "2" },
"fields": {
"title": "king panel bed",
"price": 12.99,
"image": { "fields": { "file": { "url": "./images/product-2.jpeg" } } }
}
},
{
"sys": { "id": "3" },
"fields": {
"title": "single panel bed",
"price": 12.99,
"image": { "fields": { "file": { "url": "./images/product-3.jpeg" } } }
}
},
{
"sys": { "id": "4" },
"fields": {
"title": "twin panel bed",
"price": 22.99,
"image": { "fields": { "file": { "url": "./images/product-4.jpeg" } } }
}
},
{
"sys": { "id": "5" },
"fields": {
"title": "fridge",
"price": 88.99,
"image": { "fields": { "file": { "url": "./images/product-5.jpeg" } } }
}
},
{
"sys": { "id": "6" },
"fields": {
"title": "dresser",
"price": 32.99,
"image": { "fields": { "file": { "url": "./images/product-6.jpeg" } } }
}
},
{
"sys": { "id": "7" },
"fields": {
"title": "couch",
"price": 45.99,
"image": { "fields": { "file": { "url": "./images/product-7.jpeg" } } }
}
},
{
"sys": { "id": "8" },
"fields": {
"title": "table",
"price": 33.99,
"image": { "fields": { "file": { "url": "./images/product-8.jpeg" } } }
}
}
]
}

1 comment on commit 35cba59

@firoz84
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi good

Please sign in to comment.