From b21dd901048c39f7b2b6f0f8f37e53a8406514c7 Mon Sep 17 00:00:00 2001 From: Cooper Date: Wed, 26 Jun 2024 11:37:07 -0500 Subject: [PATCH 1/6] Update install page to show i(Pad)OS as not available (when user is on an i(Pad)OS device --- src/routes/install/+page.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/routes/install/+page.svelte b/src/routes/install/+page.svelte index 80da97b..eadd7ee 100644 --- a/src/routes/install/+page.svelte +++ b/src/routes/install/+page.svelte @@ -16,7 +16,7 @@ let latestVersion = "v3.1.1"; let latestLauncher = "v1.4.1"; let showAllPlatforms = false; - let curPlatform: 'windows' | 'mac' | 'android' | 'linux' | 'unknown' | undefined = undefined; + let curPlatform: 'windows' | 'mac' | 'android' | 'linux' | 'ios' | 'unknown' | undefined = undefined; const createVersionString = (platform: 'windows' | 'mac' | 'android' | "linux"): string => { let filename = ""; @@ -49,6 +49,9 @@ curPlatform = "android"; } else if (window.navigator.userAgent.includes("Linux")) { curPlatform = "linux"; + } else if ([ 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod' ].includes(window.navigator.platform)) { + curPlatform = "ios"; + showAllPlatforms = true; } else { curPlatform = "unknown"; showAllPlatforms = true; @@ -91,7 +94,7 @@

- Geode is available for Windows, MacOS, Linux (through Wine / Proton) and Android. + Geode is available for Windows, macOS, Linux (through Wine / Proton) and Android.

@@ -101,6 +104,12 @@ {#if curPlatform === "unknown"}

Couldn't auto detect your platform. You can download Geode for your chosen platform below.

{/if} + {#if curPlatform === "ios"} +

Geode is not available on iOS right now. If you got it from another source or a YouTube video, it's a scam. Click here for more info.

+ + {/if} {#if curPlatform === "linux"}

Geometry Dash is not available on Linux, but you can run the Windows version through Wine / Proton. Click here for more info.

+ + +{:else if status_current_step == 2} +
+ +

Your code is

+

{ghLoginData.code || "EXAM-PLES"}

+

We also copied it to your clipboard.

+ + +
+
+ +{:else if status_current_step == 3} +
+ +

Success!

+

You are now logged in!

+ +
+
+{/if} + + + + + + + + \ No newline at end of file diff --git a/src/routes/stats/+page.svelte b/src/routes/stats/+page.svelte new file mode 100644 index 0000000..8c63287 --- /dev/null +++ b/src/routes/stats/+page.svelte @@ -0,0 +1,106 @@ + + + + + + + Live Stats + + + +

Live Stats

+ + +{#if loading} +

Loading stats...

+{:else if error} + Unable to load stats! +{:else} + + + + + + + + +{/if} +
+ + + + + From 1126d9094073a2de988c2918edc8811706b5c5f3 Mon Sep 17 00:00:00 2001 From: Cooper Date: Wed, 26 Jun 2024 23:43:43 -0500 Subject: [PATCH 3/6] also forgot this now gn --- src/routes/login/+page.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 2c362c5..7d61ece 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -97,6 +97,11 @@ + + Developer Login + + + From 126603e0201128d71965e46eafce512f9dc7d285 Mon Sep 17 00:00:00 2001 From: Cooper Date: Thu, 27 Jun 2024 16:12:06 -0500 Subject: [PATCH 4/6] add cool little dev dropdown thingy --- src/lib/components/Button.svelte | 22 +++++- src/lib/events.ts | 7 ++ src/routes/+layout.server.ts | 30 +++++++ src/routes/+layout.svelte | 126 +++++++++++++++++++++++++++++- src/routes/+page.server.ts | 17 ++++ src/routes/+page.svelte | 19 ++++- src/routes/login/+page.svelte | 10 +++ src/routes/logout/+page.server.ts | 11 +++ src/routes/logout/+page.svelte | 9 +++ src/routes/me/+page.svelte | 29 ++++++- 10 files changed, 274 insertions(+), 6 deletions(-) create mode 100644 src/lib/events.ts create mode 100644 src/routes/+layout.server.ts create mode 100644 src/routes/+page.server.ts create mode 100644 src/routes/logout/+page.server.ts create mode 100644 src/routes/logout/+page.svelte diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 49e695f..6d3010d 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -6,6 +6,7 @@ 'primary-filled-dark' | 'primary-filled' | 'primary-hollow' | + 'secondary-filled-dark' | 'secondary-filled' | 'secondary-hollow' | 'hollow' | @@ -17,9 +18,14 @@ export let icon: KnownIcon | undefined = undefined; export let iconOnRight = false; export let disabled = false; + let enableTheDisabledStyle = false; + $: enableTheDisabledStyle = $$props['enable-disabled-style'] + let additionalClasses: string | undefined = undefined; + $: additionalClasses = $$props['additional-classes'] + -
+ {#if iconOnRight} {/if} @@ -89,6 +95,17 @@ border-color: var(--primary-50); } } + &.secondary-filled-dark, &.secondary-filled-dark.disabled { + color: var(--secondary-300); + background-color: var(--secondary-950); + border-color: var(--secondary-950); + box-shadow: 0px .1rem .5rem color-mix(in srgb, var(--secondary-950) 50%, transparent); + &:hover { + color: var(--secondary-950); + background-color: var(--secondary-50); + border-color: var(--secondary-50); + } + } &.secondary-filled, &.secondary-filled.disabled { color: var(--secondary-950); background-color: var(--secondary-300); @@ -150,6 +167,9 @@ } &.disabled { pointer-events: none; + opacity: 55%; + } + &.disabled.disable-style { color: var(--background-50); background-color: var(--background-800); border-color: var(--background-800); diff --git a/src/lib/events.ts b/src/lib/events.ts new file mode 100644 index 0000000..6e7f40d --- /dev/null +++ b/src/lib/events.ts @@ -0,0 +1,7 @@ +var events: HTMLAnchorElement; + +function startEvents(document: Document) { + if(!events) { events = document.createElement("a"); } +} + +export {events, startEvents} \ No newline at end of file diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts new file mode 100644 index 0000000..21912ea --- /dev/null +++ b/src/routes/+layout.server.ts @@ -0,0 +1,30 @@ +import { fail, redirect } from "@sveltejs/kit"; +import type { LayoutServerLoad } from "./$types.js"; +import { + IndexError, + deleteAllTokens, + deleteToken, + getSelf, + updateProfile, +} from "$lib/api/index-repository.js"; + +export const load: LayoutServerLoad = async ({ cookies }) => { + const token = cookies.get("token"); + + let loggedIn = typeof token == "string"; + + // i'm having a js moment, honestly + let self = undefined; + + try { + if (loggedIn) { + self = await getSelf(token); + cookies.set("cached_profile", JSON.stringify(self), { path: "/" }); + } + } catch (error) { + loggedIn = false + console.log(`Unknown Error in +layout.server.ts: ${error}`) + } + + return { loggedIn, self }; +}; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e056777..a7c17b4 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,12 +1,50 @@
@@ -15,7 +53,34 @@
@@ -101,6 +166,65 @@ position: fixed; top: 1rem; left: 1rem; + + & > div.left-side { + position: fixed; + top: 1rem; + left: 1rem; + display: flex; + flex-direction: column; + } + & > div.right-side { + position: fixed; + top: 1rem; + right: 1rem; + display: flex; + flex-direction: column; + + & > div.dropdown { + & a .nav-dev-profile-picture { + width: var(--icon-size); + height: var(--icon-size); + pointer-events: none; + border-radius: 100%; + } + + & > :global(a) :global(.icon) > :global(svg) { + transition: transform 500ms; + } + + &:global(.show) > :global(a) :global(.icon) > :global(svg) { + transform: rotate(180deg); + } + + & > :global(div.dropdown-content) { + display: flex; + flex-direction: column; + border-radius: .15rem; + border-style: solid; + border-width: .15rem; + background-color: var(--primary-950); + border-color: var(--primary-950); + box-shadow: 0px .1rem .5rem color-mix(in srgb, var(--primary-950) 50%, transparent); + transition: opacity .7s, transform .5s; + transform: translateY(1.2em); + opacity: 0; + pointer-events: none; + } + + &:global(.show) > :global(div.dropdown-content) { + display: flex; + flex-direction: column; + transform: translateY(-1.2em); + opacity: 100%; + pointer-events: all; + } + } + } + } + + :global(.red) { + color: rgb(190, 42, 42) !important; } .waves-bottom { diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts new file mode 100644 index 0000000..fe31c26 --- /dev/null +++ b/src/routes/+page.server.ts @@ -0,0 +1,17 @@ +import { fail, redirect } from "@sveltejs/kit"; +import type { Actions, PageServerLoad } from "./$types.js"; +import { + IndexError, + deleteAllTokens, + deleteToken, + getSelf, + updateProfile, +} from "$lib/api/index-repository.js"; + +export const load: PageServerLoad = async ({ cookies }) => { + const token = cookies.get("token"); + + let loggedIn = typeof token == "string" + + return { loggedIn }; +}; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index eb607d9..c4525e2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,4 +1,7 @@ @@ -50,10 +63,10 @@ - +
- + The main page Discord @@ -155,7 +168,7 @@ - + diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 7d61ece..18dd69e 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -2,6 +2,7 @@ import { onMount } from "svelte"; import { sineInOut, quadOut } from 'svelte/easing'; import { enhance } from '$app/forms'; + import { events, startEvents } from "$lib/events"; import type { ActionData } from './$types'; import Button from "$lib/components/Button.svelte"; import Column from "$lib/components/Column.svelte"; @@ -33,6 +34,10 @@ if (token != null && token != "[object Object]") { document.cookie = "token=" + token; status_current_step = 3; + const loggedInEventToNav = new CustomEvent("loggedin", { + detail: token, + }); + events.dispatchEvent(loggedInEventToNav); clearInterval(pollInterval); } } @@ -76,6 +81,7 @@ status_loading = true; setTimeout(async () => { var res = ghLoginData = await githubAuth(); + console.log(res) status_loading_message = "Opening up GitHub"; setTimeout(async () => { status_loading_message = "Loading next step..."; @@ -95,6 +101,10 @@ // there is a reason there are alot of set timeouts, it's so animations don't skip and shit. } + onMount(() => { + startEvents(document); + return () => clearInterval(pollInterval); + }) diff --git a/src/routes/logout/+page.server.ts b/src/routes/logout/+page.server.ts new file mode 100644 index 0000000..770ab51 --- /dev/null +++ b/src/routes/logout/+page.server.ts @@ -0,0 +1,11 @@ +import { redirect } from "@sveltejs/kit"; +import type { PageServerLoad } from "./$types"; +import { deleteToken } from "$lib/api/index-repository"; +export const load: PageServerLoad = async ({ cookies }) => { + deleteToken(cookies.get("token")); + cookies.delete("token", { path: "/" }); + cookies.delete("cached_profile", { path: "/" }); + + redirect(304, "/") + return; +}; diff --git a/src/routes/logout/+page.svelte b/src/routes/logout/+page.svelte new file mode 100644 index 0000000..b67e388 --- /dev/null +++ b/src/routes/logout/+page.svelte @@ -0,0 +1,9 @@ + + +
Redirecting... \ No newline at end of file diff --git a/src/routes/me/+page.svelte b/src/routes/me/+page.svelte index 9cf0f6d..6b062c9 100644 --- a/src/routes/me/+page.svelte +++ b/src/routes/me/+page.svelte @@ -1,6 +1,24 @@ + + Developer Login + + + + + + +
it's you! - {data.self.display_name} ({data.self.username}) ((#{data.self.id})) + {data.self.display_name} ({data.self.username}) ((ID: #{data.self.id}))

admin: {data.self.admin}
From 3e1a31b5f2ab4663aa0adeb655ecb5f482ff4fce Mon Sep 17 00:00:00 2001 From: Cooper Date: Fri, 19 Jul 2024 14:19:38 -0500 Subject: [PATCH 5/6] i forgor to push something then i deleted the repo also now i am gonna do this later in le future and stuff yea um so yea bye --- src/routes/login/+page.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 18dd69e..ce7d066 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -98,7 +98,7 @@ }, 200) }, 500) }, 1000) - // there is a reason there are alot of set timeouts, it's so animations don't skip and shit. + // there is a reason there are alot of set timeouts, it's so animations don't skip and shit, and also because I made those animations, I want want it to be seen! } onMount(() => { @@ -136,6 +136,8 @@

When you click Sign In, a GitHub window will popup asking for a code, we will display it right on this page.

+ +

Important: Sometimes the index login system glitches and even though you did login with GitHub, it doesn't move you on and gives you the same code. If this does happen, please wait 5-20 minutes (usually it's in the 5-10 minute range) to come back here and try to login again. Also sometimes it catches up and then logs you in automatically, that can happen as well and is normal.

{:else if status_current_step == 2} From 5797169dc944aeefee96a6d5e1691242ebe302f2 Mon Sep 17 00:00:00 2001 From: Cooper Date: Tue, 23 Jul 2024 21:01:52 -0500 Subject: [PATCH 6/6] add part of dashboard and do your mods page (ik it looks bad and idc!) --- src/lib/components/Button.svelte | 2 +- src/lib/components/ModCard.svelte | 30 +++-- src/lib/components/MoneyBox.svelte | 5 +- src/lib/index.ts | 3 + src/routes/+layout.svelte | 12 +- src/routes/+page.server.ts | 10 +- src/routes/+page.svelte | 4 +- src/routes/dash/+page.server.ts | 27 +++++ src/routes/dash/+page.svelte | 147 +++++++++++++++++++++++++ src/routes/dash/mods/+page.server.ts | 24 ++++ src/routes/dash/mods/+page.svelte | 159 +++++++++++++++++++++++++++ src/routes/install/+page.svelte | 2 +- src/routes/login/+page.svelte | 28 ++--- src/routes/logout/+page.server.ts | 26 ++++- src/routes/stats/+page.svelte | 6 - 15 files changed, 428 insertions(+), 57 deletions(-) create mode 100644 src/routes/dash/+page.server.ts create mode 100644 src/routes/dash/+page.svelte create mode 100644 src/routes/dash/mods/+page.server.ts create mode 100644 src/routes/dash/mods/+page.svelte diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 6d3010d..e4f93bb 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -25,7 +25,7 @@ - + {#if iconOnRight} {/if} diff --git a/src/lib/components/ModCard.svelte b/src/lib/components/ModCard.svelte index b0123ab..5f06976 100644 --- a/src/lib/components/ModCard.svelte +++ b/src/lib/components/ModCard.svelte @@ -1,6 +1,6 @@
{#if style === 'list'} @@ -48,6 +54,7 @@ {owner.display_name} + {#if !hideDescription}

{#if version.description} {#if version.description?.length < 110} @@ -59,13 +66,14 @@ {"Description not provided"} {/if}

+ {/if}
- {version.version} - {abbreviateNumber(mod.download_count)} - {serverTimestampToAgoString(mod.updated_at)} + {#if !hideVersion}{version.version}{/if} + {abbreviateNumber(versionDownloadCount ? version.download_count : mod.download_count)} + {#if mod.updated_at != undefined}{serverTimestampToAgoString(mod.updated_at)}{/if} {:else} @@ -89,9 +97,10 @@ {owner.display_name} - {version.version} - {abbreviateNumber(mod.download_count)} + {#if !hideVersion}{version.version}{/if} + {abbreviateNumber(versionDownloadCount ? version.download_count : mod.download_count)} + {#if !hideDescription}

{#if version.description} @@ -104,6 +113,7 @@ {"Description not provided"} {/if}

+ {/if} {/if} diff --git a/src/lib/components/MoneyBox.svelte b/src/lib/components/MoneyBox.svelte index 2445586..7e82217 100644 --- a/src/lib/components/MoneyBox.svelte +++ b/src/lib/components/MoneyBox.svelte @@ -4,7 +4,7 @@ import { onMount } from "svelte"; import { tweened } from 'svelte/motion'; - import { quintOut, cubicOut } from 'svelte/easing'; + import { quintOut } from 'svelte/easing'; import { derived } from 'svelte/store'; export let icon: KnownIcon; @@ -12,7 +12,7 @@ export let num: number; let countup = tweened(0, { duration: 1500, easing: quintOut }); - let formatted = derived(countup, ($countup) => $countup.toLocaleString(undefined, { maximumFractionDigits: 0 })); // derived(countup, ($countup) => $countup.toLocaleString(undefined, { maximumFractionDigits: 0 })); + let formatted = derived(countup, ($countup) => $countup.toLocaleString(undefined, { maximumFractionDigits: 0 })); let number: HTMLSpanElement; @@ -22,7 +22,6 @@ const observer = new IntersectionObserver(entries => { entries.reverse().forEach(entry => { if (entry.isIntersecting) { - //countup.set(num); countup.set(num); } }); diff --git a/src/lib/index.ts b/src/lib/index.ts index 4166dbb..6f5ee86 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -56,6 +56,9 @@ export const icons = { modify: "mdi:pencil", update: "mdi:clock-edit", info: "mdi:about", + plus: "mdi:plus", + person: "mdi:person", + admin: "mdi:hammer-wrench", "tag-universal": "mdi:globe", "tag-gameplay": "mdi:gamepad-variant", diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index a7c17b4..4e43e7e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -55,11 +55,15 @@