Skip to content

Commit 9b70e9b

Browse files
committed
fix: toc scroller and mask
Signed-off-by: Innei <[email protected]>
1 parent 7dc7e1d commit 9b70e9b

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

src/atoms/owner.ts

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const login = async (username?: string, password?: string) => {
5555
}
5656

5757
await refreshToken()
58-
toast(`欢迎回来,${jotaiStore.get(ownerAtom)?.name}`, 'success')
5958

6059
return true
6160
}

src/components/modules/toc/TocFAB.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const TocFAB = () => {
3434
content: () => (
3535
<TocTree
3636
$headings={$headings!}
37-
className="space-y-3 [&>li]:py-1"
37+
className="max-h-full space-y-3 overflow-y-auto [&>li]:py-1"
3838
onItemClick={() => {
3939
dispose()
4040
}}

src/components/ui/sheet/Sheet.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export const PresentSheet: FC<PropsWithChildren<PresentSheetProps>> = (
8787
style={{
8888
zIndex: contentZIndex,
8989
}}
90-
className="fixed inset-x-0 bottom-0 mt-24 flex max-h-[95vh] flex-col rounded-t-[10px] bg-base-100 p-4"
90+
className="fixed inset-x-0 bottom-0 flex max-h-[calc(100svh-5rem)] flex-col rounded-t-[10px] bg-base-100 p-4"
9191
>
9292
{dismissible && (
9393
<div className="mx-auto mb-8 h-1.5 w-12 shrink-0 rounded-full bg-zinc-300 dark:bg-neutral-800" />

src/styles/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99

1010
@import './theme.css';
1111
@import './webfont.css';
12+
@import './mask.css';

src/styles/mask.css

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.mask-both {
2+
mask-image: linear-gradient(
3+
rgba(255, 255, 255, 0) 0%,
4+
rgb(255, 255, 255) 20px,
5+
rgb(255, 255, 255) calc(100% - 20px),
6+
rgba(255, 255, 255, 0) 100%
7+
);
8+
}
9+
.mask-both-lg {
10+
mask-image: linear-gradient(
11+
rgba(255, 255, 255, 0) 0%,
12+
rgb(255, 255, 255) 50px,
13+
rgb(255, 255, 255) calc(100% - 50px),
14+
rgba(255, 255, 255, 0) 100%
15+
);
16+
}
17+
18+
.mask-b {
19+
mask-image: linear-gradient(
20+
rgb(255, 255, 255) calc(100% - 20px),
21+
rgba(255, 255, 255, 0) 100%
22+
);
23+
}
24+
25+
.mask-b-lg {
26+
mask-image: linear-gradient(
27+
rgb(255, 255, 255) calc(100% - 50px),
28+
rgba(255, 255, 255, 0) 100%
29+
);
30+
}
31+
32+
.mask-t {
33+
mask-image: linear-gradient(
34+
rgba(255, 255, 255, 0) 0%,
35+
rgb(255, 255, 255) 20px
36+
);
37+
}
38+
39+
.mask-t-lg {
40+
mask-image: linear-gradient(
41+
rgba(255, 255, 255, 0) 0%,
42+
rgb(255, 255, 255) 50px
43+
);
44+
}
45+
46+
.mask-horizontal {
47+
mask-image: linear-gradient(
48+
90deg,
49+
rgba(255, 255, 255, 0) 0%,
50+
rgba(255, 255, 255, 1) 14%,
51+
rgba(255, 255, 255, 1) 86%,
52+
rgba(255, 255, 255, 0) 100%
53+
);
54+
}

0 commit comments

Comments
 (0)