diff --git a/typing-app/src/assets/texts/text1.txt b/typing-app/public/texts/text1.txt similarity index 100% rename from typing-app/src/assets/texts/text1.txt rename to typing-app/public/texts/text1.txt diff --git a/typing-app/src/assets/texts/text2.txt b/typing-app/public/texts/text2.txt similarity index 100% rename from typing-app/src/assets/texts/text2.txt rename to typing-app/public/texts/text2.txt diff --git a/typing-app/src/assets/texts/text3.txt b/typing-app/public/texts/text3.txt similarity index 100% rename from typing-app/src/assets/texts/text3.txt rename to typing-app/public/texts/text3.txt diff --git a/typing-app/src/assets/texts/text4.txt b/typing-app/public/texts/text4.txt similarity index 100% rename from typing-app/src/assets/texts/text4.txt rename to typing-app/public/texts/text4.txt diff --git a/typing-app/src/assets/texts/text5.txt b/typing-app/public/texts/text5.txt similarity index 100% rename from typing-app/src/assets/texts/text5.txt rename to typing-app/public/texts/text5.txt diff --git a/typing-app/src/assets/texts/text6.txt b/typing-app/public/texts/text6.txt similarity index 100% rename from typing-app/src/assets/texts/text6.txt rename to typing-app/public/texts/text6.txt diff --git a/typing-app/src/app/game/page.tsx b/typing-app/src/app/game/page.tsx index ecaa917..7577daf 100644 --- a/typing-app/src/app/game/page.tsx +++ b/typing-app/src/app/game/page.tsx @@ -1,10 +1,11 @@ import GamePage from "@/components/pages/Game"; import fs from "fs"; +const filenames = fs.readdirSync("public/texts/"); + export default function Typing() { - const filenames = fs.readdirSync("src/assets/texts/"); const subjectText = fs.readFileSync( - `src/assets/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`, + `public/texts/${filenames[Math.floor(Math.random() * filenames.length)]}`, "utf-8" );