Skip to content

Commit

Permalink
weirder fixes 😭
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMatta committed Dec 18, 2024
1 parent d9d4f2c commit b4c2455
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/error-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const ErrorPage = () => {
return (
<div className="absolute left-0 w-full h-full flex justify-center items-center flex-col gap-2">
<h1 className="text-7xl font-bold">Oops! Something went wrong.</h1>
<Link to="/" className="text-2xl font-bold underline">Go back to home</Link>
<Link to="/aniwiki/" className="text-2xl font-bold underline">Go back to home</Link>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/media-query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const DisplayMedia = ({media}:{media:media[]}) => {
return(
<div className="flex w-full max-w-full md:max-h-[450px] md:overflow-y-hidden gap-1 overflow-y-scroll">
{media.map((page) => (
<div onClick={() => navigate(`/${page.type.toLowerCase()}/${page.id}`)} key={page.id} className="w-[140px] md:w-[250px] flex-shrink-0 p-2 rounded hover:w-[260px] duration-300">
<div onClick={() => navigate(`/aniwiki/${page.type.toLowerCase()}/${page.id}`)} key={page.id} className="w-[140px] md:w-[250px] flex-shrink-0 p-2 rounded hover:w-[260px] duration-300">
<img src={page.coverImage.extraLarge} alt={page.title.romaji} className="w-full min-h-[200px] md:min-h-[350px] md:max-h-[350px] max-h-[250px] object-cover"/>
<h3 className="line-clamp-2">{page.title.romaji}</h3>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/navbar-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ const NavBar = () => {
return(
<div className="w-full flex justify-between min-h-14 items-center px-6">
<div className="w-1/2">
<Link to="/"><img className="h-8 font-extrabold text-xl hover:invert duration-300" src="https://github.com/NotMatta/aniwiki/blob/main/public/logo.png?raw=true" alt="AniWiki"/></Link>
<Link to="/aniwiki/"><img className="h-8 font-extrabold text-xl hover:invert duration-300" src="https://github.com/NotMatta/aniwiki/blob/main/public/logo.png?raw=true" alt="AniWiki"/></Link>
</div>
<div className="flex gap-4 [&_p]:hidden md:[&_p]:block [&>a]:gap-2 [&>a]:flex [&>a]:p-2">
<Link to="/search" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><Search/><p>Search</p></Link>
<Link to="/browse/anime/" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><TvMinimal/><p>Anime</p></Link>
<Link to="/browse/manga/" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><BookOpen/><p>Manga</p></Link>
<Link to="/aniwiki/search/" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><Search/><p>Search</p></Link>
<Link to="/aniwiki/browse/anime/" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><TvMinimal/><p>Anime</p></Link>
<Link to="/aniwiki/browse/manga/" className="hover:bg-[rgba(0,0,0,0.5)] duration-300 rounded-xl"><BookOpen/><p>Manga</p></Link>
</div>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/page-components/recommendations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Recommendations = ({media}:{media:{id:number,name:string,image:string,type
return(
<div className="w-full max-w-full overflow-x-scroll flex gap-2 pb-2 [&>div]:shrink-0 relative">
{media.map((page) => (
<div className="w-[130px] lg:w-[200px] font-semibold hover:cursor-pointer hover:w-[220px] duration-300" key={page.name} onClick={() => navigate(`/${page.type.toLowerCase()}/${page.id}`)}>
<div className="w-[130px] lg:w-[200px] font-semibold hover:cursor-pointer hover:w-[220px] duration-300" key={page.name} onClick={() => navigate(`/aniwiki/${page.type.toLowerCase()}/${page.id}`)}>
<img src={page.image}
alt={page.name} className="w-full h-[200px] lg:h-[300px] object-cover rounded select-none pointer-events-none"/>
<p className="overflow-hidden line-clamp-1 text-ellipsis">{page.name}</p>
Expand Down
12 changes: 6 additions & 6 deletions src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import MediaPage from "./routes/media-page";
import SearchPage from "./routes/search-page";

const routes = [
{path: "/", element: <Home />},
{path: "/anime/:id", element: <MediaPage format="ANIME"/>},
{path: "/manga/:id", element: <MediaPage format="MANGA"/>},
{path: "/browse/anime", element: <MediaBrowse initType="anime" />},
{path: "/browse/manga", element: <MediaBrowse initType="manga" />},
{path: "/search/", element: <SearchPage/>},
{path: "/aniwiki/", element: <Home />},
{path: "/aniwiki/anime/:id", element: <MediaPage format="ANIME"/>},
{path: "/aniwiki/manga/:id", element: <MediaPage format="MANGA"/>},
{path: "/aniwiki/browse/anime", element: <MediaBrowse initType="anime" />},
{path: "/aniwiki/browse/manga", element: <MediaBrowse initType="manga" />},
{path: "/aniwiki/search/", element: <SearchPage/>},
]

export const RoutesProvider = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Home = () => {
<div className="h-full max-h-full relative flex flex-col w-full items-center justify-center space-y-4">
<p className="text-center w-10/12 lg:w-2/3 text-4xl md:text-7xl font-extrabold">A Wiki for all your Anime and Manga</p>
<div className="flex flex-col md:flex-row gap-4 font-semibold">
<Link to="/browse/anime" className="cursor-pointer flex items-center gap-1 bg-white text-black hover:invert duration-300 py-2 px-4 text-xl rounded-xl justify-center">Start Browsing <ChevronRight /></Link>
<Link to="/aniwiki/browse/anime" className="cursor-pointer flex items-center gap-1 bg-white text-black hover:invert duration-300 py-2 px-4 text-xl rounded-xl justify-center">Start Browsing <ChevronRight /></Link>
<a target="_blank" href="https://github.com/NotMatta/aniwiki"
className="flex items-center gap-2 bg-[#101010] py-2 px-4 text-xl rounded-xl shadow hover:shadow-white justify-center">
Source
Expand Down
8 changes: 4 additions & 4 deletions src/routes/search-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const Results = ({q,page,type}:{q:string,page:number,type:string}) => {
return(
<div className="flex flex-col items-center h-0 max-h-full flex-grow gap-2">
<div className="flex justify-center rounded-full bg-[rgba(0,0,0,0.5)] [&>*]:w-12 [&_button]:max-w-12">
<button className="flex items-center justify-center disabled:text-black" disabled={page < 2} onClick={() => {navigate('/search?q='+q+'&type='+type+'&page='+(page-1))}}><ChevronLeft size={24}/></button>
<button className="flex items-center justify-center disabled:text-black" disabled={page < 2} onClick={() => {navigate('/aniwiki/search?q='+q+'&type='+type+'&page='+(page-1))}}><ChevronLeft size={24}/></button>
<p className="border-r border-l border-black p-2 text-center">{page}</p>
<button className="flex items-center justify-center disabled:text-black" disabled={data.Page.pageInfo.lastPage == page} onClick={() => {navigate('/search?q='+q+'&type='+type+'&page='+(page+1))}}><ChevronRight/></button>
<button className="flex items-center justify-center disabled:text-black" disabled={data.Page.pageInfo.lastPage == page} onClick={() => {navigate('/aniwiki/search?q='+q+'&type='+type+'&page='+(page+1))}}><ChevronRight/></button>
</div>
<div className="flex flex-wrap justify-around gap-4 w-full overflow-y-scroll h-full">
{data.Page.media.map((media:{title:{romaji:string},id:string,coverImage:{large:string}}) => (
<div className="flex flex-col items-center text-center gap-1 shrink-0 w-[150px] md:w-[240px] hover:w-[250px] rounded duration-300" key={media.id} onClick={() => navigate(`/${type}/${media.id}`)}>
<div className="flex flex-col items-center text-center gap-1 shrink-0 w-[150px] md:w-[240px] hover:w-[250px] rounded duration-300" key={media.id} onClick={() => navigate(`/aniwiki/${type}/${media.id}`)}>
<img className="w-full mx-2 lg:max-h-[350px] max-h-[230px] md:min-h-[350px] min-h-[230px] object-cover rounded" src={media.coverImage.large} alt={media.title.romaji}/>
<p className="text-wrap line-clamp-2 text-sm lg:text-md overflow-hidden max-h-6 max-w-[200px]">{media.title.romaji}</p>
</div>
Expand All @@ -50,7 +50,7 @@ const SearchPage = () => {
params.set('q',search)
params.set('type',type)
params.set('page','1')
navigate('/search?'+params.toString())
navigate('/aniwiki/search?'+params.toString())
}
}
return (
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: '/'
base: '/aniwiki/'
})

0 comments on commit b4c2455

Please sign in to comment.