diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 17f559b..492857e 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,166 +1,327 @@ - import React, { useEffect, useState } from 'react'; import type { ReactElement } from 'react'; import Head from 'next/head'; import Link from 'next/link'; +import { useRouter } from 'next/router'; +import { + mdiMagnify, + mdiBookOpenPageVariant, + mdiSync, + mdiThemeLightDark, + mdiDownload, + mdiCellphoneMarker, + mdiTranslate, + mdiShieldCheck, + mdiGithub, +} from '@mdi/js'; import BaseButton from '../components/BaseButton'; -import CardBox from '../components/CardBox'; -import SectionFullScreen from '../components/SectionFullScreen'; +import BaseIcon from '../components/BaseIcon'; import LayoutGuest from '../layouts/Guest'; -import BaseDivider from '../components/BaseDivider'; -import BaseButtons from '../components/BaseButtons'; import { getPageTitle } from '../config'; import { useAppSelector } from '../stores/hooks'; -import CardBoxComponentTitle from "../components/CardBoxComponentTitle"; -import { getPexelsImage, getPexelsVideo } from '../helpers/pexels'; +const FEATURED_MANGA = [ + { + id: 1, + title: 'Shadow Chronicles', + image: 'https://images.unsplash.com/photo-1578632738980-43318b770d76?w=400&h=600&fit=crop', + rating: '4.9', + chapters: '124', + }, + { + id: 2, + title: 'Neon Catalyst', + image: 'https://images.unsplash.com/photo-1607604276483-4efdd6d43bb3?w=400&h=600&fit=crop', + rating: '4.7', + chapters: '85', + }, + { + id: 3, + title: 'Eternal Bloom', + image: 'https://images.unsplash.com/photo-1541562232579-512a21360020?w=400&h=600&fit=crop', + rating: '4.8', + chapters: '210', + }, + { + id: 4, + title: 'Void Walker', + image: 'https://images.unsplash.com/photo-1560972550-aba3456b5564?w=400&h=600&fit=crop', + rating: '4.6', + chapters: '45', + }, +]; -export default function Starter() { - const [illustrationImage, setIllustrationImage] = useState({ - src: undefined, - photographer: undefined, - photographer_url: undefined, - }) - const [illustrationVideo, setIllustrationVideo] = useState({video_files: []}) - const [contentType, setContentType] = useState('video'); - const [contentPosition, setContentPosition] = useState('right'); - const textColor = useAppSelector((state) => state.style.linkColor); +const FEATURES = [ + { + title: 'Universal Reader', + description: 'Customize your reading experience with vertical, horizontal, or webtoon scrolling modes.', + icon: mdiBookOpenPageVariant, + color: 'text-indigo-500', + }, + { + title: 'Tracker Sync', + description: 'Automatically sync your reading progress with MyAnimeList, AniList, and more.', + icon: mdiSync, + color: 'text-cyan-500', + }, + { + title: 'Offline Access', + description: 'Download your favorite chapters and read them anywhere, even without an internet connection.', + icon: mdiDownload, + color: 'text-rose-500', + }, + { + title: 'Custom Themes', + description: 'Choose from multiple themes or use our "Theme Based on Cover" for a unique look.', + icon: mdiThemeLightDark, + color: 'text-amber-500', + }, +]; - const title = 'App Draft' +export default function LandingPage() { + const router = useRouter(); + const { currentUser } = useAppSelector((state) => state.auth); + const [searchQuery, setSearchQuery] = useState(''); + const [isScrolled, setIsScrolled] = useState(false); - // Fetch Pexels image/video - useEffect(() => { - async function fetchData() { - const image = await getPexelsImage(); - const video = await getPexelsVideo(); - setIllustrationImage(image); - setIllustrationVideo(video); - } - fetchData(); - }, []); - - const imageBlock = (image) => ( -
-
- - Photo by {image?.photographer} on Pexels - -
-
- ); - - const videoBlock = (video) => { - if (video?.video_files?.length > 0) { - return ( -
- -
- - Video by {video.user.name} on Pexels - -
-
) - } + useEffect(() => { + const handleScroll = () => { + setIsScrolled(window.scrollY > 50); }; + window.addEventListener('scroll', handleScroll); + return () => window.removeEventListener('scroll', handleScroll); + }, []); + + const handleSearch = (e: React.FormEvent) => { + e.preventDefault(); + if (searchQuery.trim()) { + router.push(`/search?query=${encodeURIComponent(searchQuery)}`); + } + }; return ( -
+
- {getPageTitle('Starter Page')} + {getPageTitle('Komikku - Your Ultimate Manga Reader')} - -
- {contentType === 'image' && contentPosition !== 'background' - ? imageBlock(illustrationImage) - : null} - {contentType === 'video' && contentPosition !== 'background' - ? videoBlock(illustrationVideo) - : null} -
- - - -
-

This is a React.js/Node.js app generated by the Flatlogic Web App Generator

-

For guides and documentation please check - your local README.md and the Flatlogic documentation

+
+
+
+
- - - + + Komikku + +
- - +
+ + Features + + + Popular + + {currentUser ? ( + + ) : ( +
+ + Login + + +
+ )} +
-
- -
-

© 2026 {title}. All rights reserved

- - Privacy Policy - -
+ + {/* Hero Section */} +
+
+
+
+
+ +
+

+ Discover and Read
+ + Your Favorite Manga + +

+

+ The most versatile open-source manga reader for the web. Track your series, customize your reader, and sync across devices. +

+ +
+
+ +
+ setSearchQuery(e.target.value)} + placeholder="Search across 100+ sources..." + className="w-full bg-slate-800/50 border border-slate-700 backdrop-blur-sm rounded-2xl py-5 pl-14 pr-32 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 transition-all text-white placeholder:text-slate-500 shadow-2xl" + /> + +
+ +
+
+ + Ad-Free +
+
+ + Open Source +
+
+ + Mobile Ready +
+
+
+
+ + {/* Popular Section */} + + + {/* Features Section */} +
+
+

Powerful Features

+

+ Everything you need for the perfect reading experience, all in one place. +

+
+ +
+ {FEATURES.map((feature, idx) => ( +
+
+ +
+

{feature.title}

+

+ {feature.description} +

+
+ ))} +
+
+ + {/* CTA Section */} +
+
+
+
+
+ +

+ Ready to Start Reading? +

+

+ Join thousands of readers and experience manga like never before. Completely free and open-source. +

+
+ + + Already have an account? Log in + +
+
+
+ + {/* Footer */} +
+
+
+
+ +
+ Komikku +
+ +
+ Privacy Policy + Terms of Use + + + Source Code + +
+ +
+ © 2026 Komikku. All rights reserved. +
+
+
); } -Starter.getLayout = function getLayout(page: ReactElement) { +LandingPage.getLayout = function getLayout(page: ReactElement) { return {page}; -}; - +}; \ No newline at end of file