Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/flash.astro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const { gamePath } = Astro.props;
}
</style>

<script src="/ruffle/ruffle.js" is:inline></script>
<script src="/ruffle/ruffle.js" defer is:inline onerror="window.__ruffleFailed=true"></script>
<script is:inline>
(function () {
var wrap = document.getElementById("flash-player-wrap");
Expand Down Expand Up @@ -107,12 +107,17 @@ const { gamePath } = Astro.props;
});
}

// ── Ruffle readiness (polling fallback) ──
var maxAttempts = 50;
// ── Ruffle readiness (polling fallback, covers deferred ruffle.js) ──
var maxAttempts = 75;
var attempts = 0;

function ready() {
if (destroyed) return;
// ponytail: fail fast on script 404/offline, keep polling for slow networks
if (window.__ruffleFailed) {
showError("Failed to load Flash player. Please refresh the page.");
return;
}
try {
var ruffle =
typeof window.RufflePlayer !== "undefined" &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/gametile.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const altText = `${Game} unblocked - play online free`;
height="200"
loading="lazy"
decoding="async"
class="aspect-[3/2] h-auto w-full max-w-[300px] rounded-xl transition-transform duration-300 hover:scale-105 hover:shadow-lg active:scale-95"
class="aspect-[3/2] h-auto w-full max-w-[300px] rounded-xl transition-transform duration-300 hover:scale-105 active:scale-95"
/>
<p class="text-gray-800 dark:text-neutral-200 transition-colors hover:text-black dark:hover:text-white">{Game}</p>
</a>
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const popularGames = defaultGames.slice(0, POPULAR_COUNT);
img.loading = "lazy";
img.decoding = "async";
img.className =
"aspect-[3/2] h-auto w-full max-w-[300px] rounded-xl transition-transform duration-300 hover:scale-105 hover:shadow-lg active:scale-95";
"aspect-[3/2] h-auto w-full max-w-[300px] rounded-xl transition-transform duration-300 hover:scale-105 active:scale-95";
var p = document.createElement("p");
p.className = "text-gray-800 dark:text-neutral-200 transition-colors hover:text-black dark:hover:text-white";
p.textContent = g.t;
Expand Down
Loading