The next-generation file converter. Open source, fully local* and free forever.
Use consts.ts for URLs, remove google preconnect
JovannMC78b72bbc5cb9
diff --git a/src/app.html b/src/app.htmlindex f9b4589..5d8cb17 100644--- a/src/app.html+++ b/src/app.html@@ -4,8 +4,6 @@<meta charset="utf-8" /><link rel="icon" href="%sveltekit.assets%/favicon.webp" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <link rel="preconnect" href="https://fonts.googleapis.com" />- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />%sveltekit.head%<script>(function () {diff --git a/src/lib/consts.ts b/src/lib/consts.tsnew file mode 100644index 0000000..ca9b209--- /dev/null+++ b/src/lib/consts.ts@@ -0,0 +1,4 @@+export const GITHUB_URL = 'https://github.com/VERT-sh/VERT';+export const GITHUB_API_URL = 'https://api.github.com/repos/VERT-sh/VERT';++export const DISCORD_URL = 'https://discord.gg/kqevGxYPak';diff --git a/src/lib/sections/about/Credits.svelte b/src/lib/sections/about/Credits.svelteindex 967cb0b..9254c53 100644--- a/src/lib/sections/about/Credits.svelte+++ b/src/lib/sections/about/Credits.svelte@@ -1,6 +1,7 @@<script lang="ts">import Panel from "$lib/components/visual/Panel.svelte";import { HeartHandshakeIcon } from "lucide-svelte";+ import { GITHUB_URL } from "$lib/consts";let { mainContribs, ghContribs } = $props();</script>@@ -63,7 +64,7 @@Big thanks to all these people for helping out!<aclass="text-blue-500 font-normal hover:underline"- href="https://github.com/not-nullptr/VERT"+ href={GITHUB_URL}target="_blank"rel="noopener noreferrer">@@ -75,7 +76,7 @@Seems like no one has contributed yet...<aclass="text-blue-500 font-normal hover:underline"- href="https://github.com/not-nullptr/VERT"+ href={GITHUB_URL}target="_blank"rel="noopener noreferrer">diff --git a/src/lib/sections/about/Resources.svelte b/src/lib/sections/about/Resources.svelteindex c1d5d60..68c27cb 100644--- a/src/lib/sections/about/Resources.svelte+++ b/src/lib/sections/about/Resources.svelte@@ -1,5 +1,6 @@<script lang="ts">import Panel from "$lib/components/visual/Panel.svelte";+ import { DISCORD_URL, GITHUB_URL } from "$lib/consts";import { GithubIcon, LinkIcon, MessageCircleMoreIcon } from "lucide-svelte";</script>@@ -14,7 +15,7 @@</h2><div class="flex gap-3"><a- href="https://discord.gg/kqevGxYPak"+ href={DISCORD_URL}target="_blank"rel="noopener noreferrer"class="btn flex-1 gap-2 p-4 rounded-full bg-button text-black dynadark:text-white flex items-center justify-center"@@ -23,7 +24,7 @@Discord</a><a- href="https://github.com/not-nullptr/VERT"+ href={GITHUB_URL}target="_blank"rel="noopener noreferrer"class="btn flex-1 gap-2 p-4 rounded-full bg-button text-black dynadark:text-white flex items-center justify-center"diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelteindex 145f4ef..a6e4542 100644--- a/src/routes/+layout.svelte+++ b/src/routes/+layout.svelte@@ -28,6 +28,7 @@import { quintOut } from "svelte/easing";import "../app.scss";import { writable } from "svelte/store";+ import { DISCORD_URL, GITHUB_URL } from "$lib/consts";let { children } = $props();let shouldGoBack = writable(false);@@ -225,8 +226,8 @@class="w-full h-full"items={{//"Privacy policy": "#",- "Source code": "https://github.com/not-nullptr/VERT",- "Discord server": "https://discord.gg/kqevGxYPak",+ "Source code": GITHUB_URL,+ "Discord server": DISCORD_URL,}}/></div>diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelteindex 1233e58..b5d2dd2 100644--- a/src/routes/about/+page.svelte+++ b/src/routes/about/+page.svelte@@ -6,6 +6,7 @@import avatarNullptr from "$lib/assets/avatars/nullptr.jpg";import avatarRealmy from "$lib/assets/avatars/realmy.jpg";import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";+ import { GITHUB_API_URL } from "$lib/consts";interface Donator {name: string;@@ -53,17 +54,15 @@console.log("Loaded GitHub contributors from cache");return;}-+// Fetch GitHub contributorstry {- const response = await fetch(- "https://api.github.com/repos/not-nullptr/VERT/contributors",- );+ const response = await fetch(`${GITHUB_API_URL}/contributors`);if (!response.ok) {throw new Error(`HTTP error, status: ${response.status}`);}const allContribs = await response.json();-+// Filter out main contributorsconst mainContribNames = mainContribs.map((contrib) =>contrib.github.split("/").pop(),@@ -72,7 +71,7 @@(contrib: { login: string }) =>!mainContribNames.includes(contrib.login),);-+// Fetch and cache avatar images as Base64const fetchAvatar = async (url: string) => {const res = await fetch(url);@@ -84,15 +83,21 @@reader.readAsDataURL(blob);});};-+ghContribs = await Promise.all(- filteredContribs.map(async (contrib: { login: string; avatar_url: string; html_url: string }) => ({- name: contrib.login,- avatar: await fetchAvatar(contrib.avatar_url),- github: contrib.html_url,- })),+ filteredContribs.map(+ async (contrib: {+ login: string;+ avatar_url: string;+ html_url: string;+ }) => ({+ name: contrib.login,+ avatar: await fetchAvatar(contrib.avatar_url),+ github: contrib.html_url,+ }),+ ),);-+// Cache the data in sessionStoragesessionStorage.setItem("ghContribs", JSON.stringify(ghContribs));} catch (e) {