pdf-flipbook 1.4.0 → 1.8.0

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.
@@ -1,188 +1,107 @@
1
- /* ============================================================
2
- pdf-flipbook — styles
3
- Import via: import 'pdf-flipbook/style.css'
4
- ============================================================ */
1
+ /* pdf-flipbook styles */
5
2
 
6
- /* ── Reset / Container ─────────────────────────────────────── */
7
3
  .pfb {
8
4
  --pfb-bg: #1a1a2e;
9
- --pfb-book-shadow: 0 30px 80px rgba(0,0,0,.6);
10
- --pfb-spine-color: #0f0f1a;
11
- --pfb-spine-width: 12px;
12
- --pfb-page-bg: #fdfaf5;
13
- --pfb-toolbar-bg: rgba(10, 10, 20, 0.92);
5
+ --pfb-toolbar-bg: rgba(10,10,20,0.92);
14
6
  --pfb-toolbar-color: #e8e0d0;
15
- --pfb-btn-bg: rgba(255,255,255,.08);
16
- --pfb-btn-hover-bg: rgba(255,255,255,.18);
17
- --pfb-btn-color: #e8e0d0;
7
+ --pfb-btn-bg: rgba(255,255,255,.1);
8
+ --pfb-btn-hover-bg: rgba(255,255,255,.22);
9
+ --pfb-btn-color: #ffffff;
18
10
  --pfb-accent: #c9a96e;
19
- --pfb-radius: 4px;
20
- --pfb-flip-z: 600px;
21
- --pfb-duration: 0.7s;
22
11
 
23
12
  display: flex;
24
13
  flex-direction: column;
25
- align-items: center;
26
- gap: 0;
27
14
  width: 100%;
28
15
  background: var(--pfb-bg);
29
- font-family: 'Georgia', 'Times New Roman', serif;
16
+ font-family: 'Georgia', serif;
30
17
  -webkit-font-smoothing: antialiased;
31
18
  box-sizing: border-box;
32
19
  user-select: none;
33
20
  -webkit-user-select: none;
34
21
  }
35
22
 
36
- .pfb *,
37
- .pfb *::before,
38
- .pfb *::after {
39
- box-sizing: inherit;
40
- }
41
-
42
- /* ── Light theme ────────────────────────────────────────────── */
43
23
  .pfb--light {
44
- --pfb-bg: #e8e4dc;
45
- --pfb-toolbar-bg: rgba(240,236,228,0.96);
46
- --pfb-toolbar-color: #3a3028;
47
- --pfb-btn-bg: rgba(0,0,0,.07);
48
- --pfb-btn-hover-bg: rgba(0,0,0,.14);
49
- --pfb-btn-color: #3a3028;
50
- --pfb-book-shadow: 0 20px 60px rgba(0,0,0,.3);
24
+ --pfb-bg: #2a2a2a;
25
+ --pfb-toolbar-bg: rgba(30,30,30,0.95);
26
+ --pfb-toolbar-color: #ffffff;
51
27
  }
52
28
 
53
- /* ── Stage ──────────────────────────────────────────────────── */
29
+ /* Stage fills full viewport */
54
30
  .pfb__stage {
55
- position: relative;
56
- width: 100%;
57
- display: flex;
31
+ position: relative;
32
+ width: 100%;
33
+ flex: 1;
34
+ min-height: 100vh;
35
+ display: flex;
58
36
  justify-content: center;
59
37
  align-items: center;
60
- padding: 32px 16px 20px;
61
- overflow: hidden;
62
- min-height: 300px;
63
- }
64
-
65
- /* ── Book ───────────────────────────────────────────────────── */
66
- .pfb__book {
67
- position: relative;
68
- display: flex;
69
- align-items: stretch;
70
- perspective: var(--pfb-flip-z);
71
- box-shadow: var(--pfb-book-shadow);
72
- max-width: min(92vw, 1100px);
73
- width: 100%;
74
- }
75
-
76
- /* ── Page panels ────────────────────────────────────────────── */
77
- .pfb__page {
78
- position: relative;
79
- flex: 1;
80
- transform-style: preserve-3d;
81
- transition: transform var(--pfb-duration) cubic-bezier(.645,.045,.355,1);
82
- overflow: hidden;
83
- min-height: 300px;
84
- }
85
-
86
- .pfb__page--left { transform-origin: right center; border-radius: var(--pfb-radius) 0 0 var(--pfb-radius); }
87
- .pfb__page--right { transform-origin: left center; border-radius: 0 var(--pfb-radius) var(--pfb-radius) 0; }
88
-
89
- /* ── Page faces (front / back) ──────────────────────────────── */
90
- .pfb__page-front,
91
- .pfb__page-back {
92
- position: absolute;
93
- inset: 0;
94
- background: var(--pfb-page-bg);
95
- backface-visibility: hidden;
96
- -webkit-backface-visibility: hidden;
97
38
  overflow: hidden;
39
+ /* Space for arrows on each side */
40
+ padding: 0 64px;
98
41
  }
