mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 08:56:26 +02:00
127 lines
4.1 KiB
HTML
127 lines
4.1 KiB
HTML
<!-- Copyright 2016 High Fidelity, Inc. -->
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<input type="hidden" id="version" value="1"/>
|
|
<title>Welcome to Interface</title>
|
|
|
|
<style>
|
|
body {
|
|
background: black;
|
|
width: 100%;
|
|
overflow-x: hidden;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
#kbm_button {
|
|
position: absolute;
|
|
left: 70;
|
|
top: 118;
|
|
width: 297;
|
|
height: 80;
|
|
}
|
|
|
|
#hand_controllers_button {
|
|
position: absolute;
|
|
left: 367;
|
|
top: 118;
|
|
width: 267;
|
|
height: 80;
|
|
}
|
|
|
|
#game_controller_button {
|
|
position: absolute;
|
|
left: 634;
|
|
top: 118;
|
|
width: 297;
|
|
height: 80;
|
|
}
|
|
|
|
#image_area {
|
|
width: 1024;
|
|
height: 720;
|
|
margin: auto;
|
|
position: absolute;
|
|
top: 0; left: 0; bottom: 0; right: 0;
|
|
}
|
|
</style>
|
|
<script>
|
|
var handControllerImageURL = null;
|
|
|
|
function showKbm() {
|
|
document.getElementById("main_image").setAttribute("src", "img/controls-help-keyboard.png");
|
|
}
|
|
|
|
function showHandControllers() {
|
|
document.getElementById("main_image").setAttribute("src", handControllerImageURL);
|
|
}
|
|
|
|
function showGamepad() {
|
|
document.getElementById("main_image").setAttribute("src", "img/controls-help-gamepad.png");
|
|
}
|
|
|
|
// This is not meant to be a complete or hardened query string parser - it only
|
|
// needs to handle the values we send in and have control over.
|
|
//
|
|
// queryString is a string of the form "key1=value1&key2=value2&key3&key4=value4"
|
|
function parseQueryString(queryString) {
|
|
var params = {};
|
|
var paramsParts = queryString.split("&");
|
|
for (var i = 0; i < paramsParts.length; ++i) {
|
|
var paramKeyValue = paramsParts[i].split("=");
|
|
if (paramKeyValue.length == 1) {
|
|
params[paramKeyValue[0]] = undefined;
|
|
} else if (paramKeyValue.length == 2) {
|
|
params[paramKeyValue[0]] = paramKeyValue[1];
|
|
} else {
|
|
console.error("Error parsing param keyvalue: ", paramParts);
|
|
}
|
|
}
|
|
return params;
|
|
}
|
|
|
|
function load() {
|
|
var parts = window.location.href.split("?");
|
|
var params = {};
|
|
if (parts.length > 0) {
|
|
params = parseQueryString(parts[1]);
|
|
}
|
|
|
|
switch (params.handControllerName) {
|
|
case "oculus":
|
|
handControllerImageURL = "img/controls-help-oculus.png";
|
|
break;
|
|
|
|
case "vive":
|
|
default:
|
|
handControllerImageURL = "img/controls-help-vive.png";
|
|
}
|
|
|
|
switch (params.defaultTab) {
|
|
case "gamepad":
|
|
showGamepad();
|
|
break;
|
|
|
|
case "handControllers":
|
|
showHandControllers();
|
|
break;
|
|
|
|
case "kbm":
|
|
default:
|
|
showKbm();
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="load()">
|
|
<div id="image_area">
|
|
<img id="main_image" src="img/controls-help-keyboard.png" width="1024px" height="720px"></img>
|
|
<a href="#" id="kbm_button" onmousedown="showKbm()"></a>
|
|
<a href="#" id="hand_controllers_button" onmousedown="showHandControllers()"></a>
|
|
<a href="#" id="game_controller_button" onmousedown="showGamepad()"></a>
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|