From 9faf1b005102559ba5af0b7ecfd8bac9b774fc77 Mon Sep 17 00:00:00 2001 From: jakubmanczak Date: Sun, 11 Dec 2022 14:08:24 +0100 Subject: [PATCH] click on splash quote to refresh quote --- pages/index.tsx | 12 ++++++++++-- styles/Index.module.scss | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index 56abaa4..39b8406 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -6,10 +6,13 @@ import config from "../data/config.json"; const PageIndex = () => { const [splash, setSplash] = useState(""); - useEffect(() => { + function randomizeSplash(): void { setSplash( config.splashes[Math.floor(Math.random() * config.splashes.length)].body ); + } + useEffect(() => { + randomizeSplash(); }, []); const welcometext: string = "Witamy na witrynie internetowej Gractwa."; // Mamy nadzieję że odnajdziesz czego szukasz, zbłąkana duszo."; return ( @@ -17,7 +20,12 @@ const PageIndex = () => {
-

„{splash || "..."}”

+

+ „{splash || "..."}” +

{welcometext}


Warto naznaczyć, że strona jest w trakcie remontu.

diff --git a/styles/Index.module.scss b/styles/Index.module.scss index 2e7fdc6..49d3162 100644 --- a/styles/Index.module.scss +++ b/styles/Index.module.scss @@ -37,3 +37,9 @@ transform: scale(0.85); } } +.h1clicktorefreshsplash { + user-select: none; + &:hover { + cursor: pointer; + } +}