Various adjustments
This commit is contained in:
parent
ec6cb4b355
commit
371171e61d
21 changed files with 30 additions and 52 deletions
|
@ -11,12 +11,12 @@ bun dev
|
|||
|
||||
## Environment variables
|
||||
|
||||
This package uses [`@carbon/icons-react`](https://github.com/carbon-design-system/carbon/tree/main/packages/icons-react), which **installs [a telemetry package which can be disabled](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection):**
|
||||
This website uses [`@carbon/icons-react`](https://github.com/carbon-design-system/carbon/tree/main/packages/icons-react), which **installs [a telemetry package which can be disabled](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection):**
|
||||
|
||||
Set the environment variable IBM_TELEMETRY_DISABLED to true
|
||||
|
||||
|
||||
This package makes use of several online APIs through Netlify in order to deliver the `Infos` that are available on the right side of the website, accessing most of these APIs requires a key (or similar), which can be set through the following environment variables:
|
||||
This website makes use of several online APIs in order to deliver the `Infos` that are available on the right side of the main page, accessing most of these APIs requires a key (or similar), which can be set through the following environment variables:
|
||||
|
||||
- `API_GITHUB`
|
||||
- `API_GITLAB`
|
||||
|
|
|
@ -19,7 +19,5 @@ export const coding_github: Handler = async () => {
|
|||
} : undefined,
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(info)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(info, {status: 200});
|
||||
};
|
||||
|
|
|
@ -15,7 +15,5 @@ export const coding_gitlab: Handler = async () => {
|
|||
date: created_at.substring(0, created_at.indexOf("T")),
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(activity)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(activity, {status: 200});
|
||||
};
|
||||
|
|
|
@ -16,7 +16,5 @@ export const coding_kitsudev: Handler = async () => {
|
|||
date: kitsudev[0].created
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(info)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(info, {status: 200});
|
||||
};
|
||||
|
|
|
@ -87,7 +87,5 @@ export const fediverse_kitsuclub: Handler = async () => {
|
|||
})
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(activity)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(activity, {status: 200});
|
||||
};
|
||||
|
|
|
@ -26,7 +26,5 @@ export const gaming_osu: Handler = async (params) => {
|
|||
},
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(info)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(info, {status: 200});
|
||||
};
|
||||
|
|
|
@ -74,9 +74,7 @@ export const gaming_speedruncom: Handler = async () => {
|
|||
run.time = run.time.substring(1);
|
||||
}
|
||||
|
||||
return new Response(new Blob([JSON.stringify(run)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(run, {status: 200});
|
||||
};
|
||||
|
||||
// https://gist.github.com/vankasteelj/74ab7793133f4b257ea3
|
||||
|
|
|
@ -16,7 +16,5 @@ export const hacking_hackthebox: Handler = async () => {
|
|||
pwn.machine_avatar = `https://www.hackthebox.com${pwn.machine_avatar}`;
|
||||
pwn.date = pwn.date.substring(0, pwn.date.indexOf("T"));
|
||||
|
||||
return new Response(new Blob([JSON.stringify(pwn)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(pwn, {status: 200});
|
||||
};
|
||||
|
|
|
@ -57,7 +57,7 @@ export const japanese_wanikani: Handler = async () => {
|
|||
const toRequest = urlsToRequest.map((url) => new Promise(async (resolve) => {
|
||||
const response = await fetch(url, {headers: {
|
||||
"Authorization": `Bearer ${process.env["API_WANIKANI"]}`,
|
||||
"Content-Type": "application.json",
|
||||
"Content-Type": "application/json",
|
||||
}});
|
||||
resolve(await response.json());
|
||||
}));
|
||||
|
@ -93,7 +93,7 @@ export const japanese_wanikani: Handler = async () => {
|
|||
const subjectIdsAll = subjectIdsLessons.concat(subjectIdsReviews);
|
||||
const subjects = await (await fetch(`https://api.wanikani.com/v2/subjects?ids=${subjectIdsAll.toString()}`, {headers: {
|
||||
"Authorization": `Bearer ${process.env["API_WANIKANI"]}`,
|
||||
"Content-Type": "application.json",
|
||||
"Content-Type": "application/json",
|
||||
}})).json() as {data: Subject[]};
|
||||
|
||||
const lessons = addStuffToLearn(subjectIdsLessons, summary.data.lessons, subjects.data);
|
||||
|
@ -107,7 +107,5 @@ export const japanese_wanikani: Handler = async () => {
|
|||
moreThingsToReviewAt,
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(info)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(info, {status: 200});
|
||||
};
|
||||
|
|
|
@ -63,7 +63,5 @@ export const media_anilist: Handler = async () => {
|
|||
anime.updateDate = anime.updateDate.substring(0, anime.updateDate.indexOf("T"));
|
||||
anime.endDate = anime.endDate.substring(0, anime.endDate.indexOf("T"));
|
||||
|
||||
return new Response(new Blob([JSON.stringify(anime)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(anime, {status: 200});
|
||||
};
|
||||
|
|
|
@ -39,7 +39,5 @@ export const media_lastfm: Handler = async () => {
|
|||
date: lastfm.recenttracks.track[0].date?.uts ?? String(Date.now()),
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(track)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(track, {status: 200});
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ export const website_umami: Handler = async () => {
|
|||
const now = new Date();
|
||||
const response = await fetch(`${api_server}/websites/${website_id}/stats?startAt=${Number(new Date("2025"))}&endAt=${Number(now)}`, {
|
||||
headers: {
|
||||
"Accept": "application.json",
|
||||
"Accept": "application/json",
|
||||
"Authorization": `Bearer ${token?.access_token}`
|
||||
},
|
||||
});
|
||||
|
@ -43,7 +43,5 @@ export const website_umami: Handler = async () => {
|
|||
totaltime: umami.totaltime.value
|
||||
};
|
||||
|
||||
return new Response(new Blob([JSON.stringify(info)], {
|
||||
type: "application/json",
|
||||
}), {status: 200});
|
||||
return Response.json(info, {status: 200});
|
||||
};
|
||||
|
|
|
@ -37,7 +37,6 @@ export default tseslint.config(
|
|||
},
|
||||
{
|
||||
ignores: [
|
||||
".netlify/*",
|
||||
"dist/*",
|
||||
"*.js",
|
||||
"*.cjs",
|
||||
|
|
|
@ -1563,7 +1563,7 @@ video {
|
|||
@font-face {
|
||||
font-family: "LexendDeca";
|
||||
|
||||
src: url("./assets/fonts/LexendDeca-Regular.ttf") format("truetype");
|
||||
src: url("assets/fonts/LexendDeca-Regular.ttf") format("truetype");
|
||||
|
||||
font-weight: normal;
|
||||
|
||||
|
|
2
index.ts
2
index.ts
|
@ -38,7 +38,7 @@ const builds = await Bun.build({
|
|||
});
|
||||
|
||||
const server = Bun.serve({
|
||||
port: 8080,
|
||||
idleTimeout: 30,
|
||||
fetch: async (req) => {
|
||||
const url = new URL(req.url);
|
||||
const parameters = url.searchParams;
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
"scripts": {
|
||||
"dev": "bunx bun css && bun --hot index.ts",
|
||||
"css": "bun tailwindcss -i ./src/App.css -o index.css",
|
||||
"lint": "bunx eslint ."
|
||||
"lint": "bunx eslint .",
|
||||
"start": "bun run index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bachmacintosh/wanikani-api-types": "^1.7.0",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
@font-face {
|
||||
font-family: "LexendDeca";
|
||||
src: url("./assets/fonts/LexendDeca-Regular.ttf") format("truetype");
|
||||
src: url("assets/fonts/LexendDeca-Regular.ttf") format("truetype");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, {useState, useEffect} from "react";
|
||||
|
||||
/** Takes care of getting data regularly */
|
||||
export default function DataHandler<T extends unknown | undefined>(netlifyFunctionName: string, updateEveryXSeconds: number, expectData = true) {
|
||||
export default function DataHandler<T extends unknown | undefined>(apiEndpoint: string, updateEveryXSeconds: number, expectData = true) {
|
||||
const [data, setData]: [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>] = useState();
|
||||
const [error, setError] = useState(false);
|
||||
const [count, setCount] = useState(0);
|
||||
|
@ -9,7 +9,7 @@ export default function DataHandler<T extends unknown | undefined>(netlifyFuncti
|
|||
// Try to get and set data
|
||||
const updateData = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/" + netlifyFunctionName);
|
||||
const response = await fetch("/api/" + apiEndpoint);
|
||||
if (!response.ok) {throw "failed";};
|
||||
setData(expectData ? await response.json() : true);
|
||||
setError(false);
|
||||
|
|
|
@ -28,7 +28,7 @@ export default function Osu(args: {ruleset: Ruleset}) {
|
|||
try {
|
||||
setElements([
|
||||
<div key={`osu-${ruleset}`} className="flex">
|
||||
<img className="m-auto w-16 h-16" alt={`${ruleset} mode logo`} src={`./assets/osu_rulesets/${ruleset}.png`}/>
|
||||
<img className="m-auto w-16 h-16" alt={`${ruleset} mode logo`} src={`/assets/osu_rulesets/${ruleset}.png`}/>
|
||||
<div className="m-auto">
|
||||
<p>Global: <strong>#{data.ranks.global}</strong></p>
|
||||
<p>{data.country}: <strong>#{data.ranks.country}</strong></p>
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function About({
|
|||
const elements = [(
|
||||
<div className="m-4 text-white order-1" key={"about"}>
|
||||
<div className="ml-auto max-w-3xl text-left">
|
||||
<img className="m-4 float-right h-24" src="/brittany.jpg" alt="Flag of Brittany" title="Flag of Brittany"/>
|
||||
<img className="m-4 float-right h-24" src="/assets/brittany.jpg" alt="Flag of Brittany" title="Flag of Brittany"/>
|
||||
<Translatable
|
||||
en={<p>o/ <b>I'm Taevas</b>, a young person from <b><Link link="https://en.wikipedia.org/wiki/Brittany" text="Brittany"/> (western France)</b> who is currently invested in <b>game development.</b> I also do stuff related to web development, networking, and cybersecurity more rarely!</p>}
|
||||
fr={<p>o/ <b>Je m'appelle Taevas</b>, je suis une jeune personne de <b>Bretagne</b> qui s'investit dans le <b>développement de jeux-vidéos.</b> Je fais aussi des trucs qui touchent au développement web, aux réseaux, et plus rarement à la cybersécurité!</p>}
|
||||
|
@ -31,7 +31,7 @@ export default function About({
|
|||
</div>
|
||||
<div className="mr-auto mt-8 max-w-3xl text-right">
|
||||
<a href="https://www.pixiv.net/en/artworks/85330094" target="_blank" rel="noreferrer">
|
||||
<img className="m-4 float-left h-24 w-24" src="/lain.png" alt="A drawing of Lain" title="A drawing of Lain"/>
|
||||
<img className="m-4 float-left h-24 w-24" src="/assets/lain.png" alt="A drawing of Lain" title="A drawing of Lain"/>
|
||||
</a>
|
||||
<Translatable
|
||||
en={<p>I really like Japanese media! I'll pretty much always choose to have some drawing of <b>Lain Iwakura from <Link link="https://en.wikipedia.org/wiki/Serial_Experiments_Lain" text="Serial Experiments Lain"/></b> as my profile picture on the various websites I have an account on, as it is a piece of media I deeply enjoy.</p>}
|
||||
|
|
|
@ -13,7 +13,7 @@ export default function Projects({
|
|||
const elements = [(
|
||||
<div className="inline-block m-4 text-white text-left" key={"projects"}>
|
||||
<div className="border-b-4 pb-4">
|
||||
<a href="https://tttaevas.itch.io/swordventure" target="_blank" rel="noreferrer"><img className="m-4 float-right w-40" src="/swordventure.png" alt="SwordVenture thumbnail"/></a>
|
||||
<a href="https://tttaevas.itch.io/swordventure" target="_blank" rel="noreferrer"><img className="m-4 float-right w-40" src="/assets/swordventure.png" alt="SwordVenture thumbnail"/></a>
|
||||
<Translatable
|
||||
en={<p><b><Link link="https://tttaevas.itch.io/swordventure" text="SwordVenture"/></b> initially was <Link link="https://github.com/RemiL-Nel/Clicker-game" text="a game made by a friend in React which I helped develop,"/> but months after the project ended, I made the choice to <b>recode it from scratch in <Link link="https://godotengine.org/" text="Godot"/></b>, a proper game engine!</p>}
|
||||
fr={<p><b><Link link="https://tttaevas.itch.io/swordventure" text="SwordVenture"/></b> était à la base <Link link="https://github.com/RemiL-Nel/Clicker-game" text="un jeu fait par un ami en React auquel j'ai contribué côté développement,"/> mais quelques mois plus tard, j'ai fait le choix de <b>le refaire en entier dans <Link link="https://godotengine.org/" text="Godot"/></b>, qui est un véritable moteur de jeu vidéo !</p>}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue