-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
57 lines (57 loc) · 1.42 KB
/
index.html
File metadata and controls
57 lines (57 loc) · 1.42 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
55
56
57
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AI-Tournaments interface template</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="yes" name="mobile-web-app-capable">
<style>
#lock {
display: none;
}
#lock.engaged {
background: rgba(128, 128, 128, .5);
justify-content: center;
font-size: xxx-large;
align-items: center;
position: absolute;
display: flex;
z-index: 9999;
height: 100%;
width: 100%;
right: 0;
top: 0;
}
</style>
<script>
'use strict'
let responseLock;
function a(){
responseLock = document.getElementById('lock');
let _init;
window.addEventListener('message', messageEvent => {
if(!_init){
_init = messageEvent.data;
}else if(messageEvent.data.type === 'Post'){
responseLock.classList.remove('engaged');
respond('YOUR_RESPONSE');
}
});
window.opener.postMessage({keepOpenAfterTermination: false}, '*');
}
function respond(response){
if(!responseLock.classList.contains('engaged')){
responseLock.classList.add('engaged');
window.opener.postMessage({
value: response,
executionSteps: {toRespond: 0, toTerminate: 0} // Optional by the arena.
}, '*');
}
}
</script>
</head>
<body onload="a()">
<div id="lock" class="engaged"><span>Awaiting update</span></div>
<!-- Content -->
</body>
</html>