Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="product-card">
<div class="product-tumb">
<img src="https://i.imgur.com/xdbHo4E.png" alt="">
</div>
<div class="product-details">
<span class="product-catagory">Women,bag</span>
<h4><a href="">Women leather bag</a></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero, possimus nostrum!</p>
<div class="product-bottom-details">
<div class="product-price">$230.99</div>
<div class="product-links">

<button href="">Add to cart</button>
</div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,31 @@ import Dashboard from './pages/Dashboard'
import Categories from './pages/Categories'
import Products from './pages/Products'
import Login from './pages/Login'
import Cart from './pages/Cart'
import {Navigate, Route, Routes} from 'react-router-dom'
import {useEffect,useState} from 'react'
import Drawer from './components/Drawer'


function App(props) {


const [cartItems, setCartItems] = useState([]);
const addToLocalStorage = ((addData)=>{
let obj ={
id : addData.id,
title : addData.title,
price : addData.price,
image : addData.image,
}
cartItems.push(obj)
localStorage.setItem("data", JSON.stringify(cartItems))
})
return <Routes>
<Route path="/dashboard" element={<Drawer/>}/>
<Route path="/categories" element={<Drawer {...props}/>}/>
<Route path="/products" element={<Drawer/>}/>
<Route path="/login" element={<Login/>}/>
<Route path="/products" element={<Drawer onAdd={addToLocalStorage}/>}/>
<Route path="/" element={<Login/>}/>
<Route path="/cart" element={<Drawer setCartItems={setCartItems}/>}/>


</Routes>
}
Expand Down
133 changes: 133 additions & 0 deletions src/Css/Card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700');
*
{
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}


body
{
font-family: 'Roboto', sans-serif;
}
a
{
text-decoration: none;
}
.Card {
margin-top: 20px;
display: grid;
grid-template-columns: repeat(3,35rem);
grid-template-rows: repeat(3);
align-items: center;
justify-content: center;
width: 100%;
height: 100%;

}

.productBtn {
border: none;
padding: 15px 25px;
font-size: 12px;
font-weight: 500;
background-color: #fbb72c;
color: white;
border-radius: 10px;
cursor: pointer;
}
.product-card {
width: 380px;
justify-content: center;
align-items: center;
position: relative;
box-shadow: 0 2px 7px #dfdfdf;
margin: 10px;
background: #fafafa;
}
.product-tumb {
display: flex;
align-items: center;
justify-content: center;
height: 300px;
padding: 25px;
background: #f0f0f0;
}

.product-tumb img {
max-width: 100%;
max-height: 100%;
}

.product-details {
padding: 30px;
}

.product-catagory {
display: block;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
color: #ccc;
margin-bottom: 18px;
}

.product-details h4 a {
font-weight: 500;
display: block;
margin-bottom: 18px;
text-transform: uppercase;
color: #363636;
text-decoration: none;
transition: 0.3s;
}
.product-details p {
font-size: 15px;
line-height: 22px;
margin-bottom: 18px;
color: #999;
}

.product-bottom-details {
overflow: hidden;
border-top: 1px solid #eee;
padding-top: 20px;
}

.product-bottom-details div {
float: left;
width: 50%;
align-items: center;
}

.product-price {
font-size: 18px;
color: #fbb72c;
font-weight: 600;
}

.product-price small {
font-size: 80%;
font-weight: 400;
text-decoration: line-through;
display: inline-block;
margin-right: 5px;
}

.product-links {
text-align: right;
}

.product-links a {
display: inline-block;
margin-left: 5px;
color: #e1e1e1;
transition: 0.3s;
font-size: 17px;
}

.product-links a:hover {
color: #fbb72c;
}
Loading