"use client";
import React, { useState } from "react";
import { useTranslations, useLocale } from "next-intl";
import { Header } from "@/components/header";
import { SiVk, SiTelegram, SiNextdotjs, SiTailwindcss, SiPostgresql, SiSupabase, SiReact, SiDocker, SiLinux, SiGo, SiPython, SiHtml5, SiJavascript, SiPhp, SiMaildotru, SiGmail, SiFacebook, SiTiktok, SiPrisma, SiMapbox } from "react-icons/si";
import Link from "next/link";
import Image from "next/image";
import { TriangleAlert } from "lucide-react";
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 skillsRunline = [
{ name: "Next.js", icon: },
{ name: "Tailwind", icon: },
{ name: "Prisma", icon: },
{ name: "Postgres", icon: },
{ name: "Supabase", icon: },
{ name: "React", icon: },
{ name: "Docker", icon: },
{ name: "Linux", icon: },
{ name: "HTML", icon: },
{ name: "JS", icon: },
{ name: "Go", icon: },
{ name: "PHP", icon: },
{ name: "Python", icon: },
{ name: "Mapbox", 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/"},
]
const languages = [
{
flag: "/img/flags/ru.png",
name: t("notOnlyCoding.languages.0.name"),
level: t("notOnlyCoding.languages.0.level"),
text: t("notOnlyCoding.languages.0.text")
},
{
flag: "/img/flags/en.png",
name: t("notOnlyCoding.languages.1.name"),
level: t("notOnlyCoding.languages.1.level"),
text: t("notOnlyCoding.languages.1.text")
},
{
flag: "/img/flags/it.png",
name: t("notOnlyCoding.languages.2.name"),
level: t("notOnlyCoding.languages.2.level"),
text: t("notOnlyCoding.languages.2.text")
},
{
flag: "/img/fi.png",
name: t("notOnlyCoding.languages.3.name"),
level: t("notOnlyCoding.languages.3.level"),
text: t("notOnlyCoding.languages.3.text")
}
];
const projects = [
{
screenshot: "/img/screenshots/duid/main.png",
screenshotBg: "bg-gray-50",
logo: "/img/coat_of_arms.png",
logoAlt: t("projects.items.0.logoAlt"),
title: t("projects.items.0.title"),
url: "https://id.dusiburg.ru/",
hostname: "id.dusiburg.ru",
description: t("projects.items.0.description"),
skills: ["Next.js", "Tailwind", "Postgres", "Supabase"]
},
{
screenshot: "/img/screenshots/map.png",
screenshotBg: "bg-zinc-700",
logo: "/img/map.png",
logoAlt: t("projects.items.1.logoAlt"),
title: t("projects.items.1.title"),
url: "https://map.dusiburg.ru/",
hostname: "map.dusiburg.ru",
description: t("projects.items.1.description"),
skills: ["Next.js", "Tailwind", "Mapbox", "Postgres", "Supabase"]
},
{
screenshot: "/img/screenshots/vote.png",
screenshotBg: "bg-gray-50",
logo: "/img/coat_of_arms.png",
logoAlt: t("projects.items.2.logoAlt"),
title: t("projects.items.2.title"),
url: "https://vote.dusiburg.ru/",
hostname: "vote.dusiburg.ru",
description: t("projects.items.2.description"),
skills: ["Next.js", "Tailwind", "Prisma", "Postgres", "Supabase"]
},
{
screenshot: "/img/screenshots/fastlink.png",
screenshotBg: "bg-zinc-800",
logo: "/img/fastlink.png",
logoAlt: t("projects.items.3.logoAlt"),
title: t("projects.items.3.title"),
description: t("projects.items.3.description"),
skills: ["Next.js", "Tailwind", "Go", "Postgres", "Supabase"]
}
]
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" }}
>
{[...skillsRunline.slice(0, 13), ...skillsRunline.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}
{project.skills.map((skillName, idx) => {
const skill = skillsRunline.find(s => s.name === skillName);
return skill ? (
{skill.icon}
{skill.name}
) : null;
})}
))}
{t("notOnlyCoding.title")}
{t("notOnlyCoding.subtitle")}
{languages.map((language, index) => (
{language.name}
{language.level}
{language.text}
))}
{t("notOnlyCoding.outro")}
>
);
}