Skip to content

Commit 2591077

Browse files
committed
feat: 拖拽优化
1 parent 4b97789 commit 2591077

3 files changed

Lines changed: 334 additions & 25 deletions

File tree

src/components/stateless/InteractiveBook/InteractiveBook.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ interface BookPage {
128128

129129
组件支持多种翻页交互方式:
130130

131-
| 交互方式 | 说明 |
132-
|---------|------|
133-
| 拖拽翻页 | 在页面上按住并左右拖拽,超过阈值后松手翻页 |
134-
| 页角点击 | 鼠标悬停在页面右下角/左下角,出现卷起效果后点击翻页 |
135-
| 导航栏按钮 | 底部导航栏的前后翻页按钮 |
136-
| 键盘快捷键 | 方向键、Home、End、Escape |
137-
| 封面点击/拖拽 | 点击或向左拖拽封面打开书籍 |
131+
| 交互方式 | 说明 |
132+
| ------------- | --------------------------------------------------- |
133+
| 拖拽翻页 | 在页面上按住并左右拖拽,超过阈值后松手翻页 |
134+
| 页角点击 | 鼠标悬停在页面右下角/左下角,出现卷起效果后点击翻页 |
135+
| 导航栏按钮 | 底部导航栏的前后翻页按钮 |
136+
| 键盘快捷键 | 方向键、Home、End、Escape |
137+
| 封面点击/拖拽 | 点击或向左拖拽封面打开书籍 |
138138

139139
> **注意**:最后一页(结束页)禁用拖拽,鼠标光标恢复为普通箭头。
140140

src/components/stateless/InteractiveBook/index.module.less

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
perspective: 2000px;
77
width: 100%;
88
height: auto;
9-
padding-bottom: 120px;
9+
padding: 48px 80px 140px;
10+
box-sizing: border-box;
1011
}
1112

1213
.emptyState {
@@ -619,8 +620,9 @@
619620
position: absolute;
620621
width: 0;
621622
height: 0;
622-
transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
623-
height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
623+
transition:
624+
width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
625+
height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
624626
}
625627

626628
.curlShadow {
@@ -639,7 +641,9 @@
639641
white-space: nowrap;
640642
opacity: 0;
641643
transform: scale(0.8);
642-
transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
644+
transition:
645+
opacity 0.25s ease 0.1s,
646+
transform 0.25s ease 0.1s;
643647
pointer-events: none;
644648
}
645649

@@ -825,4 +829,4 @@
825829
background: #f5f5f5;
826830
color: #bbb;
827831
font-size: 14px;
828-
}
832+
}

0 commit comments

Comments
 (0)