click on splash quote to refresh quote

This commit is contained in:
2022-12-11 14:08:24 +01:00
parent 2e0bc5852b
commit 9faf1b0051
2 changed files with 16 additions and 2 deletions

View File

@@ -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 = () => {
<SEO />
<div className={styles.hero}>
<div className={styles.heroinside}>
<h1>&bdquo;{splash || "..."}&rdquo;</h1>
<h1
onClick={randomizeSplash}
className={styles.h1clicktorefreshsplash}
>
&bdquo;{splash || "..."}&rdquo;
</h1>
<p>{welcometext}</p>
<br />
<p>Warto naznaczyć, że strona jest w trakcie remontu.</p>