-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.html
executable file
·49 lines (42 loc) · 1.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Code Sketch</title>
<meta name="description" content="First place where the code was written..." />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-79264835-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-79264835-6');
</script>
</head>
<body>
<script>
function getParamFromURL(url) {
url = url || location.href
let result = {}
let search = url.substr(url.indexOf('?') + 1)
if (search) {
var params = search.split('&')
for (var i = 0; i < params.length; i++) {
var p = params[i]
if (p.indexOf('=') > -1) {
var keyValue = p.split('=')
result[keyValue[0]] = keyValue[1]
}
}
} else {
throw new Error('url should contains one param.')
}
return result
}
window._query = getParamFromURL(window.location.href)
document.body.classList.add(_query.theme || 'light')
</script>
<div id="app"></div>
<script src="./src/index.js"></script>
</body>
</html>