-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
64 lines (61 loc) · 2.45 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
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="src/res/P&P Manager Logo 512x512px noBG.png">
<link rel="stylesheet" href="src/node_modules/animate.css/animate.css">
<link rel="stylesheet" href="src/node_modules/bootstrap/dist/css/bootstrap.css" integrity="" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css"
integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Fondamento&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Alegreya:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="src/res/Stylesheet.css">
<title>P&P Manager</title>
<script src="out/main.js"></script>
<style>
</style>
</head>
<body>
<div id="myapp"></div>
<script>
var observer = new MutationObserver(function (mutations) {
function filterSubtree4Svg(node_arr){
return node_arr.filter(function (node) {
return node.tagName === 'svg';
})
.concat(
node_arr.filter(function (node) {
return (node.childNodes && node.childNodes.length);
})
.reduce(
(accumulator, currentValue) => accumulator.concat(
filterSubtree4Svg(Array.from(currentValue.childNodes))
)
, [])
);
}
mutations.forEach(function (mutation) {
//console.log(mutation);
if (mutation.type === 'childList') {
filterSubtree4Svg(Array.from(mutation.addedNodes))
.forEach(function (svg) {
let point, position
svg.addEventListener('mousemove', (e) => {
point = svg.createSVGPoint()
point.x = e.clientX
point.y = e.clientY
position = point.matrixTransform(svg.getScreenCTM().inverse())
let event = new CustomEvent("mousemoveWithCoordinates", { detail: position })
svg.dispatchEvent(event)
})
});
}
});
});
observer.observe(document.body, { childList: true, subtree: true });
var app = Elm.Main.init({
node: document.getElementById('myapp')
});
</script>
</body>
</html>