mirror of https://github.com/VERT-sh/VERT.git
Use consts.ts for URLs, remove google preconnect
This commit is contained in:
parent
e515e67c44
commit
78b72bbc5c
|
@ -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 () {
|
||||
|
|
|
@ -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';
|
|
@ -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!
|
||||
<a
|
||||
class="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...
|
||||
<a
|
||||
class="text-blue-500 font-normal hover:underline"
|
||||
href="https://github.com/not-nullptr/VERT"
|
||||
href={GITHUB_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 contributors
|
||||
try {
|
||||
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 contributors
|
||||
const 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 Base64
|
||||
const 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 sessionStorage
|
||||
sessionStorage.setItem("ghContribs", JSON.stringify(ghContribs));
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in New Issue