From 933f65dc741decd1b20a730b33e857387a049222 Mon Sep 17 00:00:00 2001 From: hymbz Date: Wed, 3 Jul 2024 20:39:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8D=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E6=A8=A1=E5=BC=8F=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E4=B8=8A=E9=97=B4=E9=9A=94=E8=BF=87=E9=95=BF=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Manga/components/ComicImg.module.css | 3 ++- src/components/Manga/components/ComicImg.tsx | 13 ------------- src/components/Manga/components/ComicImgFlow.tsx | 9 ++++++--- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/components/Manga/components/ComicImg.module.css b/src/components/Manga/components/ComicImg.module.css index 5279f58b..476eeba7 100644 --- a/src/components/Manga/components/ComicImg.module.css +++ b/src/components/Manga/components/ComicImg.module.css @@ -167,7 +167,7 @@ overflow: auto; grid-auto-columns: unset; grid-auto-flow: row; - grid-auto-rows: calc(100% / 3); + grid-auto-rows: max-content; grid-row-gap: 1.5em; grid-template-rows: unset; @@ -176,6 +176,7 @@ & .img { transform: none; + overflow: unset; height: auto; & > img { diff --git a/src/components/Manga/components/ComicImg.tsx b/src/components/Manga/components/ComicImg.tsx index d08c508e..674050de 100644 --- a/src/components/Manga/components/ComicImg.tsx +++ b/src/components/Manga/components/ComicImg.tsx @@ -3,9 +3,7 @@ import { createMemoMap } from 'helper/solidJs'; import { store } from '../store'; import { - activePage, getImgTip, - imgPageMap, imgShowState, isAbreastMode, abreastArea, @@ -32,17 +30,6 @@ export const ComicImg: Component = (img) => { 'grid-area': () => (isAbreastMode() ? undefined : `_${img.index}`), '--width': () => store.option.scrollMode.enabled ? `${img.size.width}px` : undefined, - 'box-shadow'() { - if (!store.gridMode || !activePage().includes(img.index)) - return undefined; - - const page = store.pageList[imgPageMap()[img.index]].filter( - (i) => i !== -1, - ); - const showState = page.length === 1 ? 2 : imgShowState()[img.index]; - if (showState === 2) return '0 0 1em 0.5em var(--text-secondary)'; - return `${showState ? -1 : 1}em 0 1em -0.5em var(--text-secondary)`; - }, }); /** 并排卷轴模式下需要复制的图片数量 */ diff --git a/src/components/Manga/components/ComicImgFlow.tsx b/src/components/Manga/components/ComicImgFlow.tsx index 07146941..31152853 100644 --- a/src/components/Manga/components/ComicImgFlow.tsx +++ b/src/components/Manga/components/ComicImgFlow.tsx @@ -81,7 +81,11 @@ export const ComicImgFlow: Component = () => { if (store.pageList.length === 0) return undefined; if (store.gridMode) { - const columnNum = isOnePageMode() ? 5 : 3; + let columnNum: number; + if (store.isMobile) columnNum = 2; + else if (isOnePageMode()) columnNum = 4; + else columnNum = 2; + const areaList: string[][] = [[]]; for (const page of store.pageList) { if (areaList.at(-1)!.length === columnNum) areaList.push([]); @@ -139,8 +143,7 @@ export const ComicImgFlow: Component = () => { }, 'grid-template-areas': gridAreas, 'grid-template-columns'() { - if (store.imgList.length === 0) return undefined; - if (store.gridMode) return `repeat(${isOnePageMode() ? 10 : 6}, 1fr)`; + if (store.imgList.length === 0 || store.gridMode) return undefined; if (store.page.vertical) return '50% 50%'; if (isAbreastMode()) return `repeat(${abreastArea().columns.length}, ${abreastColumnWidth()}px)`;