-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhigher.html
72 lines (69 loc) · 2.21 KB
/
higher.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dust - Higher</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
/>
</head>
<body>
<script src="https://kit.fontawesome.com/b968a264b2.js" crossorigin="anonymous"></script>
<main class="container">
<nav>
<ul>
<li><strong>Dust - QP Search Tool</strong></li>
</ul>
<ul>
<li><a href="./national-5.html">National 5</a></li>
<li><strong>Higher</strong></li>
<li><a href="./adv-higher.html">Adv Higher</a></li>
</ul>
</nav>
<input
type="search"
name="search"
placeholder="Search"
aria-label="Search"
onkeyup="searchHighlighter()"
id="input-search"
/>
</main>
<main class="container" id="papers">
<ul>
<li><a href="#biology">Biology</a>
<ul>
<li><a href="#bio-2023">2023</a>: https://biolou.com</li>
</ul>
</li>
<li><a href="#english">English</a>
<ul>
<li><a href="#eng-2023">2023</a>: https://biolou.com</li>
</ul>
</li>
</ul>
</main>
<footer class="container">
<p>All papers belong to the SQA. This tool was developed to improve seraching for SQA digital papers.</p>
</footer>
<script>
function searchHighlighter() {
const inputValue = document.getElementById("input-search").value;
const listItems = document.querySelector("#papers").querySelectorAll("li");
if (!inputValue) {
listItems.forEach((li) => (li.querySelector("a").style.color = "#1167b1"));
return;
}
listItems.forEach((li) => {
const child = li.querySelector("a");
const txtValue = child.innerText;
child.style.color =txtValue.toUpperCase().indexOf(inputValue.toUpperCase()) > -1
? "green"
: "#1167b1";
});
}
</script>
</body>
</html>