-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFeedback.php
More file actions
105 lines (101 loc) · 3.42 KB
/
Feedback.php
File metadata and controls
105 lines (101 loc) · 3.42 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html lang="en">
<head>
<title>YourPort</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="icon" href="icon.png">
<link rel="stylesheet" type="text/css" media="screen and (min-width: 501px)"href="web.css">
<link rel="stylesheet" type="text/css" media="screen and (max-width: 500px)" href="mobile.css">
<script src="dark_mode.js"></script>
</head>
<header>
<img src="logo-removebg-preview.png" alt="YourPort (Logo)" id="logo">
<input type="button" value="Dark/Light" id="dark_button">
</header>
<nav>
<div class="flex_container">
<div class="nav_item">
<a href="index.html">Home</a>
</div>
<div class="nav_item">
<a href="extra1.html">Extra 1</a>
</div>
<div class="nav_item">
<a href="extra2.html">Extra 2</a>
</div>
<div class="nav_item">
<a href="Feedback.html">Feedback</a>
</div>
</div>
</nav>
<body>
<h1>Feedback</h1>
<div class="flex_container">
<div class="flex_container">
<div class="flex_item">
<form id="form1">
<h3>Rate 1-5 Stars</h3>
<div style="font-size: 2em;">
<span id="1star">☆</span>
<span id="2star">☆</span>
<span id="3star">☆</span>
<span id="4star">☆</span>
<span id="5star">☆</span>
</div><br>
<label for="email">Email: </label><br>
<input type="email" id="email" name="email"><br><br>
<label for="review" id="review">Please leave a review for how we can improve: </label><br>
<textarea style="resize:none" id="review" name="review" rows="6" cols="40"></textarea><br>
<div class="button_container">
<input type="submit" class="button" id="starSubmit">
<input type="reset" class="button" id="starReset">
</div>
</form>
</div>
</div>
</div>
<script>
var stars = [document.getElementById('1star'),
document.getElementById('2star'),
document.getElementById('3star'),
document.getElementById('4star'),
document.getElementById('5star')];
var starSubmit = document.getElementById('starSubmit');
var starReset = document.getElementById('starReset');
var rating = 0;
function setStarRating(i) {
return function(event) {
for (var j = 0; j <= i; j++) {
stars[j].style.color = 'orange';
stars[j].textContent = '★';
}
for (var j = i+1; j < stars.length; j++) {
stars[j].style.color = 'black';
stars[j].textContent = '☆';
}
rating = i+1;
};
}
for (var i = 0; i < stars.length; i++) {
stars[i].addEventListener('click', setStarRating(i));
}
starSubmit.addEventListener('click', function(event) {
if (document.getElementById('email').checkValidity() && rating > 0) {
alert('You rated this page ' + rating + ' stars!');
}
else {
alert('Please enter a valid email and rating!');
}
});
starReset.addEventListener('click', setStarRating(-1));
</script>
</body>
<footer>
<p>Spring 2024   CSCE464 Project</p>
</footer>
<script>
var dark_button = document.querySelector('#dark_button');
dark_button.addEventListener('click', darkMode);
</script>
</html>