"use client";
import React, { useState } from "react";
import { useTranslations, useLocale } from "next-intl";
import { Header } from "@/components/header";
import { SiVk, SiTelegram, SiPostgresql, SiReact, SiGo, SiHtml5, SiMaildotru, SiGmail, SiTiktok, SiGithub } from "react-icons/si";
import Link from "next/link";
import Image from "next/image";
import { TriangleAlert } from "lucide-react";
import ProjectDialog from "@/components/projectDialog";
import { skillsList } from "@/lib/skillsList";
import projectsData from "@/lib/projects.json";
export default function Main() {
const [isHovered, setIsHovered] = useState(false);
const t = useTranslations("main");
const locale = useLocale();
const handleToggleLanguage = () => {
const nextLocale = locale === "en" ? "ru" : "en";
document.cookie = `locale=${nextLocale}; path=/; max-age=31536000`;
window.location.reload();
};
const timeline = [
{
era: t("skills.timeline.0.era"),
text: (
{t("skills.timeline.0.text")}
),
icon: ,
},
{
era: t("skills.timeline.1.era"),
text: ({t("skills.timeline.1.text")}
),
icon: ,
},
{
era: t("skills.timeline.2.era"),
text: ({t("skills.timeline.2.text")}
),
icon: ,
},
{
era: t("skills.timeline.3.era"),
text: ({t("skills.timeline.3.text")}
),
icon: ,
},
];
const contacts = [
{"icon": , "name": t("contact.contacts.0.name"), "username": "@rezcjikov", "url": "https://t.me/rezcjikov/"},
{"icon": , "name": t("contact.contacts.1.name"), "username": "rezcjikov@mail.ru", "url": "mailto:rezcjikov@mail.ru"},
{"icon": , "name": t("contact.contacts.2.name"), "username": "rezcjikov@gmail.com", "url": "mailto:rezcjikov@gmail.com"},
{"icon": , "name": t("contact.contacts.3.name"), "username": "@rezcjikov", "url": "https://vk.com/rezcjikov/"},
{"icon": , "name": t("contact.contacts.4.name"), "username": "@gattowolfe", "url": "https://tiktok.com/@gattowolfe/"},
{"icon": , "name": t("contact.contacts.5.name"), "username": "@dusiburg", "url": "https://github.com/dusiburg/"},
]
const languages = [
{
flag: "/images/flags/ru.png",
name: t("notOnlyCoding.languages.0.name"),
level: t("notOnlyCoding.languages.0.level"),
text: t("notOnlyCoding.languages.0.text")
},
{
flag: "/images/flags/uk.png",
name: t("notOnlyCoding.languages.1.name"),
level: t("notOnlyCoding.languages.1.level"),
text: t("notOnlyCoding.languages.1.text")
},
{
flag: "/images/flags/it.png",
name: t("notOnlyCoding.languages.2.name"),
level: t("notOnlyCoding.languages.2.level"),
text: t("notOnlyCoding.languages.2.text")
},
{
flag: "/images/flags/fi.png",
name: t("notOnlyCoding.languages.3.name"),
level: t("notOnlyCoding.languages.3.level"),
text: t("notOnlyCoding.languages.3.text")
}
];
const projects = projectsData.map(p => ({
...p,
logoAlt: t(p.logoAlt),
title: t(p.title),
description: t(p.description),
text: t(p.text)
}));
return (
<>
{t("whoami.title")}
{t("whoami.text")}
{t("changeLanguage").split("").map((ch, i) => (
{ch === " " ? "\u00A0" : ch}
))}
{locale == "it" && (
Cari italiani, mi scuso, ma il sito non รจ completamente tradotto in italiano. Sarebbe meglio usare la versione in inglese.
)}
{t("skills.title")}
setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
style={{ animationPlayState: isHovered ? "paused" : "running" }}
>
{[...skillsList.slice(0, 13), ...skillsList.slice(0, 13)].map((skill, index) => (
{skill.icon}
{skill.name}
))}
{timeline.map((element, index) => (
{element.icon}
{element.era}
{element.text}
))}
{t("projects.title")}
{t("projects.intro")}
{projects.map((project, index) => (
{project.title}
{project.url && project.hostname && (
{project.hostname}
)}
{project.description}
))}
{t("notOnlyCoding.title")}
{t("notOnlyCoding.subtitle")}
{languages.map((language, index) => (
{language.name}
{language.level}
{language.text}
))}
{t("notOnlyCoding.outro")}
>
);
}