Skip to content

Commit 9bdb1ec

Browse files
author
梁朝飞
committed
feat: 增加注释
1 parent 9541ca1 commit 9bdb1ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/MotionThumb.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const calcThumbStyle = (
4848
};
4949

5050
if (vertical) {
51+
// Adjusts positioning and size for vertical layout by setting horizontal properties to 0 and using vertical properties from the style object.
5152
return {
5253
left: 0,
5354
right: 0,
@@ -141,6 +142,7 @@ export default function MotionThumb(props: MotionThumbInterface) {
141142

142143
// =========================== Motion ===========================
143144
const onAppearStart = () =>
145+
// Returns initial transform and size styles for the thumb based on the layout orientation (vertical or horizontal).
144146
vertical
145147
? {
146148
transform: 'translateY(var(--thumb-start-top))',
@@ -152,6 +154,7 @@ export default function MotionThumb(props: MotionThumbInterface) {
152154
};
153155

154156
const onAppearActive = () =>
157+
// Returns active transform and size styles for the thumb based on the layout orientation (vertical or horizontal).
155158
vertical
156159
? {
157160
transform: 'translateY(var(--thumb-active-top))',

0 commit comments

Comments
 (0)