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/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 ; +} 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/app/components/Navbar/NavbarUpdate.tsx b/app/components/Navbar/NavbarUpdate.tsx index 71b74d0..a6219c0 100644 --- a/app/components/Navbar/NavbarUpdate.tsx +++ b/app/components/Navbar/NavbarUpdate.tsx @@ -87,8 +87,8 @@ export const Navbar = () => { return ( <>
-
-
+
+
{menuItems.map((item) => { return ( { 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`} > { ); })}
-
+
{!userStore.isAuth ? { : <> { width={24} height={24} /> - + {userStore.user.login} + {preferenceStore.flags.showFifthButton ? + + + + {menuItems[preferenceStore.flags.showFifthButton].title} + + + : ""} { width={24} height={24} /> - + {userStore.user.login} @@ -165,7 +184,11 @@ export const Navbar = () => { onClick={() => setIsSettingModalOpen(true)} > - Настройки + + Настройки + {userStore.isAuth && ( 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]); 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 ( {index > 0 && ", "} {genre} @@ -91,18 +91,18 @@ export const PosterWithStuff = (props: { ); })} {props.title_ru && ( -

+

{props.title_ru}

)} {props.title_original && ( -

+

{props.title_original}

)}
{settings.showDescription && props.description && ( -

+

{props.description}

)} diff --git a/app/components/SettingsModal/SettingsModal.tsx b/app/components/SettingsModal/SettingsModal.tsx index 39ae318..3786e80 100644 --- a/app/components/SettingsModal/SettingsModal.tsx +++ b/app/components/SettingsModal/SettingsModal.tsx @@ -1,5 +1,7 @@ "use client"; +import { CURRENT_APP_VERSION } from "#/api/config"; +import { useUserStore } from "#/store/auth"; import { usePreferencesStore } from "#/store/preferences"; import { Modal, @@ -32,10 +34,17 @@ const NavbarTitles = { links: "Только ссылки", selected: "Только выбранные", never: "Никогда", -} +}; + +const FifthButton = { + 3: "Избранное", + 4: "Коллекции", + 5: "История", +}; export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => { const preferenceStore = usePreferencesStore(); + const userStore = useUserStore(); const { computedMode, setMode } = useThemeMode(); @@ -168,26 +177,66 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {

- {Object.keys(NavbarTitles).map((key: "always" | "links" | "selected" | "never") => { - return ( - - preferenceStore.setFlags({ - showNavbarTitles: key, - }) - } - > - {NavbarTitles[key]} - - ); - })} + {Object.keys(NavbarTitles).map( + (key: "always" | "links" | "selected" | "never") => { + return ( + + preferenceStore.setFlags({ + showNavbarTitles: key, + }) + } + > + {NavbarTitles[key]} + + ); + } + )}
+ {userStore.isAuth ? +
+

+ Пятый пункт в навигации +

+ + + preferenceStore.setFlags({ + showFifthButton: null, + }) + } + > + Не показывать + + {Object.keys(FifthButton).map((key) => { + return ( + + preferenceStore.setFlags({ + showFifthButton: Number(key) as 3 | 4 | 5, + }) + } + > + {FifthButton[key]} + + ); + })} + +
+ : ""}
@@ -278,26 +327,15 @@ export const SettingsModal = (props: { isOpen: boolean; setIsOpen: any }) => {
props.setIsOpen(false)} > - +
-

Телеграм канал

+

О приложении

- @anix_web -

-
- - - -
-

Разработчик

-

- Radiquum + v{CURRENT_APP_VERSION}

diff --git a/app/pages/About.tsx b/app/pages/About.tsx new file mode 100644 index 0000000..851641e --- /dev/null +++ b/app/pages/About.tsx @@ -0,0 +1,136 @@ +"use server"; + +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"; + +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 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"); + previous.push({ + version: file.replace(".md", ""), + changelog: changelog, + }); + } + }); + + return ( +
+ +
+ about image +
+

+ AniX - Неофициальный веб клиент для Anixart +

+

+ AniX - это неофициальный веб-клиент для Android-приложения + Anixart. Он позволяет вам получать доступ к своей учетной записи + Anixart и управлять ею из веб-браузера. Так-же можно + синхронизировать и управлять списками и избранным. И самое главное + смотреть все доступные аниме из базы Anixart. +

+
+
+
+ + +
+ developer image +
+

Radiquum

+

+ Разработчик +

+
+
+
+ + + +
+ +
+

Телеграм канал

+

+ @anix_web +

+
+
+
+ + + +
+ +
+

Код на GitHub

+

+ github.com/Radiquum/AniX +

+
+
+
+ + +

Список изменений

+ {current.changelog} + + {previous.reverse().map((changelog) => ( + + v{changelog.version} + + + {changelog.changelog} + + + + ))} + +
+
+ ); +}; diff --git a/app/pages/MobileMenuPage.tsx b/app/pages/MobileMenuPage.tsx index a075e2a..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); @@ -22,7 +24,7 @@ export const MenuPage = () => { return ( <> {userStore.user && ( -
+
{
- - -
- -

Избранное

-
-
- - - -
- -

Коллекции

-
-
- - - -
- -

История

-
-
- - - -
- -
-

Телеграм канал

-

- @anix_web -

+ {preferenceStore.flags.showFifthButton != 3 ? + + +
+ +

Избранное

-
- - - - -
- -
-

Разработчик

-

- Radiquum -

+ + + : ""} + {preferenceStore.flags.showFifthButton != 4 ? + + +
+ +

Коллекции

-
- - + + + : ""} + {preferenceStore.flags.showFifthButton != 5 ? + + +
+ +

История

+
+
+ + : ""} ()( showChangelog: true, enableAnalytics: true, showNavbarTitles: "always", + showFifthButton: null, }, params: { isFirstLaunch: true, @@ -54,8 +56,8 @@ export const usePreferencesStore = create()( bookmarksCategory: "watching", }, experimental: { - newPlayer: false - } + newPlayer: false, + }, }, setHasHydrated: (state) => { set({ @@ -74,9 +76,12 @@ export const usePreferencesStore = create()( 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 + ); + }, } ) ); 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) 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 + +## Добавлено + +- Добавлена страница о приложении +- Добавлена возможность добавить пятую кнопку в меню навигации на мобильных устройствах + +## Изменено + +- Стиль карточек для релизов был изменён на вертикальный +- На мобильных устройствах постер на странице релиза теперь по середине +- Позиция лицензированных сервисов теперь под постером +- На мобильных устройствах позиция меню была смещена вниз + +## Исправлено + +- Ошибка своего плеера не сбрасывалась, если удалось получить ссылку при переключении серии