update to svelte 5 and tw 4 etc
This commit is contained in:
parent
2ea45109d1
commit
e3b9a83e73
327 changed files with 5275 additions and 3363 deletions
|
@ -1,12 +1,10 @@
|
|||
<script>
|
||||
import * as DropdownMenu from "$lib/components/ui/dropdown-menu/index.js";
|
||||
import * as Sidebar from "$lib/components/ui/sidebar/index.js";
|
||||
import { ChevronUp } from "lucide-svelte";
|
||||
import House from "lucide-svelte/icons/house";
|
||||
import User from "lucide-svelte/icons/user";
|
||||
import * as Sidebar from "$lib/components/ui/sidebar/index";
|
||||
import { ChevronUp } from "@lucide/svelte";
|
||||
import House from "@lucide/svelte/icons/house";
|
||||
import User from "@lucide/svelte/icons/user";
|
||||
import "../../app.css";
|
||||
import DropdownMenuItem from "$lib/components/ui/dropdown-menu/dropdown-menu-item.svelte";
|
||||
import { Button } from "bits-ui";
|
||||
let { children, data } = $props();
|
||||
|
||||
function getFloorName(n) {
|
||||
|
|
36
src/routes/(app)/[slug]/+page.server.ts
Normal file
36
src/routes/(app)/[slug]/+page.server.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { db } from "$lib/server/db";
|
||||
import * as table from "$lib/server/db/schema";
|
||||
import type { PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async ({ params }) => {
|
||||
{
|
||||
const floor = await db.select({ floor: table.plans.floor, json: table.plans.plan }).from(table.plans);
|
||||
if (floor.length == 0) {
|
||||
await db.insert(table.plans).values({ floor: params.slug, plan: {
|
||||
"regions": [
|
||||
{ "start": { "x": 100, "y": 100 }, "end": { "x": 400, "y": 100 } },
|
||||
{ "start": { "x": 400, "y": 100 }, "end": { "x": 400, "y": 300 } },
|
||||
{ "start": { "x": 400, "y": 300 }, "end": { "x": 100, "y": 300 } },
|
||||
{ "start": { "x": 100, "y": 300 }, "end": { "x": 100, "y": 100 } }
|
||||
],
|
||||
"doors": [
|
||||
{ "location": { "x": 240, "y": 100 }, "width": 50, "rotation": 0 }
|
||||
],
|
||||
"furnitures": [
|
||||
{
|
||||
"minBound": { "x": 150, "y": 150 },
|
||||
"maxBound": { "x": 200, "y": 200 },
|
||||
"equipName": "Table",
|
||||
"xPlacement": 150,
|
||||
"yPlacement": 150,
|
||||
"rotation": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
const floor = await db.select({ floor: table.plans.floor, json: table.plans.plan }).from(table.plans);
|
||||
return { slug: params.slug, floor: floor };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue