From db8ae773d19293e197cce80118ce46e3b714b65c Mon Sep 17 00:00:00 2001 From: Praneeth Palugula Date: Wed, 5 Jun 2024 22:58:29 +0530 Subject: [PATCH 01/24] solved the bugs --- assets/css/login.css | 4 ---- assets/html/index.html | 1 - assets/html/login.html | 9 +-------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/assets/css/login.css b/assets/css/login.css index d7b8c4f4d..824c55ba4 100644 --- a/assets/css/login.css +++ b/assets/css/login.css @@ -606,10 +606,6 @@ body.dark-mode { .dark-mode.navbar{ background-color: #1e1c1c; } -.dark-mode.main{ - box-shadow: 0 0 20px rgba(230, 230, 230, 0.2); - background-color: hsl(0, 0%, 16%); -} .dark-mode#login label { color:#e6e6e6; } diff --git a/assets/html/index.html b/assets/html/index.html index fe9b51652..ae4dde61b 100644 --- a/assets/html/index.html +++ b/assets/html/index.html @@ -250,7 +250,6 @@ - + + - - - @@ -1451,7 +1429,7 @@

Quick Links

-
+
@@ -1511,6 +1489,42 @@

Quick Links

--> + - - + diff --git a/server.js b/server.js index c35637568..927319980 100644 --- a/server.js +++ b/server.js @@ -1,20 +1,21 @@ const express = require("express"); const bodyParser = require("body-parser"); const mongoose = require("mongoose"); +const nodemailer = require("nodemailer"); const RegisterSchema = require("./assets/validation/zodschema"); const validate = require("./assets/validation/validate.schema"); -const nodemailer = require("nodemailer"); +const cors=require("cors") const app = express(); app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); // For parsing application/x-www-form-urlencoded +app.use(cors()); -const MONGO_URI = "mongodb://localhost:27017/swapread"; +const MONGO_URI = "mongodb+srv://nishantkaushal0708:jhn14300@cluster0.vye07az.mongodb.net/"; const dbConnect = async () => { try { await mongoose.connect(MONGO_URI, { - // useNewUrlParser: true, - // useUnifiedTopology: true, serverSelectionTimeoutMS: 30000, // 30 seconds timeout }); console.log("DB connected"); @@ -90,4 +91,49 @@ dbConnect().then(() => { res.json({ success: false, message: "Internal Server Error" }); }); }); + + // Contact form endpoint + app.post("/contact", async (req, res) => { + const { name, email, subject, message } = req.body; + + const transporter = nodemailer.createTransport({ + service: "gmail", + auth: { + user: "enter_you_mail", + pass: "Enter_YOUR_APP_PASSWORD", + }, + }); + + const mailOptions = { + from: email, + to: "enter_you_mail", + subject: `You Have New Query from ${name} Regarding ${subject}`, + html: `Hey there is query from is ${name} Email: ${email}   Message:

${message}

`, + }; + + const acknowledgmentOptions = { + from: "enter_you_mail", + to: email, + subject: "Acknowledgment of your message", + html: `
+

Dear ${name},

+

Thank you for reaching out to us. We have received your message and will get back to you shortly.

+

Best regards,
SwapReads.com

+
`, + }; + + try { + await transporter.sendMail(mailOptions); + await transporter.sendMail(acknowledgmentOptions); + res.json({ success: true, message: "Message sent successfully" }); + } catch (err) { + console.error("Error sending email:", err); + res.json({ success: false, message: "Error sending message" }); + } + }); + + const PORT = process.env.PORT || 3000; + app.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); + }); }); From 02c7ca7f520c6669c94daf158191520eb64a790a Mon Sep 17 00:00:00 2001 From: Damini2004 Date: Thu, 6 Jun 2024 01:53:16 +0530 Subject: [PATCH 05/24] Commit1 --- index.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index d4c970c8e..d2a79db3b 100644 --- a/index.html +++ b/index.html @@ -194,21 +194,21 @@ bottom: 10px; left: 10px; background-color: #f1f1f1; - padding: 10px; + padding: 30px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; - width: 300px; - height: 250px; + width: 350px; + height: 300px; z-index: 100; border-radius: 10px; margin-bottom: 5px; + box-shadow: 0 0 20px #A30F17; } #cookie-consent button { padding: 5px 10px; - border: none; border-radius: 5px; cursor: pointer; } @@ -216,16 +216,26 @@ #accept-cookies { width: 280px; height: 40px; - background-color: #A30F17; color: white; + background-color: #A30F17; } #reject-cookies { - margin-top: 10px; + padding-top: 5px; height: 40px; width: 280px; - background-color: #A30F17; color: white; + background-color: #A30F17; + + } + #accept-cookies:hover{ + transform: scale(0.9); + box-shadow: 0 0 40px whitesmoke; + } + #reject-cookies:hover{ + transform: scale(0.9); + box-shadow: 0 0 40px whitesmoke; + } From 8e68ba7661c1fca36707e48f654b0b734780fef5 Mon Sep 17 00:00:00 2001 From: dnyandeepchute Date: Thu, 6 Jun 2024 11:36:10 +0530 Subject: [PATCH 06/24] done --- books.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/books.html b/books.html index 7c076f952..c60ad1dc9 100644 --- a/books.html +++ b/books.html @@ -632,10 +632,12 @@

Quick Links

+ + +
- +
- +
- +
- +
- +
- +
- + +
+
+ + +
+
@@ -514,7 +563,7 @@

Quick Links

- + - \ No newline at end of file + From e2626378ff3bac170af4e398df6d3bdbec6930e5 Mon Sep 17 00:00:00 2001 From: SaiTejaswaniBikkasani Date: Fri, 7 Jun 2024 22:15:39 +0530 Subject: [PATCH 24/24] Correct Navbar Links in books.html Resolved an issue where the links in the navbar in books.html were not directing users to the intended sections or pages. --- books.html | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/books.html b/books.html index 29d5e7757..1ea08ffa3 100644 --- a/books.html +++ b/books.html @@ -36,7 +36,7 @@ - + @@ -72,22 +72,22 @@ @@ -109,11 +109,11 @@
-
+ @@ -446,7 +446,7 @@

"Enriching stories to warm your heart"

- +

Acclaimed Authors @@ -458,16 +458,16 @@

- +
- - + +

Nicholas Sparks

- +
@@ -475,15 +475,15 @@

Nicholas Sparks

-
+
- + SwapReads has completely transformed my reading experience! Not only have I discovered new books I never would have picked up otherwise, but I've also connected with fellow book lovers who share my passion. It's like having a personalized library with endless possibilities. Highly recommend!
- +
- +
@@ -515,8 +515,8 @@

Rainbow Rowell

-
-
SwapReads is a bookworm's paradise! With its user-friendly interface, welcoming community, and vast variety of books for swapping, I've embarked on countless new literary adventures. It's like an ever-active book club where I've connected with fellow literature lovers. I'm completely hooked!
+
+
SwapReads is a bookworm's paradise! With its user-friendly interface, welcoming community, and vast variety of books for swapping, I've embarked on countless new literary adventures. It's like an ever-active book club where I've connected with fellow literature lovers. I'm completely hooked!
@@ -533,7 +533,7 @@

Sonal K

-
+
SwapReads revolutionized my reading life! I've decluttered my shelf, discovered hidden gems, and connected with a passionate community. Thank you, SwapReads, for stealing my heart!
@@ -548,7 +548,7 @@

Sonal K

- +

Some Frequently Asked Questions


@@ -603,7 +603,7 @@

How do I ensure the safety and security of my personal information on SwapRe



- @@ -736,12 +736,12 @@
Newsletter
document.body.classList.remove('light-mode'); document.body.classList.add('dark-mode'); } - + function applyLightModeStyles() { document.body.classList.remove('dark-mode'); document.body.classList.add('light-mode'); } - + if (currentTheme) { if (currentTheme === 'dark-mode') { applyDarkModeStyles(); @@ -750,7 +750,7 @@
Newsletter
applyLightModeStyles(); } } - + switchCheckbox.addEventListener('change', () => { if (switchCheckbox.checked) { applyDarkModeStyles(); @@ -768,12 +768,12 @@
Newsletter
- - @@ -927,4 +927,4 @@
Newsletter
- \ No newline at end of file +