-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (49 loc) · 1.43 KB
/
Copy pathindex.html
File metadata and controls
54 lines (49 loc) · 1.43 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
52
53
54
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quanto tempo ha vissuto?</title>
<script>
const link = document.createElement('link');
link.rel = 'stylesheet';
if (window.location.protocol === 'file:') {
link.href = 'styles.css';
} else {
const repoName = window.location.pathname.split('/')[1];
link.href = '/' + repoName + '/styles.css';
}
document.head.appendChild(link);
</script>
</head>
<body>
<div class="card">
<h2 id="title">Caricamento...</h2>
<table>
<tr>
<th>Anni</th>
<th>Mesi</th>
<th>Giorni</th>
<th>Ore</th>
</tr>
<tr>
<td id="anni">-</td>
<td id="mesi">-</td>
<td id="giorni">-</td>
<td id="ore">-</td>
</tr>
</table>
<span id="info">-</span>
</div>
<script>
const script = document.createElement('script');
if (window.location.protocol === 'file:') {
script.src = 'script.js';
} else {
const repoName = window.location.pathname.split('/')[1];
script.src = '/' + repoName + '/script.js';
}
document.body.appendChild(script);
</script>
</body>
</html>