99
42
 
100
- .pfb__page-back {
101
- transform: rotateY(180deg);
102
- }
103
-
104
- .pfb__page-front canvas,
105
- .pfb__page-back canvas {
43
+ .pfb__canvas {
106
44
  display: block;
107
- width: 100% !important;
108
- height: 100% !important;
109
- object-fit: contain;
110
- }
111
-
112
- .pfb__face--blank {
113
- background: linear-gradient(135deg, #fdfaf5 0%, #f0e8d8 100%);
114
- }
115
-
116
- /* ── Spine ──────────────────────────────────────────────────── */
117
- .pfb__spine {
118
- flex-shrink: 0;
119
- width: var(--pfb-spine-width);
120
- background: var(--pfb-spine-color);
121
- position: relative;
122
- z-index: 10;
123
- }
124
-
125
- .pfb__spine::before {
126
- content: '';
127
- position: absolute;
128
- inset: 0;
129
- background: linear-gradient(
130
- to right,
131
- rgba(255,255,255,.05) 0%,
132
- rgba(0,0,0,.4) 50%,
133
- rgba(255,255,255,.05) 100%
134
- );
135
- }
136
-
137
- /* ── Shadows ────────────────────────────────────────────────── */
138
- .pfb__shadow {
139
- position: absolute;
140
- inset: 0;
141
- pointer-events: none;
142
- opacity: 0;
143
- transition: opacity 0.1s linear;
144
- z-index: 5;
45
+ width: 100%;
46
+ height: 100%;
145
47
  }
146
48
 
147
- .pfb__shadow--left { background: linear-gradient(to left, rgba(0,0,0,.4), transparent 80%); }
148
- .pfb__shadow--right { background: linear-gradient(to right, rgba(0,0,0,.4), transparent 80%); }
149
-
150
- /* ── Nav arrow buttons (on stage) ───────────────────────────── */
49
+ /* Arrow buttons sit in the side padding */
151
50
  .pfb__btn {
152
- position: absolute;
153
- top: 50%;
154
- transform: translateY(-50%);
155
- width: 44px;
156
- height: 44px;
157
- border: none;
51
+ position: absolute;
52
+ top: 50%;
53
+ transform: translateY(-50%);
54
+ width: 48px;
55
+ height: 48px;
56
+ border: none;
158
57
  border-radius: 50%;
159
- background: var(--pfb-btn-bg);
160
- color: var(--pfb-btn-color);
161
- font-size: 20px;
162
- cursor: pointer;
163
- display: flex;
164
- align-items: center;
58
+ background: var(--pfb-btn-bg);
59
+ color: var(--pfb-btn-color);
60
+ font-size: 22px;
61
+ cursor: pointer;
62
+ display: flex;
63
+ align-items: center;
165
64
  justify-content: center;
166
- transition: background 0.2s, transform 0.2s, opacity 0.2s;
167
- z-index: 20;
168
- backdrop-filter: blur(4px);
169
- -webkit-backdrop-filter: blur(4px);
65
+ transition: background 0.2s, transform 0.15s;
66
+ z-index: 20;
67
+ backdrop-filter: blur(6px);
68
+ -webkit-backdrop-filter: blur(6px);
170
69
  }
171
70
 
172
- .pfb__btn--prev { left: 8px; }
173
- .pfb__btn--next { right: 8px; }
71
+ .pfb__btn--prev { left: 10px; }
72
+ .pfb__btn--next { right: 10px; }
174
73
 
175
74
  .pfb__btn:hover:not(:disabled) {
176
75
  background: var(--pfb-btn-hover-bg);
177
76
  transform: translateY(-50%) scale(1.1);
178
77
  }
179
78
 
180
- .pfb__btn:disabled {
181
- opacity: 0.2;
182
- cursor: not-allowed;
79
+ .pfb__btn:disabled { opacity: 0.2; cursor: not-allowed; }
80
+
81
+ /* Fullscreen button */
82
+ .pfb__btn--fs {
83
+ position: absolute;
84
+ bottom: 16px;
85
+ right: 16px;
86
+ width: 36px;
87
+ height: 36px;
88
+ border: none;
89
+ border-radius: 6px;
90
+ background: var(--pfb-btn-bg);
91
+ color: var(--pfb-btn-color);
92
+ font-size: 16px;
93
+ cursor: pointer;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ z-index: 20;
98
+ backdrop-filter: blur(6px);
99
+ -webkit-backdrop-filter: blur(6px);
100
+ transition: background 0.2s;
183
101
  }
102
+ .pfb__btn--fs:hover { background: var(--pfb-btn-hover-bg); }
184
103
 
185
- /* ── Toolbar ────────────────────────────────────────────────── */
104
+ /* Toolbar */
186
105
  .pfb__toolbar {
187
106
  width: 100%;
188
107
  display: flex;
@@ -199,7 +118,7 @@
199
118
  .pfb__tb-btn {
200
119
  width: 36px;
201
120
  height: 36px;
202
- border: 1px solid rgba(255,255,255,.12);
121
+ border: 1px solid rgba(255,255,255,.15);
203
122
  border-radius: 6px;
204
123
  background: var(--pfb-btn-bg);
205
124
  color: var(--pfb-toolbar-color);
@@ -210,7 +129,6 @@
210
129
  justify-content: center;
211
130
  transition: background 0.2s;
212
131
  }
213
-
214
132
  .pfb__tb-btn:hover:not(:disabled) { background: var(--pfb-btn-hover-bg); }
215
133
  .pfb__tb-btn:disabled { opacity: 0.25; cursor: not-allowed; }
216
134
 
@@ -218,26 +136,23 @@
218
136
  font-size: 13px;
219
137
  letter-spacing: 0.05em;
220
138
  color: var(--pfb-toolbar-color);
221
- min-width: 90px;
139
+ min-width: 100px;
222
140
  text-align: center;
223
- font-family: 'Georgia', serif;
224
141
  }
225
142
 
226
- /* ── Loader ─────────────────────────────────────────────────── */
143
+ /* Loader */
227
144
  .pfb__loader {
228
- position: absolute;
229
- inset: 0;
230
- display: flex;
231
- flex-direction: column;
232
- align-items: center;
145
+ position: absolute;
146
+ inset: 0;
147
+ display: flex;
148
+ flex-direction: column;
149
+ align-items: center;
233
150
  justify-content: center;
234
- gap: 16px;
235
- background: rgba(10,10,20,.85);
236
- z-index: 30;
151
+ gap: 16px;
152
+ background: rgba(10,10,20,.88);
153
+ z-index: 30;
237
154
  backdrop-filter: blur(4px);
238
- -webkit-backdrop-filter: blur(4px);
239
155
  }
240
-
241
156
  .pfb__loader[hidden] { display: none; }
242
157
 
243
158
  .pfb__spinner {
@@ -248,19 +163,16 @@
248
163
  border-radius: 50%;
249
164
  animation: pfb-spin 0.9s linear infinite;
250
165
  }
251
-
252
- @keyframes pfb-spin {
253
- to { transform: rotate(360deg); }
254
- }
166
+ @keyframes pfb-spin { to { transform: rotate(360deg); } }
255
167
 
256
168
  .pfb__loader-text {
257
169
  font-size: 13px;
258
- color: var(--pfb-toolbar-color, #c9a96e);
170
+ color: #c9a96e;
259
171
  letter-spacing: 0.08em;
260
172
  text-transform: uppercase;
261
173
  }
262
174
 
263
- /* ── Error ──────────────────────────────────────────────────── */
175
+ /* Error */
264
176
  .pfb__error {
265
177
  position: absolute;
266
178
  inset: 0;
@@ -274,31 +186,24 @@
274
186
  background: rgba(10,10,20,.9);
275
187
  z-index: 30;
276
188
  }
277
-
278
189
  .pfb__error[hidden] { display: none; }
279
190
 
280
- /* ── Responsive ─────────────────────────────────────────────── */
281
- @media (max-width: 640px) {
282
- /* On narrow screens show one page at a time */
283
- .pfb__book {
284
- max-width: min(96vw, 520px);
285
- }
286
-
287
- .pfb__page--left {
288
- display: none;
289
- }
290
-
291
- .pfb__spine {
292
- display: none;
293
- }
294
-
295
- .pfb__page--right {
296
- border-radius: var(--pfb-radius);
297
- }
191
+ /* Fullscreen mode */
192
+ .pfb:fullscreen,
193
+ .pfb:-webkit-full-screen {
194
+ width: 100vw;
195
+ height: 100vh;
196
+ }
197
+ .pfb:fullscreen .pfb__stage,
198
+ .pfb:-webkit-full-screen .pfb__stage {
199
+ min-height: 100vh;
200
+ height: 100vh;
201
+ }
298
202
 
299
- .pfb__btn {
300
- width: 38px;
301
- height: 38px;
302
- font-size: 16px;
303
- }
203
+ /* Mobile */
204
+ @media (max-width: 560px) {
205
+ .pfb__stage { padding: 0 48px; }
206
+ .pfb__btn { width: 38px; height: 38px; font-size: 18px; }
207
+ .pfb__btn--prev { left: 6px; }
208
+ .pfb__btn--next { right: 6px; }
304
209
  }