updated examples
This commit is contained in:
parent
b94deba57e
commit
618d20fd3c
|
@ -70,6 +70,17 @@
|
|||
<label id="anaglyph" for="anaglyph-input">
|
||||
<input id="anaglyph-input" type="checkbox"/> Anaglyph view<br/>
|
||||
</label>
|
||||
<label id="panorama" for="panorama-select">
|
||||
Panorama 360
|
||||
<input type="file" id="file360Elem" accept="application/json" style="display:none"/>
|
||||
<button id="panorama-button">Local</button>
|
||||
<select id="panorama-select">
|
||||
<option value="">--</option>
|
||||
<option value="cabin">Cabin</option>
|
||||
<option value="factory">Factory</option>
|
||||
<option value="earth">Earth</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div id="links">
|
||||
|
|
|
@ -296,6 +296,27 @@ $(document).ready(function () {
|
|||
fileElem[0].click();
|
||||
});
|
||||
|
||||
// reading file locally
|
||||
var file360Elem = $("#file360Elem").on("change",function() {
|
||||
var fileReader = new FileReader();
|
||||
fileReader.readAsDataURL(file360Elem[0].files[0]);
|
||||
fileReader.onload = function(event) {
|
||||
match.viewControl("setPanorama",{
|
||||
pictureData: fileReader.result
|
||||
})
|
||||
}
|
||||
})
|
||||
$("#panorama-button").on("click",function() {
|
||||
file360Elem[0].click();
|
||||
});
|
||||
$("#panorama-select").on("change",function() {
|
||||
var options = {};
|
||||
var which = $(this).val();
|
||||
if(which)
|
||||
options.pictureUrl = "/panorama/"+which+".jpg";
|
||||
match.viewControl("setPanorama",options);
|
||||
});
|
||||
|
||||
$("#takeback").on("click",function() {
|
||||
match.getPlayedMoves()
|
||||
.then( (playedMoves) => {
|
||||
|
|
Loading…
Reference in a new issue