{memberCount || "∞"}
+{memberCount || "invis placeholder"}
członków na discordzie
diff --git a/components/IndexGallery/IndexGallery.module.scss b/components/IndexGallery/IndexGallery.module.scss
index 1b6f1c5..bb70a62 100644
--- a/components/IndexGallery/IndexGallery.module.scss
+++ b/components/IndexGallery/IndexGallery.module.scss
@@ -15,11 +15,19 @@
margin: 0;
padding: 0;
max-height: var(--mheight);
+ animation-name: goIn;
+ animation-duration: 350ms;
@media screen and (max-width: 800px) {
text-decoration: none;
max-height: none;
text-align: center;
}
+ @keyframes goIn {
+ from {
+ opacity: 0;
+ transform: translate(0, 8px);
+ }
+ }
img {
max-height: var(--mheight);
border-radius: 8px;
diff --git a/components/ProfileCard/ProfileCard.module.scss b/components/ProfileCard/ProfileCard.module.scss
index 3be1bef..78d0d3f 100644
--- a/components/ProfileCard/ProfileCard.module.scss
+++ b/components/ProfileCard/ProfileCard.module.scss
@@ -3,6 +3,14 @@
background: var(--black1);
border-radius: 8px;
box-shadow: var(--shadow0);
+ animation-name: goIn;
+ animation-duration: 350ms;
+ @keyframes goIn {
+ from {
+ opacity: 0;
+ transform: translate(0, 16px);
+ }
+ }
article {
display: flex;
flex-direction: row;
diff --git a/pages/index.tsx b/pages/index.tsx
index 4074caa..7415285 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -8,6 +8,11 @@ import { IndexGallery } from "../components/IndexGallery/IndexGallery";
const PageIndex = () => {
const [splash, setSplash] = useState("");
const [memberCount, setMemberCount] = useState("");
+ const [daysOfExistence, setDaysOfExistence] = useState("");
+ const [sentMessages, setSentMessages] = useState("");
+ const [welcomeText, setWelcomeText] = useState(
+ "Witamy na witrynie internetowej Gractwa."
+ );
function randomizeSplash(): void {
fetch("https://gractwo.pl/api/v1/splash")
.then((res) => {
@@ -17,6 +22,8 @@ const PageIndex = () => {
setSplash(data.Splash);
})
.catch((err) => {
+ setSplash("nie ma tu co zabezpieczać");
+ setWelcomeText("splashtexty spadły z rowerka!");
console.log(err);
});
}
@@ -30,10 +37,34 @@ const PageIndex = () => {
setMemberCount(data);
})
.catch((err) => {
+ setMemberCount("∞");
console.log(err);
});
+ setDaysOfExistence(
+ Math.floor(
+ (Date.now() - new Date("2020-07-06").getTime()) / 86400000
+ ).toString()
+ );
+ setSentMessages("dużo");
}, []);
- const welcometext: string = "Witamy na witrynie internetowej Gractwa."; // Mamy nadzieję że odnajdziesz czego szukasz, zbłąkana duszo.";
+ useEffect(() => {
+ if (!memberCount) return;
+ if (!daysOfExistence) return;
+ if (!sentMessages) return;
+ if (document) {
+ document
+ .querySelectorAll(".statCont > article > h1")
+ .forEach((el: Element) => {
+ el.classList.add(styles.doneLoading);
+ });
+ }
+ }, [memberCount, daysOfExistence, sentMessages]);
+ useEffect(() => {
+ if (!splash) return;
+ if (document) {
+ document.querySelector(".splashtext")?.classList.add(styles.doneLoading);
+ }
+ }, [splash]);
return (
<>
{welcometext}
+{welcomeText || "Witamy na witrynie internetowej Gractwa."}
członków na discordzie
dni istnienia gractwa
wysłanych wiadomości
Sit tight.
Tyle wiemy:
diff --git a/pages/ja/ustawienia.tsx b/pages/ja/ustawienia.tsx index bdc01eb..6f66d68 100644 --- a/pages/ja/ustawienia.tsx +++ b/pages/ja/ustawienia.tsx @@ -14,7 +14,7 @@ const PageMeSettings = () => {Tyle wiemy.
diff --git a/pages/o-gractwie.tsx b/pages/o-gractwie.tsx index 1d4119a..7bbdb37 100644 --- a/pages/o-gractwie.tsx +++ b/pages/o-gractwie.tsx @@ -92,7 +92,7 @@ const PageInfo = () => {