-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.html
More file actions
86 lines (74 loc) · 3.16 KB
/
Copy pathfeedback.html
File metadata and controls
86 lines (74 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feedback</title>
<link rel="icon" href="pics/JMU_logo_no_bkgd.png">
<link rel="stylesheet" href="styles/sidebar.css">
<link rel="stylesheet" href="styles/feedback_style.css">
<script src="https://cdn.emailjs.com/dist/email.min.js"></script>
</head>
<body>
<nav class="sidebar">
<div class="logo-container">
<a href="https://www.jmu.edu/index.shtml" target="_blank" rel="noopener noreferrer">
<img id="jmu_logo" src="pics/James_Madison_University_Athletics_logo.svg.png" alt="Logo" class="logo">
</a>
</div>
<ul>
<li><a href="index.html"><i class="fas fa-cogs"></i> Home</a></li>
<li><a href="crossword.html"><i class="fas fa-home"></i> Crosswords!</a></li>
<li><a href="wordle.html"><i class="fas fa-info-circle"></i> Wordle!</a></li>
<li><a href="solutions.html">Solutions</a></li>
<li><a href="feedback.html">Feedback</a></li>
<li><a href="report.html"><i class="fas fa-envelope"></i> Report</a></li>
</ul>
</nav>
<!-- Toggle Button -->
<button type="button" class="toggle-btn" id="toggle-btn">☰</button>
<!-- Main Content Section -->
<div class="content">
<h1><strong>Leave us some feedback!</strong></h1>
<form id="feedback-form">
<label for="name">Name</label>
<input id="name" type="text" class="feedback-input" placeholder="Name" required>
<label for="email">Email</label>
<input id="email" type="text" class="feedback-input" placeholder="Email" required>
<label for="text">Comments</label>
<textarea id="text" class="feedback-input" placeholder="Comment" maxlength="500"></textarea>
<button type="submit" id="save">SUBMIT</button>
<button type="button" id="clear-data">CLEAR FORM</button>
</form>
</div>
<!-- JavaScript for receiving input-->
<script
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js">
</script>
<script>
(function() {
// Initialize EmailJS
emailjs.init("IFGlhW3SinI6OtFxJ"); // public key
})();
document.getElementById('feedback-form').addEventListener('submit', (e) => {
e.preventDefault();
const formData = new FormData(e.target);
const feedbackData = {
name: formData.get('name'),
email: formData.get('email'),
comments: formData.get('text')
};
emailjs.send('service_y0wg9qs', 'template_iwkbea3', feedbackData)
.then(() => {
alert('Feedback sent successfully!');
})
.catch((error) => {
console.error('Error:', error);
alert('Failed to send feedback.');
});
});
</script>
<!-- JavaScript to Toggle Sidebar -->
<script src="script/index.js"></script>
</body>
</html>