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" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.webp" />
|
<link rel="icon" href="%sveltekit.assets%/favicon.webp" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<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%
|
%sveltekit.head%
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(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">
|
<script lang="ts">
|
||||||
import Panel from "$lib/components/visual/Panel.svelte";
|
import Panel from "$lib/components/visual/Panel.svelte";
|
||||||
import { HeartHandshakeIcon } from "lucide-svelte";
|
import { HeartHandshakeIcon } from "lucide-svelte";
|
||||||
|
import { GITHUB_URL } from "$lib/consts";
|
||||||
|
|
||||||
let { mainContribs, ghContribs } = $props();
|
let { mainContribs, ghContribs } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
Big thanks to all these people for helping out!
|
Big thanks to all these people for helping out!
|
||||||
<a
|
<a
|
||||||
class="text-blue-500 font-normal hover:underline"
|
class="text-blue-500 font-normal hover:underline"
|
||||||
href="https://github.com/not-nullptr/VERT"
|
href={GITHUB_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
Seems like no one has contributed yet...
|
Seems like no one has contributed yet...
|
||||||
<a
|
<a
|
||||||
class="text-blue-500 font-normal hover:underline"
|
class="text-blue-500 font-normal hover:underline"
|
||||||
href="https://github.com/not-nullptr/VERT"
|
href={GITHUB_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Panel from "$lib/components/visual/Panel.svelte";
|
import Panel from "$lib/components/visual/Panel.svelte";
|
||||||
|
import { DISCORD_URL, GITHUB_URL } from "$lib/consts";
|
||||||
import { GithubIcon, LinkIcon, MessageCircleMoreIcon } from "lucide-svelte";
|
import { GithubIcon, LinkIcon, MessageCircleMoreIcon } from "lucide-svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
<div class="flex gap-3">
|
<div class="flex gap-3">
|
||||||
<a
|
<a
|
||||||
href="https://discord.gg/kqevGxYPak"
|
href={DISCORD_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
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"
|
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
|
Discord
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/not-nullptr/VERT"
|
href={GITHUB_URL}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
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"
|
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 { quintOut } from "svelte/easing";
|
||||||
import "../app.scss";
|
import "../app.scss";
|
||||||
import { writable } from "svelte/store";
|
import { writable } from "svelte/store";
|
||||||
|
import { DISCORD_URL, GITHUB_URL } from "$lib/consts";
|
||||||
let { children } = $props();
|
let { children } = $props();
|
||||||
|
|
||||||
let shouldGoBack = writable(false);
|
let shouldGoBack = writable(false);
|
||||||
|
@ -225,8 +226,8 @@
|
||||||
class="w-full h-full"
|
class="w-full h-full"
|
||||||
items={{
|
items={{
|
||||||
//"Privacy policy": "#",
|
//"Privacy policy": "#",
|
||||||
"Source code": "https://github.com/not-nullptr/VERT",
|
"Source code": GITHUB_URL,
|
||||||
"Discord server": "https://discord.gg/kqevGxYPak",
|
"Discord server": DISCORD_URL,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import avatarNullptr from "$lib/assets/avatars/nullptr.jpg";
|
import avatarNullptr from "$lib/assets/avatars/nullptr.jpg";
|
||||||
import avatarRealmy from "$lib/assets/avatars/realmy.jpg";
|
import avatarRealmy from "$lib/assets/avatars/realmy.jpg";
|
||||||
import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";
|
import avatarJovannMC from "$lib/assets/avatars/jovannmc.jpg";
|
||||||
|
import { GITHUB_API_URL } from "$lib/consts";
|
||||||
|
|
||||||
interface Donator {
|
interface Donator {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -53,17 +54,15 @@
|
||||||
console.log("Loaded GitHub contributors from cache");
|
console.log("Loaded GitHub contributors from cache");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch GitHub contributors
|
// Fetch GitHub contributors
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(`${GITHUB_API_URL}/contributors`);
|
||||||
"https://api.github.com/repos/not-nullptr/VERT/contributors",
|
|
||||||
);
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error, status: ${response.status}`);
|
throw new Error(`HTTP error, status: ${response.status}`);
|
||||||
}
|
}
|
||||||
const allContribs = await response.json();
|
const allContribs = await response.json();
|
||||||
|
|
||||||
// Filter out main contributors
|
// Filter out main contributors
|
||||||
const mainContribNames = mainContribs.map((contrib) =>
|
const mainContribNames = mainContribs.map((contrib) =>
|
||||||
contrib.github.split("/").pop(),
|
contrib.github.split("/").pop(),
|
||||||
|
@ -72,7 +71,7 @@
|
||||||
(contrib: { login: string }) =>
|
(contrib: { login: string }) =>
|
||||||
!mainContribNames.includes(contrib.login),
|
!mainContribNames.includes(contrib.login),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fetch and cache avatar images as Base64
|
// Fetch and cache avatar images as Base64
|
||||||
const fetchAvatar = async (url: string) => {
|
const fetchAvatar = async (url: string) => {
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
|
@ -84,15 +83,21 @@
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
ghContribs = await Promise.all(
|
ghContribs = await Promise.all(
|
||||||
filteredContribs.map(async (contrib: { login: string; avatar_url: string; html_url: string }) => ({
|
filteredContribs.map(
|
||||||
name: contrib.login,
|
async (contrib: {
|
||||||
avatar: await fetchAvatar(contrib.avatar_url),
|
login: string;
|
||||||
github: contrib.html_url,
|
avatar_url: string;
|
||||||
})),
|
html_url: string;
|
||||||
|
}) => ({
|
||||||
|
name: contrib.login,
|
||||||
|
avatar: await fetchAvatar(contrib.avatar_url),
|
||||||
|
github: contrib.html_url,
|
||||||
|
}),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Cache the data in sessionStorage
|
// Cache the data in sessionStorage
|
||||||
sessionStorage.setItem("ghContribs", JSON.stringify(ghContribs));
|
sessionStorage.setItem("ghContribs", JSON.stringify(ghContribs));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue