Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
Fixed `get-map.ts` selection
Installed `@types/node` for `encode-doors.ts` and moved it to `$lib/server`
  • Loading branch information
hopperelec committed Feb 10, 2024
1 parent a6aca07 commit c183f90
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 8 deletions.
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@sveltejs/kit": "^2.5.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/html-minifier-terser": "^7.0.2",
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.17",
Expand Down Expand Up @@ -57,4 +58,4 @@
"vitest": "^1.0.0"
},
"type": "module"
}
}
2 changes: 1 addition & 1 deletion src/lib/SVGMap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<div id="map-container"></div>

<svelte:head>
<link as="fetch" crossorigin="anonymous" href="{imgURL}" rel="preload">
<link as="fetch" crossorigin="anonymous" href={imgURL} rel="preload" />
<style>
[data-room]:hover {
filter: brightness(1.5);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/server/get-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default async function getMap(schoolId: number, mapId: number) {
creator: {
schoolId: schoolId,
},
select: { id: true },
},
select: { id: true },
});
if (map) return map;
error(403, "You do not have access to this map!");
Expand Down
9 changes: 7 additions & 2 deletions src/routes/game/[gameId=id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@
/>

<svelte:head>
<link as="fetch" crossorigin="anonymous" href="/maps/{data.mapId}/doors" rel="preload">
<link as="image" href="{data.picture || '/default_pfp.svg'}" rel="preload">
<link
as="fetch"
crossorigin="anonymous"
href="/maps/{data.mapId}/doors"
rel="preload"
/>
<link as="image" href={data.picture || "/default_pfp.svg"} rel="preload" />
<style>
[data-player] {
clip-path: inset(0% round 50%);
Expand Down
6 changes: 5 additions & 1 deletion src/routes/game/[gameId=id]/shop/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
<h3>{item.name}</h3>
<p class="description">{item.description || ""}</p>
<p>Cost: <span>{item.cost}</span> point{item.cost === 1 ? "" : "s"}</p>
<button type="button" on:click={() => buyItem(item.id)} disabled={item.cost > data.player.points}>Buy</button>
<button
type="button"
on:click={() => buyItem(item.id)}
disabled={item.cost > data.player.points}>Buy</button
>
</li>
{/each}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/maps/[mapId=id]/doors/+server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import prisma from "$lib/server/prisma";
import { error } from "@sveltejs/kit";
import encodeDoors from "$lib/encode-doors";
import encodeDoors from "$lib/server/encode-doors";

export const GET = async ({ params, locals }) => {
const map = await prisma.map.findFirst({
Expand Down
7 changes: 6 additions & 1 deletion src/routes/teacher/maps/[mapId=id]/doors/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@
/>

<svelte:head>
<link as="fetch" crossorigin="anonymous" href="/maps/{data.mapId}/doors" rel="preload">
<link
as="fetch"
crossorigin="anonymous"
href="/maps/{data.mapId}/doors"
rel="preload"
/>
<style>
/* noinspection CssUnusedSymbol */
.door-line {
Expand Down

0 comments on commit c183f90

Please sign in to comment.