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({
patterns: [
{ from: path.resolve(__dirname, "www/index.html") },
{ from: path.resolve(__dirname, "www/logo-anim.swf") },
{ from: "swfs.json", noErrorOnMissing: true },
{ from: "LICENSE*" },
{ from: "README.md" },

View File

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

Binary file not shown.

Binary file not shown.