content/hifi-content/faye/photobooth.html
2022-02-13 23:26:00 +01:00

152 lines
5.3 KiB
HTML

<html>
<head>
<title>Photo Booth</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="../../../../../system/html/css/edit-style.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.7.2/css/bootstrap-slider.min.css">
<style>
body {
margin: 0;
padding: 0;
width: 100%;
color: white;
}
.top-bar {
height: 90px;
background: linear-gradient(#2b2b2b, #1e1e1e);
font-family: Raleway-Bold;
padding-left: 30px;
padding-right: 30px;
display: flex;
align-items: center;
position: fixed;
width: 480px;
top: 0;
z-index: 1;
font-size: 16px;
}
.content {
margin-top: 90px;
padding: 30px;
}
.slider {
margin-left: 70px;
}
#camera-toggle {
font-family: Raleway-Bold;
font-size: 13px;
text-transform: uppercase;
vertical-align: top;
height: 28px;
min-width: 120px;
padding: 0px 18px;
margin-right: 0px;
border-radius: 5px;
border: none;
color: #121212;
background-color: #afafaf;
background: linear-gradient(#fff 20%, #afafaf 100%);
cursor: pointer;
}
.dropdown li {
background-color: #ffffff;
}
</style>
</head>
<body>
<div class="top-bar">
<div>Photobooth</div>
</div>
<div class="content">
<div id="properties-list">
<div class="property url refresh">
<label>Model URL</label>
<input type="text" id="model-url"></input>
<input type="button" id="reload-model-button" class="glyph" value="F">
</div>
<div class="property">
<label>Rotate Model</label>
<input
id="rotate-slider"
type="text"
data-provide="slider"
data-slider-ticks="[-180, 0, 180]"
data-slider-ticks-labels='["clockwise", "centre", "anti-clockwise"]'
data-slider-min="-180"
data-slider-max="180"
data-slider-step="1"
data-slider-value="0"
data-slider-tooltip="show"
>
</div>
<div class="property">
<label>Camera</label>
<div class="dropdown">
<button id="camera-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
First Person Camera
<span class="glyphicon glyphicon-menu-down"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li>First Person Camera</li>
<li>Main Camera</li>
<li>Left Camera</li>
<li>Right Camera</li>
</ul>
</div>
</div>
<div class="property">
<input id="picture-button" type="button" class="blue" value="Take Picture">
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/9.7.2/bootstrap-slider.min.js"></script>
<script>
// Helper function to emit web events to photoboothApp.js
function emit(eventType, eventData) {
var eventObject = {
"app": "photobooth",
"type": eventType,
"data": eventData
};
EventBridge.emitWebEvent(JSON.stringify(eventObject));
}
$(document).ready(function() {
// Send a ready event to hifi
emit("ready", null);
// Send an event when camera selection changes
$(".dropdown-menu li").click(function() {
console.log("clicked " + this.textContent);
$("#camera-toggle").text(this.textContent + " ");
$("#camera-toggle").append("<span class='glyphicon glyphicon-menu-down'></span>");
emit("onSelectCamera", {value: this.textContent});
});
// Send an event to hifi to trigger snapshot
$("#picture-button").click(function() {
emit("onClickPictureButton", null);
});
// Send an event to hifi for loading the given model URL
$("#reload-model-button").click(function() {
emit("onClickReloadModelButton", {value: $("#model-url").val()});
});
$("#rotate-slider").slider().on("slide", function(e){
console.log("slided " + e.value);
emit("onRotateSlider", {value: e.value});
});
});
</script>
</body>
</html>