-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: masonry layout and edit maps/textures
- Loading branch information
1 parent
ce11a26
commit bf8aa85
Showing
9 changed files
with
92 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
<script> | ||
import { Loader2 } from "lucide-svelte"; | ||
import { browser } from "$app/environment"; | ||
export let init; | ||
</script> | ||
|
||
<section class="container flex w-full items-center justify-center p-4"> | ||
<div class="relative w-full"> | ||
<canvas id="bevy-canvas" oncontextmenu="return false;" class="w-full" /> | ||
{#await init()} | ||
<div | ||
class="absolute top-0 flex h-full w-full items-center justify-center bg-white dark:bg-black" | ||
> | ||
<Loader2 class="h-20 w-20 animate-spin" /> | ||
</div> | ||
{/await} | ||
{#if browser} | ||
{#await init()} | ||
<div | ||
class="absolute top-0 flex h-full w-full items-center justify-center bg-white dark:bg-black" | ||
> | ||
<Loader2 class="h-20 w-20 animate-spin" /> | ||
</div> | ||
{/await} | ||
{/if} | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { error } from "@sveltejs/kit"; | ||
import prisma from "$lib/prisma"; | ||
|
||
const utils = ["map", "terrain", "planet"]; | ||
/** @type {import('./$types').PageLoad} */ | ||
export async function load({ params, url }) { | ||
|
||
if (utils.includes(params.util)) { | ||
let asset; | ||
if (url.searchParams.get("id")) { | ||
if (url.searchParams.get("id")) { | ||
asset = await prisma.asset.findUnique({ where: { id: url.searchParams.get("id") } }); | ||
} | ||
} | ||
return { asset: JSON.stringify(asset?.data), util: params.util }; | ||
} | ||
error(404, "Not found"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters