emscripten: add a preview logo while loading

This commit is contained in:
Rob Loach 2016-09-09 22:36:09 -04:00
parent 834981d74a
commit 4163513ec7
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
4 changed files with 28 additions and 6 deletions

BIN
pkg/emscripten/play.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@ -11,6 +11,18 @@
background-color: black;
}
/**
* Webplayer Preview when not loaded.
*/
.webplayer-preview {
cursor: wait;
opacity: 0.3;
}
.webplayer-preview.loaded {
cursor: pointer;
opacity: 1;
}
/**
* Disable the border around the player.
*/
@ -34,9 +46,9 @@ canvas.webplayer {
to { -webkit-transform: rotate(360deg); }
}
textarea {
font-family: monospace;
font-size: 0.7em;
textarea {
font-family: monospace;
font-size: 0.7em;
height: 95%;
width: 95%;
border-style: none;

View File

@ -97,8 +97,9 @@
</nav>
<div class="bg-inverse webplayer-container">
<div class="container">
<div class="webplayer_border text-xs-center" id="canvas_div" style="display: none">
<canvas class="webplayer col-xs-12" id="canvas" tabindex="1" oncontextmenu="event.preventDefault()"></canvas>
<div class="webplayer_border text-xs-center" id="canvas_div">
<canvas class="webplayer col-xs-12" id="canvas" tabindex="1" oncontextmenu="event.preventDefault()" style="display: none"></canvas>
<img class="webplayer-preview img-fluid" src="play.jpg" width="900px" height="675px" alt="RetroArch Logo">
</div>
</div>
</div>

View File

@ -158,7 +158,8 @@ function stat(path)
function startRetroArch()
{
document.getElementById('canvas_div').style.display = 'block';
$('.webplayer').show();
$('.webplayer-preview').hide();
document.getElementById('btnDrop').disabled = true;
document.getElementById('btnRun').disabled = true;
@ -300,6 +301,14 @@ $(function() {
// Load the Core's related JavaScript.
$.getScript(core + '_libretro.js', function ()
{
/**
* Make the Preview image clickable to start RetroArch.
*/
$('.webplayer-preview').addClass('loaded').click(function () {
startRetroArch();
return false;
});
// Activate the Start RetroArch button.
$('#btnRun').removeClass('disabled');
$('#icnRun').removeClass('fa-spinner spinning');