/
index.html
71 lines (65 loc) · 1.72 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
<html>
<head>
<title>Adeheid Installer</title>
<link rel="icon" type="image/x-icon" href="/media/img/favicon.ico?v=1">
</head>
<body>
<style>
html {
background: rgb(245, 245, 245);
}
body {
color: rgb(20, 20, 20);
font-family: Georgia;
padding: 20px;
text-align: center;
}
h1 {
color: rgba(70, 70, 70, .9);
font-style: italic;
margin-bottom: 40px;
}
img {
border-radius: 200px;
display: block;
height: 300px;
margin: 0 auto 50px;
text-align: center;
width: 300px;
}
button {
background: rgba(150, 15, 150, .8);
border: 0;
border-radius: 5px;
color: white;
cursor: pointer;
margin-bottom: 20px;
padding: 10px;
}
div {
color: rgba(100, 100, 100, .8);
font-style: italic;
margin-top: 10px;
}
</style>
<h1>Adelheid Installer</h1>
<button>Install</button>
<div class="progress"></div>
<script>
document.querySelector('button').onclick = install;
function install() {
document.querySelector('button').innerHTML = 'Installing...';
document.querySelector('button').onclick = null;
var req = navigator.mozApps.installPackage(
'http://adelheid.ngokevin.com/manifest.webapp');
req.onerror = function() {
alert(this.error.name);
};
setInterval(function() {
console.log(req);
document.querySelector('.progress').innerHTML = 'Installation at ' + (req.result.progress / 10000 / 100) + '%';
}, 5000);
}
</script>
</body>
</html>