diff --git a/src/components/MaskedScroll.tsx b/src/components/MaskedScroll.tsx index a9f4775e..d6ef58d4 100644 --- a/src/components/MaskedScroll.tsx +++ b/src/components/MaskedScroll.tsx @@ -4,7 +4,7 @@ import useMaskedScroll, { MaskedScrollExternalProps } from './useMaskedScroll'; export default function MaskedScroll({ direction = 'vertical', - fadeHeight, + fadeSize, hideScrollbar, className, style, @@ -16,7 +16,7 @@ MaskedScrollExternalProps & { }) { const ref = useRef(null); - const { maskImage } = useMaskedScroll({ ref, direction, fadeHeight }); + const { maskImage } = useMaskedScroll({ ref, direction, fadeSize }); return
{ + const ref = containerRef?.current; + const rect = ref?.getClientRects()[0]; + if (ref && rect) { + ref.scrollTo({ left: rect.right }); + } + }, [containerRef]); + const maskImage = useMemo(() => { let mask = `linear-gradient(to ${isVertical ? 'bottom' : 'right'}, `; mask += 'transparent, black '; - mask += `${!position.start ? fadeHeight : 0}px, black calc(100% - `; - mask += `${!position.end ? fadeHeight : 0}px), transparent)`; + mask += `${!position.start ? fadeSize : 0}px, black calc(100% - `; + mask += `${!position.end ? fadeSize : 0}px), transparent)`; return mask; - }, [fadeHeight, isVertical, position]); + }, [fadeSize, isVertical, position]); return { maskImage, updateMask }; } diff --git a/src/photo/PhotoGridPageClient.tsx b/src/photo/PhotoGridPageClient.tsx index 66580b2c..31dd4db4 100644 --- a/src/photo/PhotoGridPageClient.tsx +++ b/src/photo/PhotoGridPageClient.tsx @@ -40,7 +40,7 @@ export default function PhotoGridPageClient({ 'sticky top-0 -mb-5 -mt-5', 'max-h-screen py-4', )} - fadeHeight={36} + fadeSize={36} hideScrollbar > -
- {shortenUrl(pathShare)} -
+ +
+ {shortenUrl(pathShare)} +
+
{renderIcon( , () => { diff --git a/src/utility/cookie.ts b/src/utility/cookie.ts index bec62ea2..4b3f0929 100644 --- a/src/utility/cookie.ts +++ b/src/utility/cookie.ts @@ -8,7 +8,6 @@ export const storeCookie = ( sameSite = 'Lax', ) => { if (typeof document !== 'undefined') { - console.log('storeCookie', name, value); document.cookie = `${name}=${value};Path=${path};Max-Age=${maxAge};SameSite=${sameSite}`; }