fix: use proper aspect ratio and sizing for games
This commit is contained in:
@@ -16,11 +16,8 @@
|
||||
|
||||
if (!document.fullscreenElement) {
|
||||
await containerRef.requestFullscreen();
|
||||
isFullscreen = true;
|
||||
iframeRef?.focus();
|
||||
} else {
|
||||
await document.exitFullscreen();
|
||||
isFullscreen = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,7 +42,7 @@
|
||||
<svelte:document onfullscreenchange={handleFullscreenChange} />
|
||||
|
||||
<main class="flex min-h-screen flex-col items-center px-4 py-8">
|
||||
<div class="relative mb-6 flex w-full max-w-4xl items-center justify-center">
|
||||
<div class="relative mb-6 flex w-full max-w-6xl items-center justify-center">
|
||||
<Button.Root
|
||||
class="absolute left-0 flex items-center gap-2 rounded-md px-3 py-2 text-gray-400 transition-colors hover:bg-gray-800 hover:text-white"
|
||||
onclick={() => goto('/')}
|
||||
@@ -54,17 +51,17 @@
|
||||
<span>Back</span>
|
||||
</Button.Root>
|
||||
|
||||
<h1 class="text-xl font-semibold text-white">Project {id}</h1>
|
||||
<h1 class="text-xl font-semibold text-white"></h1>
|
||||
</div>
|
||||
|
||||
<div
|
||||
bind:this={containerRef}
|
||||
class="relative w-full max-w-4xl overflow-hidden rounded-md bg-black shadow-2xl ring-1 ring-gray-700/80"
|
||||
class="relative w-full max-w-6xl overflow-hidden rounded-md bg-black shadow-2xl ring-1 ring-gray-700/80"
|
||||
class:max-w-none={isFullscreen}
|
||||
class:h-screen={isFullscreen}
|
||||
class:rounded-none={isFullscreen}
|
||||
>
|
||||
<div class="aspect-video" class:aspect-auto={isFullscreen} class:h-full={isFullscreen}>
|
||||
<div class="aspect-1152/648" class:aspect-auto={isFullscreen} class:h-full={isFullscreen}>
|
||||
<iframe
|
||||
bind:this={iframeRef}
|
||||
{src}
|
||||
|
||||
Reference in New Issue
Block a user