-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
102 lines (92 loc) · 3.99 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html xmlns = "http://www.w3.org/1999/xhtml" lang = "">
<head>
<meta charset="utf-8" />
<title>Murder generator</title>
<link rel = "stylesheet" type = "text/css" href = "styles.css" />
<link rel = "icon" type = "image/svg+xml" href = "favicon.svg" sizes = "any" />
<meta name = "viewport" content = "width=device-width, initial-scale=1.0" />
</head>
<body>
<div id = "response"></div>
<svg version = "1.1" baseProfile = "tiny" width = "100" height = "100" xmlns="http://www.w3.org/2000/svg" id = "loadingSVG">
<g transform = "translate(50, 50)">
<g id = "loadingSVGScale">
<g transform = "translate(-50, -50)">
<circle cx = "50" cy = "50" r = "50" fill = "#75507b" />
<path id = "rotatingPath" d = "M 80 50 A 30 30 0 0 0 50 20" fill = "none" stroke = "#ad7fa8" stroke-width = "5px" />
<animateTransform attributeType = "xml" attributeName = "transform" type = "rotate" from = "0 50 50" to = "360 50 50" dur = "2s" additive = "sum" repeatCount = "indefinite" />
</g>
</g>
</g>
</svg>
<noscript>
This webpage needs JavaScript to work properly.
If you want to, you can check the source code of the project <a href = "https://github.com/Mbodin/murder-generator">there</a>.
</noscript>
<script><!--//--><![CDATA[//><!--
/* @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later */
(function (){
var loadingSVGScale = document.getElementById ("loadingSVGScale")
var loadingSVG = document.getElementById ("loadingSVG")
var responseDiv = document.getElementById ("response")
var rotatingPath = document.getElementById ("rotatingPath")
var pathPrefix = "M 80 50 A 30 30 0 "
function startLoading (progress){
if (progress === undefined) progress = 0.2
if (progress < 0.1) progress = 0.1
if (progress > 0.9) progress = 0.9
progress = 0.1 + 0.8 * progress
var dir = "0 1 "
if (progress > 0.5) dir = "1 1 "
var angle = 2 * Math.PI * progress
target = dir + (50 + 30 * Math.cos (angle)) + " " + (50 + 30 * Math.sin (angle))
loadingSVGScale.setAttribute ("class", "loadingStart")
rotatingPath.setAttribute ("d", pathPrefix + target)
loadingSVG.style.zIndex = "1"
}
function stopLoading (){
loadingSVGScale.setAttribute ("class", "loadingStop")
loadingSVG.style.zIndex = "-1"
}
function error (e){
stopLoading ()
var div = document.createElement ("div")
div.setAttribute ("class", "error")
var p = document.createElement ("p")
div.appendChild (p)
responseDiv.appendChild (div)
p.appendChild (document.createTextNode ("An error occurred! "))
var a = document.createElement ("a")
a.setAttribute ("href", "https://github.com/Mbodin/murder-generator/issues")
a.appendChild (document.createTextNode ("Please report it"))
p.appendChild (a)
p = document.createElement ("p")
p.appendChild (document.createTextNode ("Error details: " + e))
div.appendChild (p)
}
startLoading ()
var request = new XMLHttpRequest ()
request.onreadystatechange = function (){
if (this.readyState === 4){
if (request.status !== 200){
error ("Error when fetching the main script. "
+ request.status + ": " + request.statusText)
} else {
try {
eval (request.responseText)
} catch (e){
error (e)
}
}
}
}
request.open ("GET", "main.js", true)
request.overrideMimeType ("application/javascript")
request.send ()
}) ()
/* @license-end */
// --><!]]>
</script>
</body>
</html>