Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Design of the HomePage, Removed Corner Glitches, added new button to add product, etc #187

Merged
merged 1 commit into from
Nov 4, 2024
Merged
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
14 changes: 14 additions & 0 deletions client/package-lock.json

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

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.0",
"react-social-login-buttons": "^4.1.0",
"react-toastify": "^10.0.6",
"redux": "^5.0.1",
"styled-components": "^6.1.8"
},
Expand Down
1 change: 1 addition & 0 deletions client/src/TrailingCursor.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body {
pointer-events: none;
transition: transform 0.2s ease, opacity 0.2s ease;
opacity: 0.7;
z-index: 9999;
}

.button:hover .cursor {
Expand Down
17 changes: 10 additions & 7 deletions client/src/components/BuyCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function BuyCard({ bogo, mrp, discountPrice, imageUrl, productName, discount, id

return (
<div className='card w-56 flex justify-center align-middle flex-col border-2 rounded-[15px] relative hover:scale-105 transition transform ease-in-out duration-300'>
<div className='bg-slate-200 w-full flex justify-center rounded-t-[15px] align-top cursor-pointer' onClick={() => {
<div className='bg-slate-200 w-full flex justify-center rounded-t-[12px] align-top cursor-pointer' onClick={() => {
navigate(`/product/${id}`)
}}>
<img src={imageUrl} alt="" />
Expand Down Expand Up @@ -47,29 +47,32 @@ function BuyCard({ bogo, mrp, discountPrice, imageUrl, productName, discount, id
borderColor: '#54B22C',
color: '#249B3E',
width: '60px',
borderRadius: '5px',
borderRadius: '75px',
border: '1px solid',
}}>ADD</button>
</div>
))}
{count > 0 && (
<div className='mr-2 flex gap-2'>
<div className='mr-2 flex gap-2 border rounded-full border-green-500'>
<span
style={{
cursor: 'pointer',
marginTop: '1px',
userSelect: 'none'
userSelect: 'none',
paddingLeft:"8px",

}} onClick={() => {
if (count >= 1 && count < 10)
setCount(count + 1);
addToCart({ id, productName, discountPrice, imageUrl, count: count + 1 });
}}>+</span>
<div><input type="text" className='w-6 border-2 indent-1' value={count} /></div>
<div><input type="text" className=' w-8 bg-green-500 text-white text-center select-none h-full' value={count} /></div>
<span
style={{
cursor: 'pointer',
marginTop: '1px',
userSelect: 'none'
userSelect: 'none',
paddingRight:"8px",
}}
onClick={() => {
if (count >= 1) {
Expand All @@ -86,7 +89,7 @@ function BuyCard({ bogo, mrp, discountPrice, imageUrl, productName, discount, id
backgroundColor: '#54B22C',
color: 'white',
padding: '5px',
borderRadius: '0 17px 0 15px',
borderRadius: '0 13px 0 15px',
}}>
{discount || parseInt((mrp - discountPrice) / mrp * 100) || '$'}% OFF
</div>
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Carousel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ const CarouselComponent = () => {
PrevIcon={<NextIcon reverse/>}
>
{images.map((imageUrl, index) => (
<Paper key={index}>
<Paper key={index} style={{borderBottomLeftRadius: '40px',borderBottomRightRadius: '40px'}}>
<img src={imageUrl} alt="" style={{
width: '100%',
height: '100%',
objectFit: 'cover',
borderBottomLeftRadius: '40px',borderBottomRightRadius: '40px'

}}/>
</Paper>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/TopCategoriesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function TopCategoriesList() {
{categories.map((category, index) => (
<motion.div
key={index}
className='flex flex-col items-center cursor-pointer'
className='flex flex-col items-center cursor-pointer border p-1.5 rounded-2xl'
variants={listItemVariants}
onClick={()=>{
navigate(`/categories/${encodeURIComponent(category.name.toLowerCase())}`);
Expand All @@ -40,9 +40,9 @@ function TopCategoriesList() {
<img
src={`/images/${category.image}`}
alt={category.name}
className=' transition transform ease-in-out hover:scale-105 duration-300'
className=' transition transform ease-in-out hover:scale-105 duration-300 rounded-2xl'
/>
<p className='text-center font hover:underline'>{category.name}</p>
<p className='text-center font hover:underline mt-2 sm:text-sm'>{category.name}</p>
</motion.div>
))}
</motion.div>
Expand Down
3 changes: 3 additions & 0 deletions client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ body {
background-color: #46d346;
border-radius: 20px;
}
*{
user-select: none;
}

Loading