diff --git a/src/Components/Login.css b/src/Components/Login.css index d213dfe4..d060f040 100644 --- a/src/Components/Login.css +++ b/src/Components/Login.css @@ -232,7 +232,6 @@ form.sign-in-form { grid-template-columns: repeat(2, 1fr); } - .container1:before { content: ""; position: absolute; @@ -248,7 +247,7 @@ form.sign-in-form { darkturquoise 100% ); transition: 1.8s ease-in-out; - border-radius: 80%; + border-radius: 50% 50% 0 0; /* Changed to a semi-circle */ z-index: 6; } diff --git a/src/Components/cart/12.png b/src/Components/cart/12.png new file mode 100644 index 00000000..f1c07cec Binary files /dev/null and b/src/Components/cart/12.png differ diff --git a/src/Components/cart/cart.css b/src/Components/cart/cart.css index 86ca0510..60d62968 100644 --- a/src/Components/cart/cart.css +++ b/src/Components/cart/cart.css @@ -1,84 +1,85 @@ body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - background-color: #1f1c35; - color: white; - } - - .cart-container { - text-align: center; - margin-top: 50px; - } - - .cart-top { - position: fixed; - top: 10px; - right: 10px; - background-color: #ff21bc; - padding: 10px; - border-radius: 50%; - color: white; - cursor: pointer; - display: flex; - align-items: center; - } - - .cart-icon { - width: 24px; - height: 24px; - vertical-align: middle; - margin-right: 10px; - } - - .cart-count { - margin-left: 5px; - font-size: 16px; - } - - .cart-item { - border: 1px solid #ddd; - padding: 10px; - margin: 10px; - display: inline-block; - width: calc(33% - 40px); - box-sizing: border-box; - text-align: left; - box-shadow: 7px 7px 32px 0 #6052ff; - position: relative; - } - - .add-to-cart, - .remove-from-cart { - background-color: #ff21bc; - color: #fff; - border: none; - padding: 10px; - position: absolute; - bottom: 10px; - left: 30%; - transform: translateX(-50%); - border-radius: 3px; - cursor: pointer; - } - - .remove-from-cart { - left: 70%; - } - - .shop-today a { - color: #007185; - text-decoration: none; - font-weight: bold; - } - - .cart-signin button { - background-color: #ff21bc; - border: 1px solid #a88734 #9c7e31 #846a29; - color: #fff; - padding: 10px 20px; - margin: 10px; - cursor: pointer; - border-radius: 3px; - } - \ No newline at end of file + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #1f1c35; + color: white; +} + +.cart-container { + text-align: center; + margin-top: 50px; +} + +.cart-top { + position: fixed; + top: 10px; + right: 10px; + background-color: #ff21bc; + padding: 10px; + border-radius: 50%; + color: white; + cursor: pointer; + display: flex; + align-items: center; +} + +.cart-icon { + width: 24px; + height: 24px; + vertical-align: middle; + margin-right: 10px; +} + +.cart-count { + margin-left: 5px; + font-size: 16px; +} + +.cart-item { + border: 1px solid #ddd; + padding: 10px; + margin: 10px; + display: inline-block; + width: calc(33% - 40px); + box-sizing: border-box; + text-align: left; + box-shadow: 7px 7px 32px 0 #6052ff; + position: relative; +} + +.add-to-cart, +.remove-from-cart { + background-color: #ff21bc; + color: #fff; + border: none; + padding: 10px; + position: absolute; + bottom: 10px; + left: 30%; + transform: translateX(-50%); + border-radius: 3px; + cursor: pointer; +} + +.remove-from-cart { + left: 70%; +} + +.shop-today a { + color: #007185; + text-decoration: none; + font-weight: bold; +} + +.cart-signin button { + background-color: #ff21bc; + border: 1px solid #a88734 #9c7e31 #846a29; + color: #fff; + padding: 10px 20px; + margin: 10px; + cursor: pointer; + border-radius: 3px; + justify-content: flex-end; /* Aligns content (button) to the right */ + padding: 10px; /* Optional padding for the container */ +} diff --git a/src/Components/cart/cart.js b/src/Components/cart/cart.js index f46d9c05..588ed8a4 100644 --- a/src/Components/cart/cart.js +++ b/src/Components/cart/cart.js @@ -1,128 +1,251 @@ -// src/components/ShoppingCart.js -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; +import { Link } from "react-router-dom"; +import homeIcon from '../../img/homeicon.png'; +import carticon from './12.png'; +import Card1 from "../../img/card1.jpg"; +import Card2 from "../../img/card2.jpg"; +import Card3 from "../../img/card3.jpg"; +import Card4 from "../../img/card4.jpg"; +import Card5 from "../../img/card5.jpg"; +import Card6 from "../../img/card6.jpg"; +import { useNavigate } from 'react-router-dom'; -const ShoppingCart = () => { - const [cartItems, setCartItems] = useState([]); - const [totalItems, setTotalItems] = useState(0); - const [totalPrice, setTotalPrice] = useState(0); +const Cart = () => { + const initialItems = [ + { id: 1, name: 'StockIT', price: 10, quantity: 0, image: Card1 }, + { id: 2, name: 'TakeNote', price: 12, quantity: 0, image: Card2 }, + { id: 3, name: 'TaRct', price: 21, quantity: 0, image: Card3 }, + { id: 4, name: 'To Do', price: 13, quantity: 0, image: Card4 }, + { id: 5, name: 'ArchiTect', price: 15, quantity: 0, image: Card5 }, + { id: 6, name: 'WeatherLy', price: 17, quantity: 0, image: Card6 }, + { id: 7, name: 'TypingTest', price: 11, quantity: 0, image: '/static/media/card7.b25b2be8caee889d6ad4.png' }, + { id: 8, name: 'Artisan', price: 18, quantity: 0, image: '/static/media/card8.5c7a98cedad9864c46b7.png' }, + { id: 9, name: 'BBlocks', price: 25, quantity: 0, image: '/static/media/card9.6d96022c8f0793e6dd91.png' }, + { id: 10, name: 'ZzShoes', price: 19, quantity: 0, image: '/static/media/card10.a53e1291e52ef0a4c11c.png' }, + { id: 11, name: 'SearchImage', price: 13, quantity: 0, image: '/static/media/card11.e2371ccc231824202cda.png' }, + { id: 12, name: 'Alimage', price: 20, quantity: 0, image: '/static/media/card12.093d95181352dfd0126b.png' }, + ]; - useEffect(() => { - const items = JSON.parse(localStorage.getItem('cartItems')) || []; - setCartItems(items); + const [cartItems, setCartItems] = useState(initialItems); + const [cartCount, setCartCount] = useState( + initialItems.reduce((total, item) => total + item.quantity, 0) + ); - let itemsCount = 0; - let priceTotal = 0; + const addToCart = (itemId) => { + setCartItems((prevItems) => + prevItems.map((item) => + item.id === itemId + ? { ...item, quantity: item.quantity + 1 } + : item + ) + ); + setCartCount(cartCount + 1); + }; - items.forEach(item => { - itemsCount += item.quantity; - priceTotal += item.price * item.quantity; - }); + const removeFromCart = (itemId) => { + const item = cartItems.find((item) => item.id === itemId); + if (item && item.quantity > 0) { + setCartItems((prevItems) => + prevItems.map((item) => + item.id === itemId + ? { ...item, quantity: item.quantity - 1 } + : item + ) + ); + setCartCount(cartCount - 1); + } + }; - setTotalItems(itemsCount); - setTotalPrice(priceTotal); - }, []); + const navigate = useNavigate(); - const checkout = () => { - alert('Proceeding to checkout...'); + const signIn = () => { + navigate('/login'); // Navigate to the login page + window.scrollTo(0, 0); + }; + + const signUp = () => { + navigate('/login'); // Navigate to the login page + window.scrollTo(0, 0); }; return ( -
-
-

