Skip to content

Commit d3becd9

Browse files
committed
demo: Add Ruffle splash anim as initial animation
1 parent 4a9d686 commit d3becd9

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

web/packages/demo/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = (_env, _argv) => {
3333
new CopyPlugin({
3434
patterns: [
3535
{ from: path.resolve(__dirname, "www/index.html") },
36+
{ from: path.resolve(__dirname, "www/logo-anim.swf") },
3637
{ from: "swfs.json", noErrorOnMissing: true },
3738
{ from: "LICENSE*" },
3839
{ from: "README.md" },

web/packages/demo/www/index.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,18 @@ window.addEventListener("load", () => {
141141

142142
(async () => {
143143
const response = await fetch("swfs.json");
144-
if (!response.ok) {
145-
return;
146-
}
147144

148-
const data = await response.json();
149-
for (const swfData of data.swfs) {
150-
const option = document.createElement("option");
151-
option.textContent = swfData.title;
152-
option.value = swfData.location;
153-
option.swfData = swfData;
154-
optionGroups[swfData.type].append(option);
145+
if (response.ok) {
146+
const data = await response.json();
147+
for (const swfData of data.swfs) {
148+
const option = document.createElement("option");
149+
option.textContent = swfData.title;
150+
option.value = swfData.location;
151+
option.swfData = swfData;
152+
optionGroups[swfData.type].append(option);
153+
}
154+
sampleFileInputContainer.classList.remove("hidden");
155155
}
156-
sampleFileInputContainer.classList.remove("hidden");
157156

158157
const initialFile = new URL(window.location).searchParams.get("file");
159158
if (initialFile) {
@@ -163,5 +162,13 @@ window.addEventListener("load", () => {
163162
0
164163
);
165164
loadSample();
165+
} else {
166+
load({
167+
url: "logo-anim.swf",
168+
autoplay: "on",
169+
backgroundColor: "#31497D",
170+
letterbox: "off",
171+
unmuteOverlay: "hidden",
172+
});
166173
}
167174
})();
1.01 MB
Binary file not shown.
27.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)