@airhang/vue-book-reader 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-book-reader.common.js +20 -6
- package/dist/vue-book-reader.common.js.map +1 -1
- package/dist/vue-book-reader.css +1 -1
- package/dist/vue-book-reader.umd.js +20 -6
- package/dist/vue-book-reader.umd.js.map +1 -1
- package/dist/vue-book-reader.umd.min.js +2 -2
- package/dist/vue-book-reader.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/BookReader.vue +60 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airhang/vue-book-reader",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A Vue.js book reader component with multiple flip modes, catalog, and page jump features",
|
|
5
5
|
"main": "dist/vue-book-reader.common.js",
|
|
6
6
|
"module": "dist/vue-book-reader.umd.js",
|
|
@@ -238,6 +238,12 @@
|
|
|
238
238
|
<button @click="resetZoom" class="btn-reset-zoom">重置</button>
|
|
239
239
|
</div>
|
|
240
240
|
</div>
|
|
241
|
+
|
|
242
|
+
<!-- PC端缩放工具栏 -->
|
|
243
|
+
<div v-if="!isMobile" class="zoom-toolbar">
|
|
244
|
+
<button @click="zoomOut" class="btn-zoom" :disabled="zoomScale <= 0.5">-</button>
|
|
245
|
+
<button @click="zoomIn" class="btn-zoom" :disabled="zoomScale >= 3">+</button>
|
|
246
|
+
</div>
|
|
241
247
|
|
|
242
248
|
<!-- 加载状态覆盖层 -->
|
|
243
249
|
<div v-if="loading" class="loading-overlay">
|
|
@@ -816,6 +822,20 @@ export default {
|
|
|
816
822
|
this.translateX = 0
|
|
817
823
|
this.translateY = 0
|
|
818
824
|
},
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* 放大
|
|
828
|
+
*/
|
|
829
|
+
zoomIn() {
|
|
830
|
+
this.zoomScale = Math.min(3, this.zoomScale + 0.2)
|
|
831
|
+
},
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* 缩小
|
|
835
|
+
*/
|
|
836
|
+
zoomOut() {
|
|
837
|
+
this.zoomScale = Math.max(0.5, this.zoomScale - 0.2)
|
|
838
|
+
},
|
|
819
839
|
|
|
820
840
|
/**
|
|
821
841
|
* PC端双击事件处理
|
|
@@ -2156,36 +2176,70 @@ export default {
|
|
|
2156
2176
|
color: rgba(255, 255, 255, 0.9);
|
|
2157
2177
|
}
|
|
2158
2178
|
|
|
2179
|
+
/* PC端缩放工具栏 */
|
|
2180
|
+
.zoom-toolbar {
|
|
2181
|
+
position: fixed;
|
|
2182
|
+
bottom: 20px;
|
|
2183
|
+
right: 20px;
|
|
2184
|
+
display: flex;
|
|
2185
|
+
gap: 8px;
|
|
2186
|
+
z-index: 10000;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
.btn-zoom {
|
|
2190
|
+
width: 40px;
|
|
2191
|
+
height: 40px;
|
|
2192
|
+
background: #333;
|
|
2193
|
+
color: white;
|
|
2194
|
+
border: 1px solid #666;
|
|
2195
|
+
border-radius: 4px;
|
|
2196
|
+
font-size: 1.2rem;
|
|
2197
|
+
cursor: pointer;
|
|
2198
|
+
transition: all 0.2s ease;
|
|
2199
|
+
display: flex;
|
|
2200
|
+
align-items: center;
|
|
2201
|
+
justify-content: center;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
.btn-zoom:hover:not(:disabled) {
|
|
2205
|
+
background: #555;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
.btn-zoom:disabled {
|
|
2209
|
+
opacity: 0.3;
|
|
2210
|
+
cursor: not-allowed;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2159
2213
|
/* 移动端按钮优化 */
|
|
2160
2214
|
@media (max-width: 768px) {
|
|
2161
2215
|
.btn:active {
|
|
2162
2216
|
background: #555;
|
|
2163
2217
|
transform: none;
|
|
2164
2218
|
}
|
|
2165
|
-
|
|
2219
|
+
|
|
2166
2220
|
.btn:hover:not(:disabled) {
|
|
2167
2221
|
background: #555;
|
|
2168
2222
|
transform: none;
|
|
2169
2223
|
}
|
|
2170
|
-
|
|
2224
|
+
|
|
2171
2225
|
.btn-catalogue {
|
|
2172
2226
|
padding: 8px 12px;
|
|
2173
2227
|
font-size: 0.8rem;
|
|
2174
2228
|
border-radius: 16px;
|
|
2175
2229
|
}
|
|
2176
|
-
|
|
2230
|
+
|
|
2177
2231
|
.btn-catalogue .drag-handle {
|
|
2178
2232
|
font-size: 16px;
|
|
2179
2233
|
}
|
|
2180
|
-
|
|
2234
|
+
|
|
2181
2235
|
.catalogue-icon {
|
|
2182
2236
|
font-size: 0.9rem;
|
|
2183
2237
|
}
|
|
2184
|
-
|
|
2238
|
+
|
|
2185
2239
|
.catalogue-text {
|
|
2186
2240
|
font-size: 0.8rem;
|
|
2187
2241
|
}
|
|
2188
|
-
|
|
2242
|
+
|
|
2189
2243
|
.zoom-hint {
|
|
2190
2244
|
top: 10px;
|
|
2191
2245
|
right: 10px;
|