implement fun facts

This commit is contained in:
Lou 2025-11-25 20:56:32 +01:00
parent a8fa55d5d0
commit 2962784d70
6 changed files with 96 additions and 10 deletions

8
facts/randomizer.js Normal file
View file

@ -0,0 +1,8 @@
import { createRequire } from "module";
const require = createRequire(import.meta.url);
export function getFunFact() {
const facts = require("funfacts.json");
const randomFact = facts[Math.floor(Math.random() * facts.length)];
return randomFact;
}