-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (57 loc) · 1.89 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>glyphical</title>
<link rel="icon" type="image/png" href="#">
<link rel="stylesheet" href="css/glyphical.css">
<link rel="shortcut icon" href="images/favicon.svg" type="image/x-icon">
</head>
<body>
<nav-bar id="glyphical-nav"></nav-bar>
<header id="glyphical-header">
<h1><span class=hieroglyph>𓏞</span> glyphical</h1>
<form id="main-search">
<input type="search" autocapitalize=off placeholder="𓃦 Search" spellcheck="false">
</form>
</header>
<main id="glyphical-main">
<template id="hieroglyph-view-template">
<div class="description"></div>
<div lang=egy class="hieroglyph"></div>
<!-- <div> -->
<span class="type"></span>
<span class="phonetic"></span>
<!-- </div> -->
<div class="gardiner"></div>
<div class="category"></div>
<div class="frequency"></div>
<div class="transliterations"></div>
<div class="unicode"></div>
</template>
<search-hieroglyphs id="sh"></search-hieroglyphs>
</main>
<footer>
</footer>
<script type="module">
import "./components/glyphical.js";
import {parseQueryString} from 'https://www.pathall.net/parse-query-string/v1.0.0/parse-query-string.js'
let handleHashChange = () => {
let query = window.location.hash.slice(1)
let decodedQuery = decodeURIComponent(query); // Decode the URI component
document.querySelector('[type=search]').value = decodedQuery
document.querySelector('search-hieroglyphs').search(decodedQuery)
}
addEventListener('hashchange', handleHashChange)
handleHashChange()
addEventListener('submit', e => {
e.preventDefault()
if(e.target.matches('#main-search')) {
let query = e.target.querySelector('input[type=search]').value
document.querySelector('search-hieroglyphs').search(query)
}
})
</script>
</body>
</html>