-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (37 loc) · 1.09 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>💸</text></svg>">
<title>Ränta på ränta</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="elm.js"></script>
</head>
<body>
<pre id="elm"></pre>
<script type="text/javascript">
const app = Elm.Main.init({
node: document.getElementById("elm")
})
app.ports.shareSettings.subscribe(settingsQueryParams => {
const shareUrl = `${window.location.origin}${window.location.pathname}${settingsQueryParams}`
const tryShare = [
// Mobile devices supporting navigator.share
() => navigator.share({
title: "Ränta på ränta",
url: shareUrl
}),
// Desktop browsers
() => navigator.clipboard.writeText(shareUrl)
]
for (const method of tryShare) {
try {
method()
break
} catch { }
}
})
</script>
</body>
</html>