-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9b9a39
commit 838b8cb
Showing
2 changed files
with
51 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,56 @@ | ||
<!DOCTYPE html> | ||
<html data-ruffle-optout> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Ruffle Web Demo</title> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" /> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-32.png" sizes="32x32"> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-64.png" sizes="64x64"> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-180.png" sizes="180x180"> | ||
<style> | ||
</style> | ||
</head> | ||
<body> | ||
<div id="main" aria-label="Select a demo or drag an SWF"> | ||
<div id="overlay" class="hidden"></div> | ||
<div id="ruffle-player"></div> | ||
</div> | ||
<script> | ||
// Function to extract URL parameters | ||
function getURLParameter(name) { | ||
return new URLSearchParams(window.location.search).get(name); | ||
} | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Ruffle Web Demo</title> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato" /> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-32.png" sizes="32x32"> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-64.png" sizes="64x64"> | ||
<link rel="icon" href="https://ruffle.rs/assets/favicon-180.png" sizes="180x180"> | ||
<style> | ||
</style> | ||
</head> | ||
<body> | ||
<div id="main" aria-label="Select a demo or drag an SWF"> | ||
<div id="overlay" class="hidden"></div> | ||
<div id="ruffle-player"></div> | ||
</div> | ||
<script> | ||
// Function to extract URL parameters | ||
function getURLParameter(name) { | ||
return new URLSearchParams(window.location.search).get(name); | ||
} | ||
|
||
// Check if 'swf' parameter is present in the URL | ||
const swfURL = getURLParameter('swf'); | ||
if (swfURL) { | ||
const rufflePlayer = document.getElementById('ruffle-player'); | ||
rufflePlayer.innerHTML = ` | ||
<object type="application/x-shockwave-flash" data="${swfURL}" allowfullscreen> | ||
<param name="movie" value="${swfURL}"> | ||
<param name="wmode" value="transparent"> | ||
SWF file could not be loaded. | ||
</object> | ||
`; | ||
} | ||
</script> | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", function () { | ||
setTimeout(function () { | ||
var canvasElement = document.querySelector('#ruffle-player canvas'); | ||
|
||
// Check if 'swf' parameter is present in the URL | ||
const swfURL = getURLParameter('swf'); | ||
if (swfURL) { | ||
const rufflePlayer = document.getElementById('ruffle-player'); | ||
rufflePlayer.innerHTML = ` | ||
<object type="application/x-shockwave-flash" data="${swfURL}" allowfullscreen> | ||
<param name="movie" value="${swfURL}"> | ||
<param name="wmode" value="transparent"> | ||
SWF file could not be loaded. | ||
</object> | ||
if (canvasElement) { | ||
canvasElement.style.cssText = ` | ||
width: 100%; | ||
height: 100vh; | ||
/* Add any additional styles you want for the canvas element here */ | ||
`; | ||
} | ||
</script> | ||
<script src="https://ruffle.rs/demo/index.js"></script> | ||
</body> | ||
}, 3000); // 3000 milliseconds (3 seconds) | ||
}); | ||
</script> | ||
<script src="https://unpkg.com/@ruffle-rs/ruffle"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters