-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathembedded.html
126 lines (113 loc) · 3.32 KB
/
embedded.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<html>
<head>
<title>Claim Reward Tokens</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.container {
max-width: 800px;
margin: 0 auto;
}
.header {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
}
.content {
padding: 40px;
}
.reward {
display: flex;
align-items: center;
justify-content: center;
}
.reward img {
width: 200px;
height: 200px;
border-radius: 50%;
}
.reward p {
font-size: 24px;
font-weight: bold;
margin-left: 20px;
}
.button {
display: block;
width: 200px;
height: 50px;
margin: 40px auto;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 25px;
cursor: pointer;
}
.button:hover {
background-color: #3E8E41;
}
.footer {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>Gamification Experiment</h1>
<p>Congratulations! You can participate in a blockchain evolution experience experiment.</p>
</div>
<div class="content">
<div class="reward">
<img src="./STL_Stills_UserFirst_White.jpg" alt="Avatar">
<p>Experimental Token Service Layer</p>
</div>
</div>
<iframe id="test-puzzle" onload="window.sendRequest();"
style="width: 100%; height: 600px; max-height: 90vh; border-style: solid; border-width: 2px; border-color: #888"
allowFullScreen="true"
src="https://www.jigsawexplorer.com/online-jigsaw-puzzle-player.html?frm=1&url=aHR0cHM6Ly9uZXZlcnNpdHN0aWxsLmNvbS9hc3NldHMvaW1hZ2VzL3N0bC9TVExfU3RpbGxzX1RTQnJhbmRfVG9wVmlldy5qcGc~&cred=TmV2ZXIgU2l0IFN0aWxs&credu=aHR0cHM6Ly9uZXZlcnNpdHN0aWxsLmNvbS9wcm9qZWN0cy9zbWFydC10b2tlbi1sYWJz&nop=20"
title="Jigsaw Puzzle">Solve to receive attestation</iframe>
<div class="footer">
<p>An STL Production</p>
</div>
</div>
<script>
window.sendRequest = function () {
var puzzleWindow = document.getElementById('test-puzzle').contentWindow;
window.addEventListener('message', function (event) {
var completionInfo = JSON.parse(event.data);
var message = "" + completionInfo.numberOfPieces + " Tokens Awarded";
alert(message);
});
puzzleWindow.postMessage('puzzle-completion-event-request',
'https://www.jigsawexplorer.com/');
};
function displayTokenPopup() {
window.alert("Tokens Awarded");
}
//<p>© 2023 by STL. All rights reserved.</p>
var intervalId;
window.onload = function () {
//run timer
intervalId = setInterval(function () {
var stuff = window.frames[0];
var puzzIFrame = document.getElementById("puzzleIFrame");
const inner = puzzIFrame.contentWindow || puzzIFrame.contentDocument;
//var innerDoc = puzzIFrame.document;
var elementToScan = inner.getElementById("jigex-toast-pnl");
if (elementToScan != null && elementToScan.style.display != "none") {
//its visible
console.log("Allocate Tokens!");
}
}, 10000)
}
</script>
</body>
</html>