diff --git a/components/About.tsx b/components/About.tsx index 604d3f7..d10e973 100644 --- a/components/About.tsx +++ b/components/About.tsx @@ -8,6 +8,8 @@ import { Button } from '@mui/material' // Icons import { FcMoneyTransfer } from 'react-icons/fc' + +// Utils import { siteInfo } from '@/utils/Assets' diff --git a/components/Game.tsx b/components/Game.tsx index 1a74469..e86db35 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react' +import React, { useContext, useEffect, useRef, useState } from 'react' // NextJs import { useRouter } from 'next/router'; @@ -7,11 +7,13 @@ import { useRouter } from 'next/router'; import { Button, FormControl, InputLabel, MenuItem, Select, SelectChangeEvent } from '@mui/material'; // Icons -import { BsCursorText } from 'react-icons/bs'; import { CiCircleRemove } from 'react-icons/ci'; + +// Utils import FormatTime from '@/utils/Format'; import { userContext } from '@/utils/UserProvider'; + type GameProps = { text: string, } diff --git a/components/Home.tsx b/components/Home.tsx index 1606bc5..483c482 100644 --- a/components/Home.tsx +++ b/components/Home.tsx @@ -28,9 +28,15 @@ export default function Home(){ const [loading, setLoading] = useState(true); useEffect(() => { - if(user && textData?.length > 0){ + if(user && textData){ try{ - setText(textData[Math.floor(Math.random() * textData.length)]); + if(user.time > 180){ + setText(textData.lvl3[Math.floor(Math.random() * textData.lvl3.length)]); + }else if(user.time > 60 && user.time != 180){ + setText(textData.lvl2[Math.floor(Math.random() * textData.lvl2.length)]); + }else{ + setText(textData.lvl1[Math.floor(Math.random() * textData.lvl1.length)]); + } }catch(err: any){ setError(err || "Something went wrong!"); console.log(err); diff --git a/components/Layout.tsx b/components/Layout.tsx index 81dd25c..e2943a8 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -1,22 +1,28 @@ -import React, { createContext } from 'react' +import React from 'react' // NextJs import Head from 'next/head'; +import Link from 'next/link'; // Fonts import { Inter } from "next/font/google"; const inter = Inter({ subsets: ["latin"] }); // Themes -import { useState, useEffect } from 'react' -import { FiMoon, FiSun } from 'react-icons/fi'; import { useTheme } from 'next-themes'; -import { Button, FormControlLabel, Switch, styled } from '@mui/material'; + +// Mui +import { FormControlLabel, Switch, styled } from '@mui/material'; + +// Icons import { IoIosArrowDown } from 'react-icons/io'; import { FcMoneyTransfer } from 'react-icons/fc'; -import Link from 'next/link'; + + +// Utils import { siteInfo } from '@/utils/Assets'; + type LayoutProps = { children: React.ReactNode, title?: string, @@ -30,7 +36,7 @@ export default function Layout({ children, title, description, keywords, image } const { systemTheme, theme, setTheme } = useTheme(); const currentTheme = theme === 'system' ? systemTheme : theme; - + // Thme Switch const MaterialUISwitch = styled(Switch)(({ theme }) => ({ width: 62, height: 34, diff --git a/pages/index.tsx b/pages/index.tsx index 22f4bc7..37630de 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,11 +1,9 @@ -// NextJs -import Image from "next/image"; +import React from "react"; // Components import Home from "@/components/Home"; - export default function Main(){ return diff --git a/utils/Assets.ts b/utils/Assets.ts index 8a7a3c4..fb4ca97 100644 --- a/utils/Assets.ts +++ b/utils/Assets.ts @@ -6,28 +6,54 @@ export const siteInfo = { url: "https://xvpc.github.io/typer", donationUrl: "https://paypal.me/xvp131" } -export const textData = -[ - "The rusty gears of the forgotten clock tower creaked awake, their ancient melody echoing through the deserted streets below. A lone raven perched on the weathered face, its beady eyes reflecting the fading light of a forgotten age.", - "Beneath the shimmering surface of the moonlit lake, a world of secrets unfolded. Luminescent algae painted the water in shades of emerald and sapphire, while schools of silver fish danced in the ethereal glow.", - "The worn leather satchel contained a map unlike any other. Its surface was etched with swirling constellations and cryptic symbols, promising a journey beyond the confines of the familiar world.", - "The whimsical teacup floated precariously on the invisible thread, its porcelain walls adorned with dancing butterflies and swirling flowers. A wisp of steam curled from its rim, carrying the sweet aroma of forgotten memories.", - "The cobblestone streets whispered tales of long-forgotten times. Their uneven edges, worn smooth by the tread of countless feet, held the echoes of laughter, sorrow, and the relentless march of history.", - "Nestled within the heart of the ancient library, a forgotten tome lay hidden amongst countless leather-bound companions. Its pages, yellowed with age, whispered stories of forgotten civilizations and fantastical creatures.", - "The melody of the wind chimes danced on the summer breeze, their crystalline notes echoing through the vibrant garden. Butterflies flitted amongst blooming flowers, their wings a kaleidoscope of colors against the backdrop of emerald green leaves.", - "As the first rays of dawn painted the horizon in hues of pink and orange, a lone figure emerged from the mist. Their weathered face, etched with the lines of time, held a wisdom born from countless journeys.", - "The abandoned train station stood as a silent testament to a bygone era. Its grand facade, once bustling with life, now echoed with the emptiness of forgotten dreams. Cobwebs draped the dusty windows, and the platform lay overgrown with weeds.", - "The aroma of freshly baked bread wafted from the small bakery nestled on the corner street. Golden loaves sat cooling on display, their crusts glistening with an irresistible sheen. The air hung heavy with the sweet scent of warm yeast and caramelized sugar.", - "The crackling fireplace cast a warm glow on the cozy living room, its flames dancing merrily in the hearth. A worn rug lay spread before it, inviting one to sink in and lose themselves in the warmth and comfort of the moment.", - "The old rocking chair creaked gently on the porch, its rhythmic sway a comforting lullaby against the backdrop of the chirping crickets and the gentle hum of the summer night.", - "The worn leather journal lay open on the antique writing desk, its pages filled with faded ink and delicate script. Each entry held a fragment of a life lived, a story waiting to be rediscovered.", - "The old lighthouse stood sentinel on the rocky cliff, its weathered stone walls bearing the scars of countless storms. Its powerful beam sliced through the darkness, guiding lost ships through treacherous waters.", - "The bustling marketplace overflowed with sights and sounds. Vendors hawked their wares, their voices rising above the cacophony of the crowd. Colorful fabrics, exotic spices, and handcrafted trinkets filled the air with a vibrant energy.", - "The ancient oak tree stood tall and proud, its branches reaching towards the sky like gnarled fingers. Beneath its shade, a weathered wooden bench offered a respite from the midday sun. The air hummed with the gentle buzz of insects and the rustling of leaves.", - "The abandoned castle loomed on the hilltop, its silhouette stark against the twilight sky. Its crumbling towers and overgrown courtyard whispered tales of forgotten battles and royal intrigue.", - "The dusty attic held a treasure trove of forgotten memories. Faded photographs, dusty trinkets, and antique furniture spoke of a life once lived, each object a tangible link to the past.", - "The masquerade ball was a whirlwind of extravagance. Guests adorned in elaborate costumes mingled amidst the revelry, their laughter echoing through the grand ballroom. Crystal chandeliers cast a shimmering light on the scene, creating an atmosphere of magic and mystery.", - "The winding staircase spiraled upwards, its steps worn smooth by the passage of time. Cobwebs draped the dusty banister, and the air hung heavy with the silence of forgotten memories.", - "The bustling city square was a kaleidoscope of activity. Street performers entertained the crowds, their music and laughter filling the air. Vendors hawked their wares, and the aroma of diverse cuisines mingled in the air, creating a sensory feast.", - "The old library held a vast collection of knowledge, its shelves overflowing with leather-bound volumes. The scent of aged paper and ink filled the air, a testament to the countless stories and ideas held within its walls." -] \ No newline at end of file +export const textData = { + lvl1: [ + "The rusty gears of the forgotten clock tower creaked awake, their ancient melody echoing through the deserted streets below. A lone raven perched on the weathered face, its beady eyes reflecting the fading light of a forgotten age.", + "Beneath the shimmering surface of the moonlit lake, a world of secrets unfolded. Luminescent algae painted the water in shades of emerald and sapphire, while schools of silver fish danced in the ethereal glow.", + "The worn leather satchel contained a map unlike any other. Its surface was etched with swirling constellations and cryptic symbols, promising a journey beyond the confines of the familiar world.", + "The whimsical teacup floated precariously on the invisible thread, its porcelain walls adorned with dancing butterflies and swirling flowers. A wisp of steam curled from its rim, carrying the sweet aroma of forgotten memories.", + "The cobblestone streets whispered tales of long-forgotten times. Their uneven edges, worn smooth by the tread of countless feet, held the echoes of laughter, sorrow, and the relentless march of history.", + "Nestled within the heart of the ancient library, a forgotten tome lay hidden amongst countless leather-bound companions. Its pages, yellowed with age, whispered stories of forgotten civilizations and fantastical creatures.", + "The melody of the wind chimes danced on the summer breeze, their crystalline notes echoing through the vibrant garden. Butterflies flitted amongst blooming flowers, their wings a kaleidoscope of colors against the backdrop of emerald green leaves.", + "As the first rays of dawn painted the horizon in hues of pink and orange, a lone figure emerged from the mist. Their weathered face, etched with the lines of time, held a wisdom born from countless journeys.", + "The abandoned train station stood as a silent testament to a bygone era. Its grand facade, once bustling with life, now echoed with the emptiness of forgotten dreams. Cobwebs draped the dusty windows, and the platform lay overgrown with weeds.", + "The aroma of freshly baked bread wafted from the small bakery nestled on the corner street. Golden loaves sat cooling on display, their crusts glistening with an irresistible sheen. The air hung heavy with the sweet scent of warm yeast and caramelized sugar.", + "The crackling fireplace cast a warm glow on the cozy living room, its flames dancing merrily in the hearth. A worn rug lay spread before it, inviting one to sink in and lose themselves in the warmth and comfort of the moment.", + "The old rocking chair creaked gently on the porch, its rhythmic sway a comforting lullaby against the backdrop of the chirping crickets and the gentle hum of the summer night.", + "The worn leather journal lay open on the antique writing desk, its pages filled with faded ink and delicate script. Each entry held a fragment of a life lived, a story waiting to be rediscovered.", + "The old lighthouse stood sentinel on the rocky cliff, its weathered stone walls bearing the scars of countless storms. Its powerful beam sliced through the darkness, guiding lost ships through treacherous waters.", + "The bustling marketplace overflowed with sights and sounds. Vendors hawked their wares, their voices rising above the cacophony of the crowd. Colorful fabrics, exotic spices, and handcrafted trinkets filled the air with a vibrant energy.", + "The ancient oak tree stood tall and proud, its branches reaching towards the sky like gnarled fingers. Beneath its shade, a weathered wooden bench offered a respite from the midday sun. The air hummed with the gentle buzz of insects and the rustling of leaves.", + "The abandoned castle loomed on the hilltop, its silhouette stark against the twilight sky. Its crumbling towers and overgrown courtyard whispered tales of forgotten battles and royal intrigue.", + "The dusty attic held a treasure trove of forgotten memories. Faded photographs, dusty trinkets, and antique furniture spoke of a life once lived, each object a tangible link to the past.", + "The masquerade ball was a whirlwind of extravagance. Guests adorned in elaborate costumes mingled amidst the revelry, their laughter echoing through the grand ballroom. Crystal chandeliers cast a shimmering light on the scene, creating an atmosphere of magic and mystery.", + "The winding staircase spiraled upwards, its steps worn smooth by the passage of time. Cobwebs draped the dusty banister, and the air hung heavy with the silence of forgotten memories.", + "The bustling city square was a kaleidoscope of activity. Street performers entertained the crowds, their music and laughter filling the air. Vendors hawked their wares, and the aroma of diverse cuisines mingled in the air, creating a sensory feast.", + "The old library held a vast collection of knowledge, its shelves overflowing with leather-bound volumes. The scent of aged paper and ink filled the air, a testament to the countless stories and ideas held within its walls." + ], + lvl2: [ + "The flickering gaslight cast an eerie glow on the cobblestone streets, its shadows dancing across the damp pavement like phantoms from a forgotten age. A lone figure, shrouded in a tattered cloak, hurried down the deserted alleyway, their footsteps echoing in the stillness of the night. In the distance, the mournful wail of a siren pierced the silence, adding to the air of mystery and intrigue.", + "The weathered compass, its brass casing worn smooth by countless journeys, held the promise of adventure. Its needle spun restlessly, its tip pointing towards an unknown destination. A tattered map, its edges frayed and its paper brittle with age, lay unfolded beside it. Marked with cryptic symbols and faded ink, it hinted at hidden treasures and perilous paths, beckoning the intrepid explorer to embark on a voyage into the unknown.", + "The grand clock tower, a towering testament to a bygone era, loomed over the bustling city square. Its intricate gears and delicate mechanisms whirred silently, their relentless movement marking the passage of time. Every chime of the bell resonated through the cobblestone streets, a reminder of the fleeting nature of existence and the relentless march of history.", + "Nestled within the heart of the ancient library, a forgotten tome lay hidden amongst countless leather-bound companions. Its cover, adorned with faded symbols and intricate carvings, hinted at the secrets held within. The musty scent of aged paper filled the air, a testament to the countless stories and forgotten knowledge held captive within its pages. As one carefully cracked open the cover, a sense of anticipation hung heavy in the air, promising a journey into a world lost to time.", + "The winding staircase spiraled upwards, its steps worn smooth by the passage of countless feet. Cobwebs draped the dusty banister, and the air hung heavy with the silence of forgotten memories. Each creak of the aged wood echoed through the vast, empty hall, adding to the unsettling atmosphere. As one ascended, a sense of anticipation grew, fueled by the unknown that lay beyond the next turn.", + "The bustling marketplace overflowed with sights and sounds. Vendors hawked their wares in a cacophony of languages, their voices rising above the vibrant energy of the crowd. Colorful fabrics, exotic spices, and handcrafted trinkets filled the air with a mesmerizing sensory experience. Acrobats defied gravity with breathtaking displays of skill, while musicians filled the air with lively melodies. The sheer variety of sights, smells, and sounds created a captivating atmosphere, a testament to the diverse tapestry of human culture.", + "The ancient oak tree stood tall and proud, its branches reaching towards the sky like gnarled fingers. Beneath its shade, a weathered wooden bench offered a respite from the midday sun. The air hummed with the gentle buzz of insects and the rustling of leaves, creating a symphony of nature's serenity. As one sat beneath the ancient boughs, a sense of peace and tranquility washed over them, a welcome escape from the hustle and bustle of the world below.", + "The abandoned castle loomed on the hilltop, its silhouette stark against the twilight sky. Its crumbling towers and overgrown courtyard whispered tales of forgotten battles and royal intrigue. The wind howled through the broken windows, carrying with it an air of melancholy and abandonment. As one ventured through the decaying halls, their footsteps echoing in the emptiness, a sense of awe and wonder intertwined with a touch of trepidation filled the air.", + "The dusty attic held a treasure trove of forgotten memories. Faded photographs, their edges softened by time, captured moments of joy, sorrow, and everything in between. Each image held a story waiting to be retold, a glimpse into a life once lived. Antique furniture, adorned with intricate carvings and faded upholstery, stood silent witness to the passage of time. As one explored the forgotten corners, a sense of nostalgia and curiosity filled the air, a yearning to connect with the past and the stories it held.", + "The masquerade ball was a whirlwind of extravagance. Guests adorned in elaborate costumes, their faces hidden behind ornate masks, mingled amidst the revelry. Crystal chandeliers cast a shimmering light on the scene, creating an atmosphere of magic and mystery. The air crackled with anticipation, fueled by the anonymity and the promise of hidden identities. Laughter and conversation filled the grand ballroom, punctuated by the lively music of the orchestra. As one waltzed amidst the throng, a sense of excitement and intrigue hung heavy in the air.", + ], + lvl3: [ + "Beneath the emerald canopy of the ancient forest, where sunlight filtered through leaves like stained glass, a winding path meandered, beckoning adventurous souls to explore its hidden secrets. Lush ferns unfurled their delicate fronds, and wildflowers adorned the path in vibrant hues, their sweet perfume carried on the gentle breeze. In the distance, the cascading melody of a hidden waterfall echoed through the silent trees, promising a haven of tranquility amidst the verdant embrace of nature.", + "Nestled amidst the bustling city streets, a quaint bookstore stood as a refuge for weary minds. Its shelves, overflowing with leather-bound volumes and worn paperbacks, whispered tales of adventure, romance, and historical intrigue. The scent of aged paper mingled with the aroma of freshly brewed coffee, creating an atmosphere of warmth and intellectual stimulation. As sunlight streamed through stained-glass windows, casting colorful patterns on the worn floorboards, readers lost themselves in the pages, transported to faraway lands and captivating worlds.", + "The weathered lighthouse, perched atop a windswept cliff, stood sentinel against the relentless waves. Its powerful beacon, a beacon of hope for lost sailors, sliced through the evening darkness, guiding weary vessels towards safe harbor. The salty spray of the ocean clung to the weathered stone, a constant reminder of the power and unpredictability of nature. Gulls circled overhead, their cries echoing across the vast expanse of the sea, and the rhythmic crash of waves against the rocks formed a lullaby that soothed the soul.", + "Beneath the cloak of a star-studded night sky, a lone wolf serenaded the moon, its mournful howl echoing through the silent valley. The wind, a gentle whisper through the tall pines, carried the melody, weaving a tapestry of solitude and freedom. In the distance, the flickering flames of a distant campfire cast an orange glow, a beacon of warmth and companionship in the vast wilderness.", + "The dusty attic, a treasure trove of forgotten memories, held remnants of a life lived to the fullest. Faded photographs, nestled in worn leather frames, whispered stories of laughter and love, of adventures embarked upon and dreams chased. A chipped china teacup, nestled amongst cobwebs, spoke of tea parties held and conversations shared. A well-worn leather suitcase, its worn latches hinting at journeys undertaken, stood silent, a testament to a life well-traveled.", + "The bustling marketplace, a kaleidoscope of sights and sounds, pulsated with the rhythm of daily life. Merchants hawked their wares, their voices rising in a cacophony of calls. Colorful fabrics flowed in the breeze, their intricate patterns catching the sunlight. The aroma of exotic spices mingled with the scent of freshly baked bread, creating a sensory experience unlike any other. As crowds weaved through the labyrinthine alleys, the energy of the marketplace was palpable, a testament to the vibrancy of human interaction.", + "The abandoned train station, a silent sentinel of a bygone era, stood shrouded in an air of mystery. Moss crept up the weathered brick walls, and paint peeled from the fading advertisements. Inside, the grand hall echoed with an unsettling emptiness, the once bustling platform now desolate. A lone ray of sunlight streamed through the dusty skylight, illuminating a single fallen ticket, a poignant reminder of journeys past and destinations left unfulfilled.", + "The ancient library, a repository of knowledge spanning centuries, held the whispers of the past within its towering walls. Row upon row of leather-bound volumes lined the shelves, their spines adorned with faded gold lettering. The air, thick with the scent of aged paper and leather, hung heavy with the weight of countless stories untold. As sunlight filtered through stained-glass windows, casting a warm glow upon the worn wooden desks, the library offered a sanctuary for the curious mind, a place where knowledge whispered secrets and history came alive.", + "The bustling city streets, a concrete jungle teeming with life, pulsed with a frenetic energy. Towering skyscrapers scraped the clouds, their reflective glass windows casting long shadows across the crowded sidewalks. A yellow taxi, its horn blaring, darted through traffic, weaving through a sea of pedestrians. The constant hum of car engines and the cacophony of human voices formed a symphony of urban life, a testament to the relentless pace of the modern world.", + "The tranquil meadow, bathed in the golden hues of a setting sun, offered a haven of peace and serenity. Gentle wildflowers swayed in the breeze, their vibrant colors creating a patchwork quilt across the rolling landscape. In the distance, a meandering stream gurgled its way through the meadow, its clear waters reflecting the fiery colors of the sky. Butterflies flitted amongst the flowers, their delicate wings adding a touch of magic to the scene, and the chirping of crickets filled" + ], + +}