pdf-flipbook 1.4.0 → 1.9.3

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,109 @@
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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-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%;
47
+ cursor: grab;
145
48
  }
49
+ .pfb__canvas:active { cursor: grabbing; }
146
50
 
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) ───────────────────────────── */
51
+ /* Arrow buttons sit in the side padding */
151
52
  .pfb__btn {
152
- position: absolute;
153
- top: 50%;
154
- transform: translateY(-50%);
155
- width: 44px;
156
- height: 44px;
157
- border: none;
53
+ position: absolute;
54
+ top: 50%;
55
+ transform: translateY(-50%);
56
+ width: 48px;
57
+ height: 48px;
58
+ border: none;
158
59
  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;
60
+ background: var(--pfb-btn-bg);
61
+ color: var(--pfb-btn-color);
62
+ font-size: 22px;
63
+ cursor: pointer;
64
+ display: flex;
65
+ align-items: center;
165
66
  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);
67
+ transition: background 0.2s, transform 0.15s;
68
+ z-index: 20;
69
+ backdrop-filter: blur(6px);
70
+ -webkit-backdrop-filter: blur(6px);
170
71
  }
171
72
 
172
- .pfb__btn--prev { left: 8px; }
173
- .pfb__btn--next { right: 8px; }
73
+ .pfb__btn--prev { left: 10px; }
74
+ .pfb__btn--next { right: 10px; }
174
75
 
175
76
  .pfb__btn:hover:not(:disabled) {
176
77
  background: var(--pfb-btn-hover-bg);
177
78
  transform: translateY(-50%) scale(1.1);
178
79
  }
179
80
 
180
- .pfb__btn:disabled {
181
- opacity: 0.2;
182
- cursor: not-allowed;
81
+ .pfb__btn:disabled { opacity: 0.2; cursor: not-allowed; }
82
+
83
+ /* Fullscreen button */
84
+ .pfb__btn--fs {
85
+ position: absolute;
86
+ bottom: 16px;
87
+ right: 16px;
88
+ width: 36px;
89
+ height: 36px;
90
+ border: none;
91
+ border-radius: 6px;
92
+ background: var(--pfb-btn-bg);
93
+ color: var(--pfb-btn-color);
94
+ font-size: 16px;
95
+ cursor: pointer;
96
+ display: flex;
97
+ align-items: center;
98
+ justify-content: center;
99
+ z-index: 20;
100
+ backdrop-filter: blur(6px);
101
+ -webkit-backdrop-filter: blur(6px);
102
+ transition: background 0.2s;
183
103
  }
104
+ .pfb__btn--fs:hover { background: var(--pfb-btn-hover-bg); }
184
105
 
185
- /* ── Toolbar ────────────────────────────────────────────────── */
106
+ /* Toolbar */
186
107
  .pfb__toolbar {
187
108
  width: 100%;
188
109
  display: flex;
@@ -199,7 +120,7 @@
199
120
  .pfb__tb-btn {
200
121
  width: 36px;
201
122
  height: 36px;
202
- border: 1px solid rgba(255,255,255,.12);
123
+ border: 1px solid rgba(255,255,255,.15);
203
124
  border-radius: 6px;
204
125
  background: var(--pfb-btn-bg);
205
126
  color: var(--pfb-toolbar-color);
@@ -210,7 +131,6 @@
210
131
  justify-content: center;
211
132
  transition: background 0.2s;
212
133
  }
213
-
214
134
  .pfb__tb-btn:hover:not(:disabled) { background: var(--pfb-btn-hover-bg); }
215
135
  .pfb__tb-btn:disabled { opacity: 0.25; cursor: not-allowed; }
216
136
 
@@ -218,26 +138,23 @@
218
138
  font-size: 13px;
219
139
  letter-spacing: 0.05em;
220
140
  color: var(--pfb-toolbar-color);
221
- min-width: 90px;
141
+ min-width: 100px;
222
142
  text-align: center;
223
- font-family: 'Georgia', serif;
224
143
  }
225
144
 
226
- /* ── Loader ─────────────────────────────────────────────────── */
145
+ /* Loader */
227
146
  .pfb__loader {
228
- position: absolute;
229
- inset: 0;
230
- display: flex;
231
- flex-direction: column;
232
- align-items: center;
147
+ position: absolute;
148
+ inset: 0;
149
+ display: flex;
150
+ flex-direction: column;
151
+ align-items: center;
233
152
  justify-content: center;
234
- gap: 16px;
235
- background: rgba(10,10,20,.85);
236
- z-index: 30;
153
+ gap: 16px;
154
+ background: rgba(10,10,20,.88);
155
+ z-index: 30;
237
156
  backdrop-filter: blur(4px);
238
- -webkit-backdrop-filter: blur(4px);
239
157
  }
240
-
241
158
  .pfb__loader[hidden] { display: none; }
242
159
 
243
160
  .pfb__spinner {
@@ -248,19 +165,16 @@
248
165
  border-radius: 50%;
249
166
  animation: pfb-spin 0.9s linear infinite;
250
167
  }
251
-
252
- @keyframes pfb-spin {
253
- to { transform: rotate(360deg); }
254
- }
168
+ @keyframes pfb-spin { to { transform: rotate(360deg); } }
255
169
 
256
170
  .pfb__loader-text {
257
171
  font-size: 13px;
258
- color: var(--pfb-toolbar-color, #c9a96e);
172
+ color: #c9a96e;
259
173
  letter-spacing: 0.08em;
260
174
  text-transform: uppercase;
261
175
  }
262
176
 
263
- /* ── Error ──────────────────────────────────────────────────── */
177
+ /* Error */
264
178
  .pfb__error {
265
179
  position: absolute;
266
180
  inset: 0;
@@ -274,31 +188,24 @@
274
188
  background: rgba(10,10,20,.9);
275
189
  z-index: 30;
276
190
  }
277
-
278
191
  .pfb__error[hidden] { display: none; }
279
192
 
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
- }
193
+ /* Fullscreen mode */
194
+ .pfb:fullscreen,
195
+ .pfb:-webkit-full-screen {
196
+ width: 100vw;
197
+ height: 100vh;
198
+ }
199
+ .pfb:fullscreen .pfb__stage,
200
+ .pfb:-webkit-full-screen .pfb__stage {
201
+ min-height: 100vh;
202
+ height: 100vh;
203
+ }
298
204
 
299
- .pfb__btn {
300
- width: 38px;
301
- height: 38px;
302
- font-size: 16px;
303
- }
205
+ /* Mobile */
206
+ @media (max-width: 560px) {
207
+ .pfb__stage { padding: 0 48px; }
208
+ .pfb__btn { width: 38px; height: 38px; font-size: 18px; }
209
+ .pfb__btn--prev { left: 6px; }
210
+ .pfb__btn--next { right: 6px; }
304
211
  }