118 lines
No EOL
3.4 KiB
HTML
118 lines
No EOL
3.4 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<title>Instant Teleportal</title>
|
|
<style>
|
|
body,
|
|
div,
|
|
header {
|
|
margin: 0;
|
|
padding: 0;
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
text-align: center;
|
|
}
|
|
|
|
|
|
header {
|
|
background: linear-gradient(#262626, #242424);
|
|
padding: 10px;
|
|
}
|
|
|
|
body {
|
|
background-color: #303030;
|
|
color: #FFFFFF;
|
|
font-size: 14pt;
|
|
}
|
|
|
|
div {
|
|
min-height: 1px;
|
|
margin: 5rem;
|
|
}
|
|
|
|
div button {
|
|
background: url(http://hifi-content.s3.amazonaws.com/caitlyn/production/portalDropper/svg/portalButton-faceLeft-inactive.svg) no-repeat top left;
|
|
background-size: 200px 200px;
|
|
width: 200px;
|
|
height: 200px;
|
|
border: #909090 2px solid;
|
|
border-radius: 15px;
|
|
background-color: #262626;
|
|
font-size: 14pt;
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
div button:focus {
|
|
background: url(http://hifi-content.s3.amazonaws.com/caitlyn/production/portalDropper/svg/portalButton-faceLeft-active.svg) no-repeat
|
|
background-size: 200px 200px;
|
|
|
|
}
|
|
|
|
div button:hover {
|
|
background-color: #353535;
|
|
}
|
|
|
|
div button:active {
|
|
background-color: #00ff00;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<header>
|
|
<span><b>Instant Teleportal</b><br></span>
|
|
<img src="http://hifi-content.s3.amazonaws.com/caitlyn/production/portalDropper/icon-noun_Time%20Portal_14776-fullInverted-368_short.jpg" alt="Instant Teleportal Icon"><br>
|
|
1. Go to your landing spot & press <b>Store Location</b> / <b>Shift-T.</b><br>
|
|
2. Go to spot where you want portal & press <b>Create Portal</b> / <b>t.</b><br>
|
|
3. Invite your friends to step in and teleport to your landing spot!<br><br>
|
|
<i>Other users Instant Teleportal installed to participate.</i><br>
|
|
</header>
|
|
|
|
<div>
|
|
|
|
<button class="callback" data-method="store-location">Store Location</button>
|
|
 
|
|
<button class="callback" data-method="create-portal">Create Portal</button>
|
|
</div>
|
|
|
|
<div>
|
|
<span id="state"></span>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
(function () {
|
|
|
|
function emitWebEvent(obj) {
|
|
var str = JSON.stringify(obj);
|
|
EventBridge.emitWebEvent(str);
|
|
}
|
|
|
|
var state = document.getElementById("state");
|
|
var elements = document.getElementsByClassName("callback");
|
|
|
|
function clickEvent(event) {
|
|
emitWebEvent({ type: event.target.getAttribute("data-method") });
|
|
}
|
|
for (var element in elements) {
|
|
var elm = elements[element];
|
|
if (elm && typeof elm === "object") {
|
|
console.log(typeof elm);
|
|
elm.addEventListener("click", clickEvent);
|
|
}
|
|
}
|
|
console.log(EventBridge);
|
|
setTimeout(function () {
|
|
EventBridge.scriptEventReceived.connect(function (data) {
|
|
var json = JSON.parse(data);
|
|
if (json.status) {
|
|
state.innerHTML = json.status;
|
|
}
|
|
});
|
|
}, 200);
|
|
})();
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |