Skip to content

Commit 887fb03

Browse files
authored
Merge branch 'main' into contribution-file
2 parents 91473f6 + 27385f0 commit 887fb03

9 files changed

Lines changed: 1755 additions & 31 deletions

File tree

Official_Website/.example.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MONGO_URI=""

Official_Website/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.env
3+
package-lock.json

Official_Website/banner copy.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
3+
.join-team {
4+
display: flex;
5+
align-items: center;
6+
background-color: white;
7+
padding: 20px 30px;
8+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
9+
border-radius: 8px;
10+
}
11+
12+
.trophy {
13+
font-size: 24px;
14+
margin-right: 15px;
15+
}
16+
17+
.text-content {
18+
flex-grow: 1;
19+
}
20+
21+
.text-content h2 {
22+
margin: 0 0 5px 0;
23+
font-size: 18px;
24+
color: #333;
25+
}
26+
27+
.text-content p {
28+
margin: 0;
29+
color: #666;
30+
}
31+
32+
.join-button {
33+
background-color: #7a5eff;
34+
color: white;
35+
border: none;
36+
padding: 10px 20px;
37+
border-radius: 5px;
38+
cursor: pointer;
39+
transition: background-color 0.3s ease;
40+
}
41+
42+
.join-button:hover {
43+
background-color: #6749e8;
44+
}

Official_Website/contributor-style.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ width: 40px;
222222
}
223223

224224
.intro {
225-
margin:24px;
225+
margin:24px 55px;
226226
}
227227

228228
/* .intro h1 {
@@ -241,7 +241,7 @@ width: 40px;
241241
display: grid;
242242
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
243243
gap: 5rem;
244-
height: 300px;
244+
/* height: 300px; */
245245
}
246246

247247
.team-member {
@@ -327,8 +327,10 @@ width: 40px;
327327
#team-grid1 {
328328
display: grid;
329329
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
330-
gap: 15px;
330+
gap: 10px;
331331
margin: 25px;
332+
margin-left: 45px;
333+
padding: 30px;
332334
}
333335

334336
.badge {

Official_Website/index.html

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,32 +113,51 @@ <h2>Feedback</h2>
113113
<script>
114114
// Feedback JS
115115
document.getElementById("feedback-form").addEventListener("submit", function(event) {
116-
event.preventDefault();
117-
118-
var name = document.getElementById("name").value;
119-
var email = document.getElementById("email").value;
120-
var comments = document.getElementById("comments").value;
121-
var rating = document.querySelector('input[name="rating"]:checked');
122-
123-
if (!rating) {
124-
var errorMessage = document.getElementById("error-message");
125-
errorMessage.innerText = "Please select a Rating!";
126-
errorMessage.style.display = "block";
127-
setTimeout(function() {
128-
errorMessage.style.display = "none";
129-
}, 3000);
130-
return;
131-
}
132-
133-
var messageElement = document.getElementById("message");
134-
messageElement.innerText = "Thank you for your feedback!";
135-
messageElement.style.display = "block";
136-
137-
setTimeout(function() {
138-
messageElement.style.display = "none";
139-
document.getElementById("feedback-form").reset();
140-
}, 3000);
141-
});
116+
event.preventDefault();
117+
118+
if (!document.querySelector('input[name="rating"]:checked')) {
119+
var errorMessage = document.getElementById("error-message");
120+
errorMessage.innerText = "Please select a rating!";
121+
errorMessage.style.display = "block";
122+
setTimeout(function() {
123+
errorMessage.style.display = "none";
124+
}, 3000);
125+
return;
126+
}
127+
const formData = {
128+
name: document.getElementById("name").value,
129+
email: document.getElementById("email").value,
130+
comments: document.getElementById("comments").value,
131+
rating: document.querySelector('input[name="rating"]:checked').value
132+
};
133+
console.log(formData);
134+
fetch('https://helpops-hub.vercel.app/feedback', {
135+
method: 'POST',
136+
headers: {
137+
'Content-Type': 'application/json'
138+
},
139+
body: JSON.stringify(formData)
140+
})
141+
.then(response => response.json())
142+
.then(data => {
143+
console.log('Success:', data);
144+
document.getElementById("message").innerText = "Thank you for your feedback!";
145+
document.getElementById("message").style.display = "block";
146+
setTimeout(function() {
147+
document.getElementById("message").style.display = "none";
148+
document.getElementById("feedback-form").reset();
149+
}, 3000);
150+
})
151+
.catch((error) => {
152+
console.error('Error:', error);
153+
var errorMessage = document.getElementById("error-message");
154+
errorMessage.innerText = "There was an error submitting your feedback.";
155+
errorMessage.style.display = "block";
156+
setTimeout(function() {
157+
errorMessage.style.display = "none";
158+
}, 3000);
159+
});
160+
});
142161
</script>
143162
</body>
144163
</html>

Official_Website/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import dotenv from 'dotenv';
2+
import express from 'express';
3+
import bodyParser from 'body-parser';
4+
import cors from 'cors';
5+
import mongoose from 'mongoose';
6+
const app = express();
7+
const port = 3000;
8+
import Feedback from './models/feedback.js';
9+
10+
app.use(bodyParser.json());
11+
app.use(cors());
12+
dotenv.config();
13+
14+
const main = async()=>{
15+
await mongoose.connect(process.env.MONGO_URI)
16+
.then(() => console.log("MongoDB connected"))
17+
.catch((err) => console.log(err));
18+
}
19+
main()
20+
.catch((err) => console.log(err));
21+
22+
app.post('/feedback', async(req, res) => {
23+
const data = req.body;
24+
// console.log(`Name: ${name}, Email: ${email}, Comments: ${comments}, Rating: ${rating}`);
25+
res.json({ status: 'success', message: 'Feedback submitted successfully' });
26+
27+
const feedback = new Feedback(data);
28+
await feedback.save()
29+
.then(() => console.log("Feedback submitted successfully"))
30+
.catch((err) => console.log(err));
31+
32+
});
33+
34+
app.listen(port, () => {
35+
console.log(`Server running at http://127.0.0.1:${port}`);
36+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import mongoose from "mongoose";
2+
3+
const Schema=mongoose.Schema;
4+
const feedbackSchema = new Schema({
5+
name: String,
6+
email: String,
7+
comments: String,
8+
rating: Number
9+
});
10+
const Feedback = mongoose.model('Feedback', feedbackSchema);
11+
12+
export default Feedback;

0 commit comments

Comments
 (0)