diff --git a/public/favicon.ico b/public/favicon.ico index e69de29..325fce1 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/resources/js/Layouts/AppLayout.jsx b/resources/js/Layouts/AppLayout.jsx index 2edf37d..4b7556e 100644 --- a/resources/js/Layouts/AppLayout.jsx +++ b/resources/js/Layouts/AppLayout.jsx @@ -46,9 +46,9 @@ export default function AppLayout({ auth, header, children, toolbar }) {
- + - + Home diff --git a/resources/js/Pages/Comic/Chapters.jsx b/resources/js/Pages/Comic/Chapters.jsx index 800bc91..dfcbf4a 100644 --- a/resources/js/Pages/Comic/Chapters.jsx +++ b/resources/js/Pages/Comic/Chapters.jsx @@ -70,7 +70,7 @@ export default function Chapters({ auth, comic, chapters, histories }) { return ( - + { comic.comic.name } diff --git a/resources/js/Pages/Comic/Index.jsx b/resources/js/Pages/Comic/Index.jsx index e09a0b6..3330f87 100644 --- a/resources/js/Pages/Comic/Index.jsx +++ b/resources/js/Pages/Comic/Index.jsx @@ -60,7 +60,6 @@ export default function Index({ comics, offset, auth }) {
- ;
diff --git a/resources/js/Pages/Comic/Read.jsx b/resources/js/Pages/Comic/Read.jsx index dc4b315..00649ad 100644 --- a/resources/js/Pages/Comic/Read.jsx +++ b/resources/js/Pages/Comic/Read.jsx @@ -8,10 +8,10 @@ import { throttle } from 'lodash'; import { BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator } from '@/components/ui/breadcrumb'; import { Button } from '@/components/ui/button'; -import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; +import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'; import PrimaryButton from '@/components/PrimaryButton'; import { Switch } from '@/components/ui/switch'; -import { TooltipContent } from "@/components/ui/tooltip"; +import { TooltipContent } from '@/components/ui/tooltip'; export default function Read({ auth, comic, chapter }) { @@ -69,39 +69,15 @@ export default function Read({ auth, comic, chapter }) { const ImageForComic = (img) => { const imgRef = useRef(); - const resizeImage = () => { - if (!imgRef.current || !ref.current) return; + let imgStyles = {}; - const { naturalWidth, naturalHeight } = imgRef.current; - const containerWidth = ref.current.clientWidth; - const containerHeight = ref.current.clientHeight; - - let width, height; - - if (readingMode === "rtl") { - // Scale for RTL mode - const ratioWidth = naturalWidth / containerWidth; - const ratioHeight = naturalHeight / containerHeight; - const maxRatio = Math.max(ratioWidth, ratioHeight); - width = naturalWidth / maxRatio; - height = naturalHeight / maxRatio; - } else if (readingMode === "utd") { - // Scale for UTD mode - const ratio = divDimensions[1] < divDimensions[0] ? 0.33 : 1; // Example logic - const scaledWidth = containerWidth * ratio; - const scaledRatio = naturalWidth / scaledWidth; - width = naturalWidth / scaledRatio; - height = naturalHeight / scaledRatio; - } - - // Apply dimensions directly - imgRef.current.style.width = `${width}px`; - imgRef.current.style.height = `${height}px`; - }; - - useEffect(() => { - resizeImage(); - }, [readingMode, divDimensions]); // Recalculate when these dependencies change + if (divDimensions[1] > divDimensions[0] && readingMode === 'utd') { + imgStyles = { width: '100%' }; + } else if (divDimensions[0] > divDimensions[1] && readingMode === 'utd') { + imgStyles = { width: '50%' }; + } else if (readingMode === 'rtl') { + imgStyles = { height: 'calc(100dvh - 90px)' }; + } const handleImageClick = (e) => { if (readingMode === "utd") return; @@ -128,9 +104,9 @@ export default function Read({ auth, comic, chapter }) { { @@ -282,15 +258,17 @@ export default function Read({ auth, comic, chapter }) { return ( - - - - - { comic.comic.name } - - - - + + + + + + { comic.comic.name } + + + + + { chapter.chapter.name }