paginar 0.1.2 → 0.1.4
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/demo/slot/slot-chapter1.html +177 -177
- package/dist/index.es.js +134 -4
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +8 -3
- package/package.json +1 -1
- package/src/assets/main.css +8 -1
- package/src/components/ReaderWrapper.vue +23 -2
- package/src/composables/useReaderSettings.js +20 -0
- package/src/tailwind.css +8 -3
- package/tailwind.config.js +5 -1
package/dist/style.css
CHANGED
|
@@ -800,9 +800,9 @@ video {
|
|
|
800
800
|
padding-right: 2.5rem;
|
|
801
801
|
}
|
|
802
802
|
|
|
803
|
-
.px-
|
|
804
|
-
padding-left:
|
|
805
|
-
padding-right:
|
|
803
|
+
.px-2 {
|
|
804
|
+
padding-left: 0.5rem;
|
|
805
|
+
padding-right: 0.5rem;
|
|
806
806
|
}
|
|
807
807
|
|
|
808
808
|
.py-3 {
|
|
@@ -989,4 +989,9 @@ video {
|
|
|
989
989
|
.md\:w-2\/5 {
|
|
990
990
|
width: 40%;
|
|
991
991
|
}
|
|
992
|
+
|
|
993
|
+
.md\:px-24 {
|
|
994
|
+
padding-left: 6rem;
|
|
995
|
+
padding-right: 6rem;
|
|
996
|
+
}
|
|
992
997
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "A flipping page web component for reading long texts on the brower",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.4",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/educkf/paginar.git"
|
package/src/assets/main.css
CHANGED
|
@@ -106,7 +106,7 @@ header.wrapper {
|
|
|
106
106
|
.viewer-nav {
|
|
107
107
|
height: 100%;
|
|
108
108
|
|
|
109
|
-
@apply
|
|
109
|
+
@apply relative z-10 inset-y-0 transition duration-500 ease-in-out self-center w-10 cursor-pointer flex-shrink-0;
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
&:focus,
|
|
@@ -125,6 +125,13 @@ header.wrapper {
|
|
|
125
125
|
.viewer-nav-icon {
|
|
126
126
|
@apply opacity-0 md:opacity-80;
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
.columnsArea {
|
|
130
|
+
@media only screen and (max-width: 600px) {
|
|
131
|
+
transition: margin 100ms;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
128
135
|
/* slider */
|
|
129
136
|
|
|
130
137
|
.slider-target,.slider-target *{
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { usePointerSwipe, useWindowSize } from '@vueuse/core'
|
|
4
|
+
|
|
2
5
|
import usePagination from '../composables/usePagination'
|
|
3
6
|
import useReaderSettings from '../composables/useReaderSettings'
|
|
4
7
|
|
|
5
8
|
const { columns } = useReaderSettings
|
|
6
9
|
const { currentPage } = usePagination
|
|
10
|
+
|
|
11
|
+
const el = ref(null)
|
|
12
|
+
|
|
13
|
+
const { width } = useWindowSize()
|
|
14
|
+
const { distanceX } = usePointerSwipe(el, {
|
|
15
|
+
onSwipeEnd() {
|
|
16
|
+
if (width.value < 600) {
|
|
17
|
+
if (distanceX.value > 100) {
|
|
18
|
+
usePagination.next()
|
|
19
|
+
}
|
|
20
|
+
if (distanceX.value < -100) {
|
|
21
|
+
usePagination.prev()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
7
27
|
</script>
|
|
8
28
|
|
|
9
29
|
<template>
|
|
10
|
-
<div :class="columns" :style="`margin-left: -${100 * (currentPage - 1)}%`">
|
|
30
|
+
<div ref="el" class="columnsArea" :class="columns" :style="`margin-left: -${100 * (currentPage - 1)}%`">
|
|
11
31
|
<div class="[ typeArea ] h-full relative
|
|
12
|
-
transition-opacity duration-100 opacity-100 px-24
|
|
32
|
+
transition-opacity duration-100 opacity-100 px-2 md:px-24
|
|
33
|
+
">
|
|
13
34
|
<slot></slot>
|
|
14
35
|
</div>
|
|
15
36
|
</div>
|
|
@@ -78,6 +78,14 @@ function loadSavedSettings(settings) {
|
|
|
78
78
|
) {
|
|
79
79
|
state.textFont = savedSettings.textFont
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
if (savedSettings.mode === 'dark') {
|
|
83
|
+
const htmlRoot = document.querySelector('html')
|
|
84
|
+
if (htmlRoot) {
|
|
85
|
+
htmlRoot.classList.remove("light")
|
|
86
|
+
htmlRoot.classList.add("dark")
|
|
87
|
+
}
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
|
|
@@ -95,6 +103,18 @@ function setFontSize(value) {
|
|
|
95
103
|
|
|
96
104
|
function setMode(value) {
|
|
97
105
|
state.mode = value
|
|
106
|
+
|
|
107
|
+
const htmlRoot = document.querySelector('html')
|
|
108
|
+
if (htmlRoot) {
|
|
109
|
+
if (htmlRoot.classList.contains("dark")) {
|
|
110
|
+
htmlRoot.classList.remove("dark")
|
|
111
|
+
htmlRoot.classList.add("light")
|
|
112
|
+
|
|
113
|
+
} else {
|
|
114
|
+
htmlRoot.classList.remove("light")
|
|
115
|
+
htmlRoot.classList.add("dark")
|
|
116
|
+
}
|
|
117
|
+
}
|
|
98
118
|
}
|
|
99
119
|
|
|
100
120
|
function saveSettings() {
|
package/src/tailwind.css
CHANGED
|
@@ -800,9 +800,9 @@ video {
|
|
|
800
800
|
padding-right: 2.5rem;
|
|
801
801
|
}
|
|
802
802
|
|
|
803
|
-
.px-
|
|
804
|
-
padding-left:
|
|
805
|
-
padding-right:
|
|
803
|
+
.px-2 {
|
|
804
|
+
padding-left: 0.5rem;
|
|
805
|
+
padding-right: 0.5rem;
|
|
806
806
|
}
|
|
807
807
|
|
|
808
808
|
.py-3 {
|
|
@@ -989,4 +989,9 @@ video {
|
|
|
989
989
|
.md\:w-2\/5 {
|
|
990
990
|
width: 40%;
|
|
991
991
|
}
|
|
992
|
+
|
|
993
|
+
.md\:px-24 {
|
|
994
|
+
padding-left: 6rem;
|
|
995
|
+
padding-right: 6rem;
|
|
996
|
+
}
|
|
992
997
|
}
|