-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (51 loc) · 2.37 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<title>Frontend Mentor | Interactive rating component</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<style>
.attribution { font-size: 11px; text-align: center; color: white; }
.attribution a { color: hsl(228, 45%, 44%); }
</style>
</head>
<body>
<div class="container">
<div class="wrapper">
<div class="star">
<img src="images/icon-star.svg" alt="Star icon">
</div>
<h1 class="title">How did we do?</h1>
<p class="desc">Please let us know how we did with your support request. All feedback is appreciated to help us improve our offering!</p>
<div class="ratings">
<h3 class="numberOne numbers" onclick="selectRating(1)">1</h3>
<h3 class="numberTwo numbers" onclick="selectRating(2)">2</h3>
<h3 class="numberThree numbers" onclick="selectRating(3)">3</h3>
<h3 class="numberFour numbers" onclick="selectRating(4)">4</h3>
<h3 class="numberFive numbers" onclick="selectRating(5)">5</h3>
</div>
<a href="success.html" class="submit-btn" onclick="submitRating()">SUBMIT</a>
</div>
</div>
<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="https://github.com/rovicbalingbing">John Rovie Balingbing</a>.
</div>
<script>
function selectRating(rating) {
const selectedRating = rating;
localStorage.setItem('selectedRating', selectedRating);
}
function submitRating() {
const selectedRating = localStorage.getItem('selectedRating');
const successLink = document.querySelector('.submit-btn');
successLink.href = 'success.html';
successLink.search = '?rating=' + selectedRating;
}
</script>
</body>
</html>