diff --git a/front/.gitignore b/front/.gitignore index 6e3bc0e..230a6d8 100644 --- a/front/.gitignore +++ b/front/.gitignore @@ -131,3 +131,4 @@ dist /build/ /.svelte-kit/ /.svelte-kit/ +/.svelte-kit/ diff --git a/front/.svelte-kit/ambient.d.ts b/front/.svelte-kit/ambient.d.ts index 103b1b8..f57c813 100644 --- a/front/.svelte-kit/ambient.d.ts +++ b/front/.svelte-kit/ambient.d.ts @@ -42,7 +42,7 @@ declare module '$env/static/private' { export const DB_USER: string; export const DriverData: string; export const EDITOR: string; - export const EFC_10816: string; + export const EFC_10388: string; export const ffmpeg: string; export const FPS_BROWSER_APP_PROFILE_STRING: string; export const FPS_BROWSER_USER_PROFILE_STRING: string; @@ -150,7 +150,7 @@ declare module '$env/dynamic/private' { DB_USER: string; DriverData: string; EDITOR: string; - EFC_10816: string; + EFC_10388: string; ffmpeg: string; FPS_BROWSER_APP_PROFILE_STRING: string; FPS_BROWSER_USER_PROFILE_STRING: string; diff --git a/front/.svelte-kit/generated/client/app.js b/front/.svelte-kit/generated/client/app.js index a947ae9..f89777f 100644 --- a/front/.svelte-kit/generated/client/app.js +++ b/front/.svelte-kit/generated/client/app.js @@ -11,7 +11,7 @@ export const nodes = [ export const server_loads = []; export const dictionary = { - "/": [2], + "/": [~2], "/about": [3], "/play": [4] }; diff --git a/front/.svelte-kit/generated/server/internal.js b/front/.svelte-kit/generated/server/internal.js index 81983c3..dc6322c 100644 --- a/front/.svelte-kit/generated/server/internal.js +++ b/front/.svelte-kit/generated/server/internal.js @@ -21,7 +21,7 @@ export const options = { app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\tUnluckiest\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" }, - version_hash: "1itsftj" + version_hash: "3iwm3b" }; export async function get_hooks() { diff --git a/front/.svelte-kit/types/route_meta_data.json b/front/.svelte-kit/types/route_meta_data.json index 385875b..bb8a414 100644 --- a/front/.svelte-kit/types/route_meta_data.json +++ b/front/.svelte-kit/types/route_meta_data.json @@ -1,5 +1,7 @@ { - "/": [], + "/": [ + "src/routes/+page.server.ts" + ], "/about": [], "/play": [] } \ No newline at end of file diff --git a/front/.svelte-kit/types/src/routes/$types.d.ts b/front/.svelte-kit/types/src/routes/$types.d.ts index c3cf71b..744b51a 100644 --- a/front/.svelte-kit/types/src/routes/$types.d.ts +++ b/front/.svelte-kit/types/src/routes/$types.d.ts @@ -11,12 +11,19 @@ type OutputDataShape = MaybeWithVoid> & Pa type EnsureDefined = T extends null | undefined ? {} : T; type OptionalUnion, A extends keyof U = U extends U ? keyof U : never> = U extends unknown ? { [P in Exclude]?: never } & U : never; export type Snapshot = Kit.Snapshot; +type PageServerParentData = EnsureDefined; type PageParentData = EnsureDefined; type LayoutRouteId = RouteId | "/" | "/about" | "/play" | null type LayoutParams = RouteParams & { } type LayoutParentData = EnsureDefined<{}>; -export type PageServerData = null; -export type PageData = Expand; +export type PageServerLoad = OutputDataShape> = Kit.ServerLoad; +export type PageServerLoadEvent = Parameters[0]; +export type ActionData = unknown; +export type PageServerData = Expand>>>>>; +export type PageData = Expand & EnsureDefined>; +export type Action | void = Record | void> = Kit.Action +export type Actions | void = Record | void> = Kit.Actions export type LayoutServerData = null; -export type LayoutData = Expand; \ No newline at end of file +export type LayoutData = Expand; +export type RequestEvent = Kit.RequestEvent; \ No newline at end of file diff --git a/front/src/lib/stores/scoreStore.ts b/front/src/lib/stores/scoreStore.ts index 76dacff..59ce405 100644 --- a/front/src/lib/stores/scoreStore.ts +++ b/front/src/lib/stores/scoreStore.ts @@ -26,9 +26,8 @@ function createStore(){ }); }, - loadData: async () => { - if(scores.length !== 0) return; - let res = sort(await getLeaderboard()); + load: (data : Score[]) => { + let res = sort(data); set(res); }, }; diff --git a/front/src/routes/+page.server.ts b/front/src/routes/+page.server.ts new file mode 100644 index 0000000..0f22321 --- /dev/null +++ b/front/src/routes/+page.server.ts @@ -0,0 +1,10 @@ +const api_url = import.meta.env.VITE_SERVER_API_URL + +// @ts-ignore +export const load = async ( {fetch} ) => { + + const res = await fetch(`${api_url}/leaderboard`) + const leaderboard = await res.json() + + return { leaderboard }; +} \ No newline at end of file diff --git a/front/src/routes/+page.svelte b/front/src/routes/+page.svelte index e34b84a..ce51a3a 100644 --- a/front/src/routes/+page.svelte +++ b/front/src/routes/+page.svelte @@ -1,11 +1,13 @@ diff --git a/front/src/routes/play/+page.svelte b/front/src/routes/play/+page.svelte index 742f1e8..459e55a 100644 --- a/front/src/routes/play/+page.svelte +++ b/front/src/routes/play/+page.svelte @@ -98,11 +98,12 @@ button { + background-color: #f1ecec; + color: black; width: 18vw; height: 15vh; border-radius: 10px; - background-color: #f1ecec; border: 2px solid #A1674A; box-shadow: 0 0 10px #343232; } diff --git a/front/static/style/app.css b/front/static/style/app.css index c8a0144..7972fdd 100644 --- a/front/static/style/app.css +++ b/front/static/style/app.css @@ -18,7 +18,14 @@ h1 html { - background: linear-gradient(45deg, #b9b9c9, #d2379b); + background-image: url("../images/background.png"); + background-repeat:no-repeat; + -webkit-background-size:cover; + -moz-background-size:cover; + -o-background-size:cover; + background-size:cover; + background-position:center; + /*background: linear-gradient(45deg, #b9b9c9, #d2379b);*/ } body