From 04b580d239c5746fba510634d21a665a86211d7a Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Wed, 26 Mar 2025 15:53:27 +0500 Subject: [PATCH 1/9] fix: reset player error on episode change --- app/components/ReleasePlayer/ReleasePlayerCustom.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/components/ReleasePlayer/ReleasePlayerCustom.tsx b/app/components/ReleasePlayer/ReleasePlayerCustom.tsx index feec08c..75f62ca 100644 --- a/app/components/ReleasePlayer/ReleasePlayerCustom.tsx +++ b/app/components/ReleasePlayer/ReleasePlayerCustom.tsx @@ -342,6 +342,8 @@ export const ReleasePlayerCustom = (props: { setIsLoading(false); }; if (episode.selected) { + setIsLoading(true); + setPlayerError(null); __getInfo(); } }, [episode.selected]); From 956d35579b91db3f31bf6b3ca846d0c07b6711cb Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Wed, 26 Mar 2025 16:53:54 +0500 Subject: [PATCH 2/9] feat: add about page --- app/about/page.tsx | 16 ++++++ app/pages/About.tsx | 119 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 app/about/page.tsx create mode 100644 app/pages/About.tsx diff --git a/app/about/page.tsx b/app/about/page.tsx new file mode 100644 index 0000000..a44f27e --- /dev/null +++ b/app/about/page.tsx @@ -0,0 +1,16 @@ +export const metadata = { + title: "О приложении", + openGraph: { + title: "AniX - Неофициальный веб клиент для Anixart", + description: + "AniX - это неофициальный веб-клиент для Android-приложения Anixart. Он позволяет вам получать доступ к своей учетной записи Anixart и управлять ею из веб-браузера. Так-же можно синхронизировать и управлять списками и избранным. И самое главное смотреть все доступные аниме из базы Anixart.", + }, +}; + +export const dynamic = "force-static"; + +import { AboutPage } from "#/pages/About"; + +export default function Index() { + return <AboutPage />; +} diff --git a/app/pages/About.tsx b/app/pages/About.tsx new file mode 100644 index 0000000..0d423be --- /dev/null +++ b/app/pages/About.tsx @@ -0,0 +1,119 @@ +// "use client"; + +import { Card } from "flowbite-react"; +import Image from "next/image"; + +import * as fs from "node:fs"; +import * as path from "node:path"; +import { CURRENT_APP_VERSION } from "#/api/config"; +import Styles from "../components/ChangelogModal/ChangelogModal.module.css"; +import Markdown from "markdown-to-jsx"; + +export const AboutPage = () => { + const directoryPath = path.join(process.cwd(), "public/changelog"); + const files = fs.readdirSync(directoryPath); + const changelogs = []; + + files.forEach((file) => { + if (file != `${CURRENT_APP_VERSION}.md`) { + const changelog = fs.readFileSync(path.join(directoryPath, file), "utf8"); + changelogs.push({ + version: file.replace(".md", ""), + changelog: changelog, + }); + } + }); + + if (!files.includes(`${CURRENT_APP_VERSION}.md`)) { + changelogs.push({ + version: CURRENT_APP_VERSION, + changelog: "Нет списка изменений", + }); + } else { + const changelog = fs.readFileSync( + path.join(directoryPath, `${CURRENT_APP_VERSION}.md`), + "utf8" + ); + changelogs.push({ + version: CURRENT_APP_VERSION, + changelog: changelog, + }); + } + + return ( + <div className="grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3"> + <Card className="md:col-span-2 lg:col-span-3"> + <div className="flex flex-col items-center gap-4 md:flex-row"> + <Image + src="/images/icons/icon-512x512.png" + className="flex-shrink-0 w-32 h-32 rounded-full" + alt="about image" + width={128} + height={128} + /> + <div> + <h1 className="text-xl font-bold"> + AniX - Неофициальный веб клиент для Anixart + </h1> + <p className="max-w-[900px]"> + AniX - это неофициальный веб-клиент для Android-приложения + Anixart. Он позволяет вам получать доступ к своей учетной записи + Anixart и управлять ею из веб-браузера. Так-же можно + синхронизировать и управлять списками и избранным. И самое главное + смотреть все доступные аниме из базы Anixart. + </p> + </div> + </div> + </Card> + <Card> + <div className="flex items-center gap-4"> + <Image + src="https://radiquum.wah.su/static/avatar_512.jpg" + className="flex-shrink-0 w-16 h-16 rounded-full" + alt="developer image" + width={128} + height={128} + /> + <div> + <h1 className="text-xl font-bold">Radiquum</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + Разработчик + </p> + </div> + </div> + </Card> + <Card> + <div className="flex items-center gap-4"> + <span className="w-16 h-16 iconify fa6-brands--telegram text-[#001725] dark:text-[#faf8f9]"></span> + <div> + <h1 className="text-xl font-bold">Телеграм канал</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + @anix_web + </p> + </div> + </div> + </Card> + <Card> + <div className="flex items-center gap-4"> + <span className="flex-shrink-0 w-16 h-16 iconify fa6-brands--github text-[#001725] dark:text-[#faf8f9]"></span> + <div> + <h1 className="text-xl font-bold">Код на GitHub</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + github.com/Radiquum/AniX + </p> + </div> + </div> + </Card> + <Card className="md:col-span-2 lg:col-span-3"> + <h1 className="text-2xl font-bold">Список изменений</h1> + {changelogs.reverse().map((changelog) => ( + <div key={changelog.version} className="my-4"> + <Markdown className={Styles.markdown}> + {changelog.changelog} + </Markdown> + </div> + ))} + </Card> + </div> + ); +}; From 2241a8a2267b581be2749e9da25d50d4c04008ea Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 20:27:15 +0500 Subject: [PATCH 3/9] feat: add link to about page in settings --- .../SettingsModal/SettingsModal.tsx | 22 +-- app/pages/About.tsx | 141 ++++++++++-------- 2 files changed, 85 insertions(+), 78 deletions(-) diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index 39ae318..5c10bc1 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -1,5 +1,6 @@ "use client"; +import { CURRENT_APP_VERSION } from "#/api/config"; import { usePreferencesStore } from "#/store/preferences"; import { Modal, @@ -278,26 +279,15 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { <HR className="my-4 dark:bg-slate-400" /> <div> <Link - href={"https://t.me/anix_web"} + href={"/about"} className="flex items-center gap-2 p-2 text-left rounded-md hover:bg-gray-100 dark:hover:bg-gray-900" + onClick={() => props.setIsOpen(false)} > - <span className="w-8 h-8 iconify fa6-brands--telegram"></span> + <span className="w-8 h-8 iconify material-symbols--info"></span> <div> - <p>Телеграм канал</p> + <p>О приложении</p> <p className="text-sm text-gray-400 dark:text-gray-200"> - @anix_web - </p> - </div> - </Link> - <Link - href={"https://wah.su/radiquum"} - className="flex items-center gap-2 p-2 text-left rounded-md hover:bg-gray-100 dark:hover:bg-gray-900" - > - <span className="w-8 h-8 iconify mdi--code"></span> - <div> - <p>Разработчик</p> - <p className="text-sm text-gray-400 dark:text-gray-200"> - Radiquum + v{CURRENT_APP_VERSION} </p> </div> </Link> diff --git a/app/pages/About.tsx b/app/pages/About.tsx index 0d423be..851641e 100644 --- a/app/pages/About.tsx +++ b/app/pages/About.tsx @@ -1,4 +1,4 @@ -// "use client"; +"use server"; import { Card } from "flowbite-react"; import Image from "next/image"; @@ -9,37 +9,42 @@ import { CURRENT_APP_VERSION } from "#/api/config"; import Styles from "../components/ChangelogModal/ChangelogModal.module.css"; import Markdown from "markdown-to-jsx"; +import { + Accordion, + AccordionContent, + AccordionPanel, + AccordionTitle, +} from "flowbite-react"; +import { version } from "node:os"; +import Link from "next/link"; + export const AboutPage = () => { const directoryPath = path.join(process.cwd(), "public/changelog"); const files = fs.readdirSync(directoryPath); - const changelogs = []; + const current = { + version: CURRENT_APP_VERSION, + changelog: `#${CURRENT_APP_VERSION}\r\nНет списка изменений`, + }; + const previous = []; + + if (files.includes(`${CURRENT_APP_VERSION}.md`)) { + const changelog = fs.readFileSync( + path.join(directoryPath, `${CURRENT_APP_VERSION}.md`), + "utf8" + ); + current.changelog = changelog; + } files.forEach((file) => { if (file != `${CURRENT_APP_VERSION}.md`) { const changelog = fs.readFileSync(path.join(directoryPath, file), "utf8"); - changelogs.push({ + previous.push({ version: file.replace(".md", ""), changelog: changelog, }); } }); - if (!files.includes(`${CURRENT_APP_VERSION}.md`)) { - changelogs.push({ - version: CURRENT_APP_VERSION, - changelog: "Нет списка изменений", - }); - } else { - const changelog = fs.readFileSync( - path.join(directoryPath, `${CURRENT_APP_VERSION}.md`), - "utf8" - ); - changelogs.push({ - version: CURRENT_APP_VERSION, - changelog: changelog, - }); - } - return ( <div className="grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-3"> <Card className="md:col-span-2 lg:col-span-3"> @@ -65,54 +70,66 @@ export const AboutPage = () => { </div> </div> </Card> - <Card> - <div className="flex items-center gap-4"> - <Image - src="https://radiquum.wah.su/static/avatar_512.jpg" - className="flex-shrink-0 w-16 h-16 rounded-full" - alt="developer image" - width={128} - height={128} - /> - <div> - <h1 className="text-xl font-bold">Radiquum</h1> - <p className="text-sm text-gray-500 dark:text-gray-200"> - Разработчик - </p> + <Link href={"https://wah.su/radiquum"} target="_blank"> + <Card> + <div className="flex items-center gap-4"> + <Image + src="https://radiquum.wah.su/static/avatar_512.jpg" + className="flex-shrink-0 w-16 h-16 rounded-full" + alt="developer image" + width={128} + height={128} + /> + <div> + <h1 className="text-xl font-bold">Radiquum</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + Разработчик + </p> + </div> </div> - </div> - </Card> - <Card> - <div className="flex items-center gap-4"> - <span className="w-16 h-16 iconify fa6-brands--telegram text-[#001725] dark:text-[#faf8f9]"></span> - <div> - <h1 className="text-xl font-bold">Телеграм канал</h1> - <p className="text-sm text-gray-500 dark:text-gray-200"> - @anix_web - </p> + </Card> + </Link> + <Link href={"https://t.me/anix_web"} target="_blank"> + <Card> + <div className="flex items-center gap-4"> + <span className="w-16 h-16 iconify fa6-brands--telegram text-[#001725] dark:text-[#faf8f9]"></span> + <div> + <h1 className="text-xl font-bold">Телеграм канал</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + @anix_web + </p> + </div> </div> - </div> - </Card> - <Card> - <div className="flex items-center gap-4"> - <span className="flex-shrink-0 w-16 h-16 iconify fa6-brands--github text-[#001725] dark:text-[#faf8f9]"></span> - <div> - <h1 className="text-xl font-bold">Код на GitHub</h1> - <p className="text-sm text-gray-500 dark:text-gray-200"> - github.com/Radiquum/AniX - </p> + </Card> + </Link> + <Link href={"https://github.com/Radiquum/AniX"} target="_blank"> + <Card> + <div className="flex items-center gap-4"> + <span className="flex-shrink-0 w-16 h-16 iconify fa6-brands--github text-[#001725] dark:text-[#faf8f9]"></span> + <div> + <h1 className="text-xl font-bold">Код на GitHub</h1> + <p className="text-sm text-gray-500 dark:text-gray-200"> + github.com/Radiquum/AniX + </p> + </div> </div> - </div> - </Card> + </Card> + </Link> <Card className="md:col-span-2 lg:col-span-3"> <h1 className="text-2xl font-bold">Список изменений</h1> - {changelogs.reverse().map((changelog) => ( - <div key={changelog.version} className="my-4"> - <Markdown className={Styles.markdown}> - {changelog.changelog} - </Markdown> - </div> - ))} + <Markdown className={Styles.markdown}>{current.changelog}</Markdown> + <Accordion collapseAll={true}> + {previous.reverse().map((changelog) => ( + <AccordionPanel key={changelog.version}> + <AccordionTitle>v{changelog.version}</AccordionTitle> + <AccordionContent> + <Markdown className={Styles.markdown}> + {changelog.changelog} + </Markdown> + </AccordionContent> + </AccordionPanel> + ))} + </Accordion> </Card> </div> ); From bf67b5d9288129c311db0e07d32a78fe5125d215 Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 20:41:53 +0500 Subject: [PATCH 4/9] refactor: move mobile menu to the bottom on mobile --- app/pages/MobileMenuPage.tsx | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/app/pages/MobileMenuPage.tsx b/app/pages/MobileMenuPage.tsx index a075e2a..72fa408 100644 --- a/app/pages/MobileMenuPage.tsx +++ b/app/pages/MobileMenuPage.tsx @@ -22,7 +22,7 @@ export const MenuPage = () => { return ( <> {userStore.user && ( - <div className="flex flex-col gap-2"> + <div className="fixed flex flex-col justify-end gap-2 left-4 right-4 bottom-24 sm:static"> <div className="flex flex-wrap items-center gap-2"> <Link href={`/profile/${userStore.user.id}`} @@ -111,32 +111,6 @@ export const MenuPage = () => { </div> </Card> </Link> - <Link href={"https://t.me/anix_web"} className="flex-1"> - <Card> - <div className="flex items-center gap-2"> - <span className="w-8 h-8 iconify fa6-brands--telegram"></span> - <div> - <p>Телеграм канал</p> - <p className="text-sm text-gray-400 dark:text-gray-200"> - @anix_web - </p> - </div> - </div> - </Card> - </Link> - <Link href={"https://wah.su/radiquum"} className="flex-1"> - <Card> - <div className="flex items-center gap-2"> - <span className="w-8 h-8 iconify mdi--code"></span> - <div> - <p>Разработчик</p> - <p className="text-sm text-gray-400 dark:text-gray-200"> - Radiquum - </p> - </div> - </div> - </Card> - </Link> <SettingsModal isOpen={isSettingModalOpen} setIsOpen={setIsSettingModalOpen} From 1959fcd437c65edb1de2e66d077780b55df4e3c7 Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 20:54:43 +0500 Subject: [PATCH 5/9] refactor: remove 'show only link names in navbar' in settings on mobile --- app/components/Navbar/NavbarUpdate.tsx | 2 +- .../SettingsModal/SettingsModal.tsx | 37 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/components/Navbar/NavbarUpdate.tsx b/app/components/Navbar/NavbarUpdate.tsx index 71b74d0..4d0927d 100644 --- a/app/components/Navbar/NavbarUpdate.tsx +++ b/app/components/Navbar/NavbarUpdate.tsx @@ -87,7 +87,7 @@ export const Navbar = () => { return ( <> <header className="fixed bottom-0 left-0 z-50 w-full text-white bg-black rounded-t-lg sm:sticky sm:top-0 sm:rounded-t-none sm:rounded-b-lg"> - <div className="container flex items-center justify-center gap-4 mx-auto sm:gap-0 sm:justify-between"> + <div className="container flex items-center min-h-[76px] justify-center gap-4 mx-auto sm:gap-0 sm:justify-between"> <div className="flex items-center gap-8 px-2 py-4 sm:gap-4"> {menuItems.map((item) => { return ( diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index 5c10bc1..d9d4378 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -33,7 +33,7 @@ const NavbarTitles = { links: "Только ссылки", selected: "Только выбранные", never: "Никогда", -} +}; export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { const preferenceStore = usePreferencesStore(); @@ -169,24 +169,25 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { </p> <Dropdown color="blue" - label={ - NavbarTitles[preferenceStore.flags.showNavbarTitles] - } + label={NavbarTitles[preferenceStore.flags.showNavbarTitles]} > - {Object.keys(NavbarTitles).map((key: "always" | "links" | "selected" | "never") => { - return ( - <Dropdown.Item - key={`navbar-titles-${key}`} - onClick={() => - preferenceStore.setFlags({ - showNavbarTitles: key, - }) - } - > - {NavbarTitles[key]} - </Dropdown.Item> - ); - })} + {Object.keys(NavbarTitles).map( + (key: "always" | "links" | "selected" | "never") => { + return ( + <Dropdown.Item + className={`${key == "links" ? "hidden lg:flex" : ""}`} + key={`navbar-titles-${key}`} + onClick={() => + preferenceStore.setFlags({ + showNavbarTitles: key, + }) + } + > + {NavbarTitles[key]} + </Dropdown.Item> + ); + } + )} </Dropdown> </div> <HR className="my-4 dark:bg-slate-400" /> From 7b97b33951e04feb180e2d56c6ab5f5b5062112d Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 21:55:53 +0500 Subject: [PATCH 6/9] feat: add fifth navbar button settings for mobile --- app/components/Navbar/NavbarUpdate.tsx | 47 ++++++++++--- .../SettingsModal/SettingsModal.tsx | 47 +++++++++++++ app/pages/MobileMenuPage.tsx | 68 +++++++++++-------- app/store/preferences.ts | 17 +++-- 4 files changed, 132 insertions(+), 47 deletions(-) diff --git a/app/components/Navbar/NavbarUpdate.tsx b/app/components/Navbar/NavbarUpdate.tsx index 4d0927d..a6219c0 100644 --- a/app/components/Navbar/NavbarUpdate.tsx +++ b/app/components/Navbar/NavbarUpdate.tsx @@ -87,8 +87,8 @@ export const Navbar = () => { return ( <> <header className="fixed bottom-0 left-0 z-50 w-full text-white bg-black rounded-t-lg sm:sticky sm:top-0 sm:rounded-t-none sm:rounded-b-lg"> - <div className="container flex items-center min-h-[76px] justify-center gap-4 mx-auto sm:gap-0 sm:justify-between"> - <div className="flex items-center gap-8 px-2 py-4 sm:gap-4"> + <div className={`container flex items-center min-h-[76px] justify-center ${preferenceStore.flags.showFifthButton && preferenceStore.flags.showNavbarTitles == "always" ? "gap-0" : "gap-4"} mx-auto sm:gap-0 sm:justify-between`}> + <div className={`flex items-center ${preferenceStore.flags.showFifthButton && preferenceStore.flags.showNavbarTitles == "always" ? "gap-4" : "gap-8"} px-2 py-4 sm:gap-4`}> {menuItems.map((item) => { return ( <Link @@ -98,7 +98,7 @@ export const Navbar = () => { item.isAuthRequired && !userStore.isAuth ? "hidden" : item.isShownOnMobile ? "flex" : "hidden sm:flex" - } ${[item.href, item.hrefInCategory].includes("/" + pathname.split("/")[1]) ? "font-bold" : "font-medium"}`} + } ${[item.href, item.hrefInCategory].includes("/" + pathname.split("/")[1]) ? "font-bold" : "font-medium"} transition-all`} > <span className={`w-6 h-6 iconify ${[item.href, item.hrefInCategory].includes("/" + pathname.split("/")[1]) ? item.icon.active : item.icon.default}`} @@ -112,13 +112,13 @@ export const Navbar = () => { ); })} </div> - <div className="flex items-center gap-8 px-2 py-4 sm:gap-4"> + <div className={`flex items-center ${preferenceStore.flags.showFifthButton && preferenceStore.flags.showNavbarTitles == "always" ? "gap-4" : "gap-8"} px-2 py-4 sm:gap-4`}> {!userStore.isAuth ? <Link href={ pathname != "/login" ? `/login?redirect=${pathname}` : "#" } - className={`flex items-center flex-col lg:flex-row gap-1 ${pathname == "/login" ? "font-bold" : "font-medium"}`} + className={`flex items-center flex-col lg:flex-row gap-1 ${pathname == "/login" ? "font-bold" : "font-medium"} transition-all`} > <span className="w-6 h-6 iconify material-symbols--login"></span> <span @@ -130,7 +130,7 @@ export const Navbar = () => { : <> <Link href={`/profile/${userStore.user.id}`} - className={`hidden lg:flex flex-col lg:flex-row items-center gap-1 ${pathname == `/profile/${userStore.user.id}` ? "font-bold" : "font-medium"}`} + className={`hidden lg:flex flex-col lg:flex-row items-center gap-1 ${pathname == `/profile/${userStore.user.id}` ? "font-bold" : "font-medium"} transition-all`} > <Image src={userStore.user.avatar} @@ -139,13 +139,30 @@ export const Navbar = () => { width={24} height={24} /> - <span className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" || preferenceStore.flags.showNavbarTitles == "links" || (preferenceStore.flags.showNavbarTitles == "selected" && pathname == `/profile/${userStore.user.id}`) ? "block" : "hidden"}`}> + <span + className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" || preferenceStore.flags.showNavbarTitles == "links" || (preferenceStore.flags.showNavbarTitles == "selected" && pathname == `/profile/${userStore.user.id}`) ? "block" : "hidden"}`} + > {userStore.user.login} </span> </Link> + {preferenceStore.flags.showFifthButton ? + <Link + href={menuItems[preferenceStore.flags.showFifthButton].href} + className={`flex flex-col sm:hidden items-center gap-1 ${pathname == menuItems[preferenceStore.flags.showFifthButton].href ? "font-bold" : "font-medium"} transition-all`} + > + <span + className={`w-6 h-6 iconify ${pathname == menuItems[preferenceStore.flags.showFifthButton].href ? menuItems[preferenceStore.flags.showFifthButton].icon.active : menuItems[preferenceStore.flags.showFifthButton].icon.default}`} + ></span> + <span + className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" || preferenceStore.flags.showNavbarTitles == "links" || (preferenceStore.flags.showNavbarTitles == "selected" && pathname == menuItems[preferenceStore.flags.showFifthButton].href) ? "block" : "hidden"}`} + > + {menuItems[preferenceStore.flags.showFifthButton].title} + </span> + </Link> + : ""} <Link href={`/menu`} - className={`flex flex-col lg:hidden items-center gap-1 ${pathname == `/menu` || pathname == `/profile/${userStore.user.id}` ? "font-bold" : "font-medium"}`} + className={`flex flex-col lg:hidden items-center gap-1 ${pathname == `/menu` || pathname == `/profile/${userStore.user.id}` ? "font-bold" : "font-medium"} transition-all`} > <Image src={userStore.user.avatar} @@ -154,7 +171,9 @@ export const Navbar = () => { width={24} height={24} /> - <span className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" || preferenceStore.flags.showNavbarTitles == "links" || (preferenceStore.flags.showNavbarTitles == "selected" && (pathname == `/menu` || pathname == `/profile/${userStore.user.id}`)) ? "block" : "hidden"}`}> + <span + className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" || preferenceStore.flags.showNavbarTitles == "links" || (preferenceStore.flags.showNavbarTitles == "selected" && (pathname == `/menu` || pathname == `/profile/${userStore.user.id}`)) ? "block" : "hidden"}`} + > {userStore.user.login} </span> </Link> @@ -165,7 +184,11 @@ export const Navbar = () => { onClick={() => setIsSettingModalOpen(true)} > <span className="w-6 h-6 iconify material-symbols--settings-outline-rounded"></span> - <span className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" ? "block" : "hidden"}`}>Настройки</span> + <span + className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" ? "block" : "hidden"}`} + > + Настройки + </span> </button> {userStore.isAuth && ( <button @@ -173,7 +196,9 @@ export const Navbar = () => { onClick={() => userStore.logout()} > <span className="w-6 h-6 iconify material-symbols--logout"></span> - <span className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" ? "lg:hidden xl:block" : "hidden"}`}> + <span + className={`text-xs sm:text-base ${preferenceStore.flags.showNavbarTitles == "always" ? "lg:hidden xl:block" : "hidden"}`} + > Выйти </span> </button> diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index d9d4378..3786e80 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -1,6 +1,7 @@ "use client"; import { CURRENT_APP_VERSION } from "#/api/config"; +import { useUserStore } from "#/store/auth"; import { usePreferencesStore } from "#/store/preferences"; import { Modal, @@ -35,8 +36,15 @@ const NavbarTitles = { never: "Никогда", }; +const FifthButton = { + 3: "Избранное", + 4: "Коллекции", + 5: "История", +}; + export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { const preferenceStore = usePreferencesStore(); + const userStore = useUserStore(); const { computedMode, setMode } = useThemeMode(); @@ -190,6 +198,45 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { )} </Dropdown> </div> + {userStore.isAuth ? + <div className="flex items-center justify-between sm:hidden"> + <p className=" dark:text-white max-w-96"> + Пятый пункт в навигации + </p> + <Dropdown + color="blue" + label={ + preferenceStore.flags.showFifthButton ? + FifthButton[preferenceStore.flags.showFifthButton] + : "Нет" + } + > + <Dropdown.Item + onClick={() => + preferenceStore.setFlags({ + showFifthButton: null, + }) + } + > + Не показывать + </Dropdown.Item> + {Object.keys(FifthButton).map((key) => { + return ( + <Dropdown.Item + key={`navbar-fifthbutton-${key}`} + onClick={() => + preferenceStore.setFlags({ + showFifthButton: Number(key) as 3 | 4 | 5, + }) + } + > + {FifthButton[key]} + </Dropdown.Item> + ); + })} + </Dropdown> + </div> + : ""} <HR className="my-4 dark:bg-slate-400" /> <div className="flex items-center gap-2"> <span className="w-6 h-6 iconify material-symbols--settings-outline"></span> diff --git a/app/pages/MobileMenuPage.tsx b/app/pages/MobileMenuPage.tsx index 72fa408..f1f73b8 100644 --- a/app/pages/MobileMenuPage.tsx +++ b/app/pages/MobileMenuPage.tsx @@ -6,9 +6,11 @@ import { useRouter } from "next/navigation"; import { SettingsModal } from "#/components/SettingsModal/SettingsModal"; import { useEffect, useState } from "react"; import Image from "next/image"; +import { usePreferencesStore } from "#/store/preferences"; export const MenuPage = () => { const userStore = useUserStore(); + const preferenceStore = usePreferencesStore(); const router = useRouter(); const [isSettingModalOpen, setIsSettingModalOpen] = useState(false); @@ -81,36 +83,42 @@ export const MenuPage = () => { </button> </div> </div> - <Link href="/favorites" className="flex-1 sm:hidden"> - <Card> - <div className="flex items-center gap-2"> - <span - className={`iconify material-symbols--favorite-outline w-6 h-6`} - ></span> - <p>Избранное</p> - </div> - </Card> - </Link> - <Link href="/collections" className="flex-1 sm:hidden"> - <Card> - <div className="flex items-center gap-2"> - <span - className={`iconify material-symbols--collections-bookmark-outline w-6 h-6`} - ></span> - <p>Коллекции</p> - </div> - </Card> - </Link> - <Link href="/history" className="flex-1 sm:hidden"> - <Card> - <div className="flex items-center gap-2"> - <span - className={`iconify material-symbols--history w-6 h-6`} - ></span> - <p>История</p> - </div> - </Card> - </Link> + {preferenceStore.flags.showFifthButton != 3 ? + <Link href="/favorites" className="flex-1 sm:hidden"> + <Card> + <div className="flex items-center gap-2"> + <span + className={`iconify material-symbols--favorite-outline w-6 h-6`} + ></span> + <p>Избранное</p> + </div> + </Card> + </Link> + : ""} + {preferenceStore.flags.showFifthButton != 4 ? + <Link href="/collections" className="flex-1 sm:hidden"> + <Card> + <div className="flex items-center gap-2"> + <span + className={`iconify material-symbols--collections-bookmark-outline w-6 h-6`} + ></span> + <p>Коллекции</p> + </div> + </Card> + </Link> + : ""} + {preferenceStore.flags.showFifthButton != 5 ? + <Link href="/history" className="flex-1 sm:hidden"> + <Card> + <div className="flex items-center gap-2"> + <span + className={`iconify material-symbols--history w-6 h-6`} + ></span> + <p>История</p> + </div> + </Card> + </Link> + : ""} <SettingsModal isOpen={isSettingModalOpen} setIsOpen={setIsSettingModalOpen} diff --git a/app/store/preferences.ts b/app/store/preferences.ts index 93131c7..c1e4e74 100644 --- a/app/store/preferences.ts +++ b/app/store/preferences.ts @@ -11,6 +11,7 @@ interface preferencesState { showChangelog?: boolean; enableAnalytics?: boolean; showNavbarTitles?: "always" | "links" | "selected" | "never"; + showFifthButton?: null | 3 | 4 | 5; }; params: { isFirstLaunch?: boolean; @@ -22,7 +23,7 @@ interface preferencesState { }; experimental?: { newPlayer: boolean; - } + }; // color: { // primary: string; // secondary: string; @@ -44,6 +45,7 @@ export const usePreferencesStore = create<preferencesState>()( showChangelog: true, enableAnalytics: true, showNavbarTitles: "always", + showFifthButton: null, }, params: { isFirstLaunch: true, @@ -54,8 +56,8 @@ export const usePreferencesStore = create<preferencesState>()( bookmarksCategory: "watching", }, experimental: { - newPlayer: false - } + newPlayer: false, + }, }, setHasHydrated: (state) => { set({ @@ -74,9 +76,12 @@ export const usePreferencesStore = create<preferencesState>()( onRehydrateStorage: (state) => { return () => state.setHasHydrated(true); }, - merge: (persistedState , currentState) => { - return deepmerge(currentState as preferencesState, persistedState as preferencesState); - } + merge: (persistedState, currentState) => { + return deepmerge( + currentState as preferencesState, + persistedState as preferencesState + ); + }, } ) ); From 265be8d1e1196aa3c38b4223f585b25c9a9ac928 Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 22:03:03 +0500 Subject: [PATCH 7/9] change line-height to 1 on poster text --- app/components/ReleasePoster/PosterWithStuff.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/ReleasePoster/PosterWithStuff.tsx b/app/components/ReleasePoster/PosterWithStuff.tsx index adffc49..7ffbee2 100644 --- a/app/components/ReleasePoster/PosterWithStuff.tsx +++ b/app/components/ReleasePoster/PosterWithStuff.tsx @@ -83,7 +83,7 @@ export const PosterWithStuff = (props: { return ( <span key={`release_${props.id}_genre_${genre}_${index}`} - className="font-light text-white md:text-sm lg:text-base xl:text-lg" + className="font-light leading-none text-white md:text-sm lg:text-base xl:text-lg" > {index > 0 && ", "} {genre} @@ -91,18 +91,18 @@ export const PosterWithStuff = (props: { ); })} {props.title_ru && ( - <p className="text-xl font-bold text-white md:text-2xl"> + <p className="py-1 text-xl font-bold leading-none text-white md:text-2xl md:py-0"> {props.title_ru} </p> )} {props.title_original && ( - <p className="text-sm text-gray-300 md:text-base"> + <p className="text-sm leading-none text-gray-300 md:text-base"> {props.title_original} </p> )} </div> {settings.showDescription && props.description && ( - <p className="mt-2 text-sm font-light text-white lg:text-base xl:text-lg line-clamp-4"> + <p className="mt-2 text-sm font-light leading-none text-white lg:text-base xl:text-lg line-clamp-4"> {props.description} </p> )} From 663633c9797d6a85e2ed8fa76e188c6afc0c343f Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 22:10:49 +0500 Subject: [PATCH 8/9] chore: bump version [3.5.0] --- app/api/config.ts | 2 +- public/changelog/3.5.0.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 public/changelog/3.5.0.md diff --git a/app/api/config.ts b/app/api/config.ts index b0b7b9c..d3a25d0 100644 --- a/app/api/config.ts +++ b/app/api/config.ts @@ -1,4 +1,4 @@ -export const CURRENT_APP_VERSION = "3.4.0"; +export const CURRENT_APP_VERSION = "3.5.0"; export const API_URL = "https://api.anixart.tv"; export const API_PREFIX = "/api/proxy"; diff --git a/public/changelog/3.5.0.md b/public/changelog/3.5.0.md new file mode 100644 index 0000000..af13131 --- /dev/null +++ b/public/changelog/3.5.0.md @@ -0,0 +1,17 @@ +# 3.5.0 + +## Добавлено + +- Добавлена страница о приложении +- Добавлена возможность добавить пятую кнопку в меню навигации на мобильных устройствах + +## Изменено + +- Стиль карточек для релизов был изменён на вертикальный +- На мобильных устройствах постер на странице релиза теперь по середине +- Позиция лицензированных сервисов теперь под постером +- На мобильных устройствах позиция меню была смещена вниз + +## Исправлено + +- Ошибка своего плеера не сбрасывалась, если удалось получить ссылку при переключении серии From 8ab668dcd6757c76845152f5aec083a15cad961b Mon Sep 17 00:00:00 2001 From: Radiquum <kentai.waah@gmail.com> Date: Thu, 27 Mar 2025 22:17:33 +0500 Subject: [PATCH 9/9] chore: update readme --- README.md | 2 +- docs/REAME.RU.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a8d8796..b0f2660 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ AniX is an unofficial web client for the Android application Anixart. It allows ## Changelog [RU] +- [3.5.0](./public/changelog/3.5.0.md) - [3.4.0](./public/changelog/3.4.0.md) - [3.3.0](./public/changelog/3.3.0.md) - [3.2.3](./public/changelog/3.2.3.md) -- [3.2.2](./public/changelog/3.2.2.md) [other versions](./public/changelog) diff --git a/docs/REAME.RU.md b/docs/REAME.RU.md index cfb0f9f..b62c36e 100644 --- a/docs/REAME.RU.md +++ b/docs/REAME.RU.md @@ -6,10 +6,10 @@ AniX - это неофициальный веб-клиент для Android-пр ## Список изменений +- [3.5.0](/public/changelog/3.5.0.md) - [3.4.0](/public/changelog/3.4.0.md) - [3.3.0](/public/changelog/3.3.0.md) - [3.2.3](/public/changelog/3.2.3.md) -- [3.2.2](/public/changelog/3.2.2.md) [другие версии](/public/changelog)