forked from billyvg/OverlayPlugin-themes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rdmty_default.html
43 lines (42 loc) · 1.32 KB
/
rdmty_default.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" />
<title></title>
<link rel="stylesheet" type="text/css" href="css/rdmty.css">
<script src="lib/react.min.js"></script>
<script src="lib/lodash.min.js"></script>
<script src="app/rdmty.js?v=2.0"></script>
<script>
function onOverlayDataUpdate(e) {
var start = new Date().getTime();
var details = e.detail;
React.render(
React.createElement(DamageMeter, {
parseData: e.detail
}),
document.getElementById('container')
);
//console.log('rendered in ' + (+new Date() - start) + 'ms');
}
document.addEventListener('onOverlayDataUpdate', onOverlayDataUpdate);
document.addEventListener("onOverlayStateUpdate", function (e) {
if (!e.detail.isLocked) {
document.documentElement.classList.add("resizable");
} else {
document.documentElement.classList.remove("resizable");
}
});
window.addEventListener('message', function (e) {
if (e.data.type === 'onOverlayDataUpdate') {
onOverlayDataUpdate(e.data);
}
});
</script>
</head>
<body>
<div id="container">
<h3>Awaiting data.</h3>
</div>
</body>
</html>