diff --git a/src/App.jsx b/src/App.jsx index 80efba9..f0f33f3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -14,6 +14,7 @@ import AddCategoryModal from "@/components/FeedList/components/AddCategoryModal. import { useHotkeys } from "@/hooks/useHotkeys.js"; import SearchModal from "@/components/Search/SearchModal.jsx"; import LogoutModal from "@/components/FeedList/components/LogoutModal.jsx"; +import AboutModal from "@/components/About/AboutModal.jsx"; function App() { const { syncInterval } = useStore(settingsState); @@ -39,6 +40,7 @@ function App() { + ); } diff --git a/src/components/About/AboutModal.jsx b/src/components/About/AboutModal.jsx new file mode 100644 index 0000000..9868c78 --- /dev/null +++ b/src/components/About/AboutModal.jsx @@ -0,0 +1,23 @@ +import { useTranslation } from "react-i18next"; +import { useStore } from "@nanostores/react"; +import { aboutModalOpen } from "@/stores/modalStore"; +import { FancyLogo } from "@/components/About/FancyLogo.jsx"; +import CustomModal from "@/components/ui/CustomModal.jsx"; + +export default function AboutModal() { + const { t } = useTranslation(); + const $aboutModalOpen = useStore(aboutModalOpen); + + return ( + aboutModalOpen.set(false)} + title={t("about.title")} + content={ +
+ +
+ } + /> + ); +} diff --git a/src/components/About/FancyLogo.jsx b/src/components/About/FancyLogo.jsx new file mode 100644 index 0000000..7b34726 --- /dev/null +++ b/src/components/About/FancyLogo.jsx @@ -0,0 +1,45 @@ +import { useRef } from "react"; +import logo from "@/assets/logo.png"; +import { Image } from "@heroui/react"; + +export const FancyLogo = ({ since }) => { + const boundingRef = useRef(null); + + return ( +
+
{ + boundingRef.current = null; + }} + onMouseEnter={(ev) => { + boundingRef.current = ev.currentTarget.getBoundingClientRect(); + }} + onMouseMove={(ev) => { + if (!boundingRef.current) return; + const x = ev.clientX - boundingRef.current.left; + const y = ev.clientY - boundingRef.current.top; + const xPercentage = x / boundingRef.current.width; + const yPercentage = y / boundingRef.current.height; + const xRotation = (xPercentage - 0.5) * 20; + const yRotation = (0.5 - yPercentage) * 20; + + ev.currentTarget.style.setProperty("--x-rotation", `${yRotation}deg`); + ev.currentTarget.style.setProperty("--y-rotation", `${xRotation}deg`); + ev.currentTarget.style.setProperty("--x", `${xPercentage * 100}%`); + ev.currentTarget.style.setProperty("--y", `${yPercentage * 100}%`); + }} + className="group relative w-full flex flex-col gap-6 py-6 items-center overflow-hidden rounded-md bg-gradient-to-b from-[#EAFFED] to-[#C6F7C9] p-4 text-[#01A977] transition-transform ease-out hover:[transform:rotateX(var(--x-rotation))_rotateY(var(--y-rotation))_scale(1.05)]" + > + logo +
+ + NEXTFLUX{" "} + {" "} + {since} + +
+
+
+
+ ); +}; diff --git a/src/components/ArticleList/components/ArticleCard.jsx b/src/components/ArticleList/components/ArticleCard.jsx index 69a5abd..3195c18 100644 --- a/src/components/ArticleList/components/ArticleCard.jsx +++ b/src/components/ArticleList/components/ArticleCard.jsx @@ -114,7 +114,7 @@ export default function ArticleCard({ article }) {
+ } + onPress={() => { + aboutModalOpen.set(true); + isMobile && setOpenMobile(false); + }} + > + {t("sidebar.profile.about")} +