forked from NYUCCL/smile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (46 loc) · 1.7 KB
/
index.html
File metadata and controls
51 lines (46 loc) · 1.7 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<title>%VITE_CODE_NAME%</title>
</head>
<body>
<div id="app"></div>
<script>
// this deal with the fact that Prolific inverts the order of query parameters and hash
;(function () {
const location = window.location
let path = location.pathname
let searchParams = new URLSearchParams(location.search)
let hash = location.hash
// Check if there is a hash and query parameters
if (hash && location.search) {
const hashParts = hash.split('?')
const hashBase = hashParts[0]
let hashParams = new URLSearchParams(hashParts[1])
// Merge the parameters
searchParams.forEach((value, key) => {
hashParams.set(key, value)
})
// Create a new URL with merged parameters
const newHash = `${hashBase}?${hashParams.toString()}`
const newUrl = `${path}${newHash}`
// Redirect to the new URL if it's different from the current one
if (newUrl !== location.href) {
window.location.replace(newUrl)
}
}
})()
</script>
<script type="module" src="{{ main_js }}"></script>
</body>
</html>