Your Cart

-
- {cartItems.map((item, index) => ( -
-
-

{item.name}

-

Quantity: {item.quantity}

-

Price: ${item.price * item.quantity}

+
+ + +
+ + Cart Icon + + {cartCount} +
+
+ + Home + + {cartItems.map((item) => ( +
+ {item.name} +

{item.name}

+
+
+ Price +

{item.price}

+
+
+ Quantity +

{item.quantity}

- ))} -
-
-

Total Items: {totalItems}

-

Total Price: ${totalPrice.toFixed(2)}

- -
+
+ + +
+
+ ))} +
+ +
+ +
-
); }; -export default ShoppingCart; +export default Cart; diff --git a/src/Components/cart/index.html b/src/Components/cart/index.html index 1035da39..ec23ee29 100644 --- a/src/Components/cart/index.html +++ b/src/Components/cart/index.html @@ -20,110 +20,70 @@ .shopping-cart { background: white; padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - } - .shopping-cart h1 { - font-size: 24px; - margin-bottom: 20px; + border-radius: 5px; + box-shadow: 0 0 10px rgba(0,0,0,0.1); } .cart-item { - display: flex; - justify-content: space-between; - margin-bottom: 20px; - padding-bottom: 10px; - border-bottom: 1px solid #ddd; + border-bottom: 1px solid #eee; + padding: 10px 0; } .cart-item:last-child { border-bottom: none; - margin-bottom: 0; - } - .cart-item img { - width: 50px; - height: 50px; - object-fit: cover; - border-radius: 4px; } - .cart-item-info { - flex: 1; - margin-left: 20px; - } - .cart-item-name { - font-size: 18px; - margin: 0 0 5px 0; + .item-details { + display: flex; + justify-content: space-between; } - .cart-item-quantity, - .cart-item-price { - font-size: 14px; - color: #777; + .item-price { + color: #333; } - .cart-summary { + .total { + font-weight: bold; margin-top: 20px; - text-align: right; - } - .cart-summary p { - font-size: 18px; - margin: 5px 0; - } - .checkout-button { - background-color: #ff21bc; - color: white; - border: none; - padding: 10px 20px; - font-size: 18px; - border-radius: 4px; - cursor: pointer; }
-

Your Cart

+

Your Shopping Cart

-
-

Total Items:

-

Total Price: $

- +
+ Total Items: 0 | + Total Price: $0.00
diff --git a/src/Components/cart/style.js b/src/Components/cart/style.js deleted file mode 100644 index 1bbd816e..00000000 --- a/src/Components/cart/style.js +++ /dev/null @@ -1,201 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import "./cart.css"; - -export const Cart = () => { - const initialItems = [ - { id: 1, name: 'StockIT', price: 10, quantity: 2 }, - { id: 2, name: 'TakeNote', price: 12, quantity: 1 }, - { id: 3, name: 'TaRct', price: 21, quantity: 3 }, - { id: 4, name: 'To Do', price: 13, quantity: 4 }, - { id: 5, name: 'ArchiTect', price: 15, quantity: 6 }, - { id: 6, name: 'WeatherLy', price: 17, quantity: 2 }, - { id: 7, name: 'TypingTest', price: 11, quantity: 5 }, - { id: 8, name: 'Artisan', price: 18, quantity: 8 }, - { id: 9, name: 'BBlocks', price: 25, quantity: 3 }, - { id: 10, name: 'ZzShoes', price: 19, quantity: 5 }, - { id: 11, name: 'SerachImage', price: 13, quantity: 7 }, - { id: 12, name: 'Alimage', price: 20, quantity: 3 }, - ]; - - const [cartItems, setCartItems] = useState(initialItems); - const [cartCount, setCartCount] = useState( - initialItems.reduce((total, item) => total + item.quantity, 0) - ); - - useEffect(() => { - // Save cart items to local storage - localStorage.setItem('cartItems', JSON.stringify(cartItems)); - }, [cartItems]); - - const addToCart = (itemId) => { - setCartItems((prevItems) => - prevItems.map((item) => - item.id === itemId - ? { ...item, quantity: item.quantity + 1 } - : item - ) - ); - setCartCount(cartCount + 1); - }; - - const removeFromCart = (itemId) => { - const item = cartItems.find((item) => item.id === itemId); - if (item && item.quantity > 0) { - setCartItems((prevItems) => - prevItems.map((item) => - item.id === itemId - ? { ...item, quantity: item.quantity - 1 } - : item - ) - ); - setCartCount(cartCount - 1); - } - }; - - const signIn = () => { - alert('Sign in functionality'); - }; - - const signUp = () => { - alert('Sign up functionality'); - }; - - return ( -
- - -
window.location.href = 'index2.html'}> - Cart Icon - {cartCount} -
-
-

- Cart Icon - Your UniCollab Cart -

-
- {cartItems.length === 0 ? ( -

Your Cart is empty

- ) : ( - cartItems.map((item) => ( -
-

{item.name}

-

- {item.quantity} x ${item.price} -

-

Total: ${(item.price * item.quantity).toFixed(2)}

- - -
- )) - )} -
-

- Shop today's deals -

-
- - -
-
-
- ); -}; - -export default Cart; diff --git a/src/Components/footer_section/Pricing/pricing.js b/src/Components/footer_section/Pricing/pricing.js index ba074a2c..9d24436e 100644 --- a/src/Components/footer_section/Pricing/pricing.js +++ b/src/Components/footer_section/Pricing/pricing.js @@ -1,7 +1,6 @@ // pricing.js import React from "react"; import './pricing.css'; -import Arrow from '../../projects/arrow.png' import { Link } from "react-router-dom"; import homeIcon from '../../../img/homeicon.png';