demo: Add Ruffle splash anim as initial animation

This commit is contained in:
Mike Welsh 2022-04-26 20:46:39 -07:00
parent 4a9d6867ba
commit d3becd9d2c
4 changed files with 19 additions and 11 deletions

View File

@ -33,6 +33,7 @@ module.exports = (_env, _argv) => {
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ from: path.resolve(__dirname, "www/index.html") }, { from: path.resolve(__dirname, "www/index.html") },
{ from: path.resolve(__dirname, "www/logo-anim.swf") },
{ from: "swfs.json", noErrorOnMissing: true }, { from: "swfs.json", noErrorOnMissing: true },
{ from: "LICENSE*" }, { from: "LICENSE*" },
{ from: "README.md" }, { from: "README.md" },

View File

@ -141,10 +141,8 @@ window.addEventListener("load", () => {
(async () => { (async () => {
const response = await fetch("swfs.json"); const response = await fetch("swfs.json");
if (!response.ok) {
return;
}
if (response.ok) {
const data = await response.json(); const data = await response.json();
for (const swfData of data.swfs) { for (const swfData of data.swfs) {
const option = document.createElement("option"); const option = document.createElement("option");
@ -154,6 +152,7 @@ window.addEventListener("load", () => {
optionGroups[swfData.type].append(option); optionGroups[swfData.type].append(option);
} }
sampleFileInputContainer.classList.remove("hidden"); sampleFileInputContainer.classList.remove("hidden");
}
const initialFile = new URL(window.location).searchParams.get("file"); const initialFile = new URL(window.location).searchParams.get("file");
if (initialFile) { if (initialFile) {
@ -163,5 +162,13 @@ window.addEventListener("load", () => {
0 0
); );
loadSample(); loadSample();
} else {
load({
url: "logo-anim.swf",
autoplay: "on",
backgroundColor: "#31497D",
letterbox: "off",
unmuteOverlay: "hidden",
});
} }
})(); })();

Binary file not shown.

Binary file not shown.