diff --git a/README.md b/README.md index 22e1c320..746f5499 100644 --- a/README.md +++ b/README.md @@ -222,3 +222,4 @@ If you have any questions or feedback, feel free to reach out via **GitHub**. Yo We look forward to hearing from you! ✨ 💙 Thank You !!! 💙 +# TODO: diff --git a/client/public/index.html b/client/public/index.html index 492424c4..e263dfef 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -102,6 +102,8 @@ document.addEventListener("DOMContentLoaded", function () { const coords = { x: 0, y: 0 }; const circles = document.querySelectorAll(".circle"); + const container = document.querySelector(".circle-container"); + let hidden = false; circles.forEach(function (circle) { circle.x = 0; @@ -110,7 +112,21 @@ window.addEventListener("mousemove", function (e) { coords.x = e.pageX; - coords.y = e.pageY - window.scrollY; // Adjust for vertical scroll position + coords.y = e.pageY - window.scrollY; + }); + + document.addEventListener("mouseleave", function () { + hidden = true; + circles.forEach(function (circle) { + circle.style.opacity = "0"; + }); + }); + + document.addEventListener("mouseenter", function () { + hidden = false; + circles.forEach(function (circle) { + circle.style.opacity = "1"; + }); }); function animateCircles() { @@ -137,4 +153,11 @@ }); + diff --git a/client/public/manifest.json b/client/public/manifest.json index 080d6c77..89332952 100644 --- a/client/public/manifest.json +++ b/client/public/manifest.json @@ -1,6 +1,7 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "BookSales", + "name": "Online Book Sales - Your Digital Bookstore", + "description": "Browse, discover, and purchase books online. Your one-stop digital bookstore.", "icons": [ { "src": "favicon.ico", @@ -15,11 +16,15 @@ { "src": "logo512.png", "type": "image/png", - "sizes": "512x512" + "sizes": "512x512", + "purpose": "any maskable" } ], "start_url": ".", "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" + "orientation": "portrait-primary", + "theme_color": "#002147", + "background_color": "#ffffff", + "categories": ["books", "education", "shopping"], + "lang": "en-US" } diff --git a/client/public/service-worker.js b/client/public/service-worker.js new file mode 100644 index 00000000..fe93208f --- /dev/null +++ b/client/public/service-worker.js @@ -0,0 +1,65 @@ +const CACHE_NAME = "online-book-sales-v1"; + +const PRECACHE_URLS = [ + "/", + "/index.html", + "/manifest.json", + "/logo192.png", + "/logo512.png", + "/favicon.ico", + "/styles.css", +]; + +self.addEventListener("install", (event) => { + event.waitUntil( + caches.open(CACHE_NAME).then((cache) => { + return cache.addAll(PRECACHE_URLS); + }) + ); + self.skipWaiting(); +}); + +self.addEventListener("activate", (event) => { + event.waitUntil( + caches.keys().then((cacheNames) => { + return Promise.all( + cacheNames + .filter((name) => name !== CACHE_NAME) + .map((name) => caches.delete(name)) + ); + }) + ); + self.clients.claim(); +}); + +self.addEventListener("fetch", (event) => { + if (event.request.method !== "GET") return; + + event.respondWith( + caches.match(event.request).then((cachedResponse) => { + if (cachedResponse) { + return cachedResponse; + } + + return fetch(event.request) + .then((response) => { + if (!response || response.status !== 200 || response.type !== "basic") { + return response; + } + + const responseToCache = response.clone(); + caches.open(CACHE_NAME).then((cache) => { + cache.put(event.request, responseToCache); + }); + + return response; + }) + .catch(() => { + if (event.request.mode === "navigate") { + return caches.match("/index.html"); + } + return new Response("Offline", { status: 503 }); + }); + }) + ); +}); diff --git a/client/src/Pages/Faq.jsx b/client/src/Pages/Faq.jsx index eb0619c5..af0d1b49 100644 --- a/client/src/Pages/Faq.jsx +++ b/client/src/Pages/Faq.jsx @@ -105,7 +105,7 @@ const FAQ = () => { {openIndex === index && ( -

{faq.answer}

+

{faq.answer}

)} ))} diff --git a/client/src/Pages/Home.jsx b/client/src/Pages/Home.jsx index 12921475..7a5405d9 100644 --- a/client/src/Pages/Home.jsx +++ b/client/src/Pages/Home.jsx @@ -148,49 +148,49 @@ const Home = () => {
-
+

Romance

Explore our collection of romantic novels.

-
+

Action

Dive into thrilling action-packed stories.

-
+

Thriller

Get your adrenaline pumping with our thrillers.

-
+

Fiction

Discover imaginative and captivating fiction.

-
+

Tech

Stay updated with the latest in technology.

-
+

Philosophy

Dive deep into philosophical thoughts and ideas.

-
+

Manga

Explore our extensive collection of Manga.

diff --git a/client/src/Pages/LoginPage.jsx b/client/src/Pages/LoginPage.jsx index 6d51530a..04521ca4 100644 --- a/client/src/Pages/LoginPage.jsx +++ b/client/src/Pages/LoginPage.jsx @@ -178,7 +178,7 @@ const LoginPage = () => { mt: 2, "&:hover": { backgroundColor: "#0069d9" }, }} - className="w-full text-white my-2 mt-5 font-semibold bg-[#060606] rounded-md p-4 text-center flex items-center justify-center dark:bg-white dark:text-black" + className="w-full text-white my-2 mt-5 font-semibold bg-[#060606] rounded-md p-4 text-center flex items-center justify-center dark:bg-white dark:text-black transition-all duration-300 hover:scale-[1.02] hover:shadow-lg active:scale-95" > Login diff --git a/client/src/components/Card/ProductCard.css b/client/src/components/Card/ProductCard.css index 690585fd..ac69cefa 100644 --- a/client/src/components/Card/ProductCard.css +++ b/client/src/components/Card/ProductCard.css @@ -1,3 +1,115 @@ +.card-basic { + background: #fff; + border-radius: 12px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); + overflow: hidden; + transition: transform 0.3s ease, box-shadow 0.3s ease; + position: relative; + width: 100%; + max-width: 280px; +} + +.card-basic:hover { + transform: translateY(-6px); + box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15); +} + +.card-basic img { + width: 100%; + height: 220px; + object-fit: cover; + display: block; +} + +.card-item-details { + padding: 14px 16px 16px; +} + +.item-title h4 { + margin: 0 0 4px; + font-size: 1rem; + font-weight: 600; + color: #222; + line-height: 1.3; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.item-author { + margin: 0 0 8px; + font-size: 0.85rem; + color: #777; + font-weight: 400; +} + +.card-basic p { + margin: 0 0 10px; + font-size: 0.95rem; + color: #333; +} + +.card-basic del { + color: #999; +} + +.discount-on-card { + color: #e53935; + font-weight: 600; + font-size: 0.85rem; +} + +.card-button { + margin-top: 6px; +} + +.card-icon-btn { + background: none; + border: 1px solid #ddd; + border-radius: 50%; + width: 36px; + height: 36px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: background 0.2s; +} + +.card-icon-btn:hover { + background: #fce4ec; + border-color: #e91e63; +} + +.badge-on-card { + position: absolute; + top: 10px; + left: 10px; + background: #e53935; + color: #fff; + font-size: 0.75rem; + font-weight: 600; + padding: 3px 10px; + border-radius: 4px; +} + +.card-text-overlay-container { + position: absolute; + inset: 0; + background: rgba(0, 0, 0, 0.55); + display: flex; + align-items: center; + justify-content: center; + border-radius: 12px; +} + +.card-text-overlay-container p { + color: #fff; + font-size: 1.1rem; + font-weight: 700; +} + .fa-heart { overflow: hidden; @@ -17,4 +129,4 @@ .added-to-wishlist-btn:hover { background-color: var(--grey); -} \ No newline at end of file +} diff --git a/client/src/components/NavBar/NavBar.jsx b/client/src/components/NavBar/NavBar.jsx index b1fcc4d4..0d1d5dba 100644 --- a/client/src/components/NavBar/NavBar.jsx +++ b/client/src/components/NavBar/NavBar.jsx @@ -35,7 +35,6 @@ const StyledAppBar = styled(AppBar)(({ darkMode }) => ({ const Logo = styled("img")({ width: "220px", height: "auto", - marginRight: "auto", }); const StyledButton = styled(Button)(({ isActive }) => ({ @@ -54,7 +53,8 @@ const MenuContainer = styled("div")({ display: "flex", alignItems: "center", gap: "10px", - marginLeft: "auto", + flex: 1, + justifyContent: "center", }); const MobileMenu = styled("div")(({ open }) => ({ @@ -148,8 +148,6 @@ function Navbar({ darkMode, toggleDarkMode }) { onClick={handleMenuClick} style={{ marginBottom: "20px", color: "#fff" }} > - - Close } fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > Home @@ -175,7 +173,7 @@ function Navbar({ darkMode, toggleDarkMode }) { isActive={isActive("/shop")} startIcon={} fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > Shop @@ -186,7 +184,7 @@ function Navbar({ darkMode, toggleDarkMode }) { isActive={isActive("/wishlist")} startIcon={} fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > Wishlist @@ -197,7 +195,7 @@ function Navbar({ darkMode, toggleDarkMode }) { isActive={isActive("/cart")} startIcon={} fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > Cart @@ -210,7 +208,7 @@ function Navbar({ darkMode, toggleDarkMode }) { isActive={isActive("/orders")} startIcon={} fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > Orders @@ -224,7 +222,7 @@ function Navbar({ darkMode, toggleDarkMode }) { onClick={userLoggedIn ? handleLogout : null} startIcon={} fullWidth - style={{ marginBottom: "15px" }} // Add margin for spacing + style={{ marginBottom: "15px" }} > {userLoggedIn ? "Logout" : "Login"} @@ -232,7 +230,6 @@ function Navbar({ darkMode, toggleDarkMode }) { ) : ( - } > - Home - - - - } - > - }> Home {userLoggedIn && ( @@ -259,7 +244,13 @@ function Navbar({ darkMode, toggleDarkMode }) { Profile )} - }> + } + > Shop {userLoggedIn ? "Logout" : "Login"} + + { width: "100%", padding: "10px", borderRadius: "5px", - border: "1px solid #ccc", + border: "2px solid #8B5CF6", + outline: "none", + transition: "border-color 0.3s, box-shadow 0.3s", }} + onFocus={(e) => { e.target.style.borderColor = "#6D28D9"; e.target.style.boxShadow = "0 0 0 3px rgba(139,92,246,0.2)"; }} + onBlur={(e) => { e.target.style.borderColor = "#8B5CF6"; e.target.style.boxShadow = "none"; }} /> {showSuggestions && filteredData.length > 0 && (