@makefully/fancifully 0.4.1 → 0.5.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.
- package/CHANGELOG.md +11 -0
- package/README.md +8 -6
- package/dist/fancifully.css +1 -1
- package/dist/fancifully.iife.js +2 -2
- package/dist/fancifully.js +1107 -1057
- package/dist/flip/DefaultFlipStyle.d.ts +2 -0
- package/dist/flip/DefaultFlipStyle.d.ts.map +1 -1
- package/dist/flip/FlipStyle.d.ts +8 -0
- package/dist/flip/FlipStyle.d.ts.map +1 -1
- package/dist/flip/index.d.ts +2 -2
- package/dist/flip/index.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/nav/Pager.d.ts.map +1 -1
- package/dist/nav/layoutMode.d.ts +18 -8
- package/dist/nav/layoutMode.d.ts.map +1 -1
- package/dist/render/SpreadView.d.ts +3 -1
- package/dist/render/SpreadView.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.5.0]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Reader layouts `single-right` and `single-left`: one page per turn fixed on that side with a blank mate offscreen
|
|
10
|
+
- Default flip peels the content leaf for both next and prev in fixed-side modes (`FlipContext.contentSide`)
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Classic `single` remains alternate left/right; `responsive` / `auto` still resolve to classic `single` or `two-page`
|
|
15
|
+
|
|
5
16
|
## [0.4.1]
|
|
6
17
|
|
|
7
18
|
### Changed
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ const book = await Storybook.create(document.getElementById('app')!, {
|
|
|
36
36
|
book.next();
|
|
37
37
|
book.prev();
|
|
38
38
|
book.playReadAloud();
|
|
39
|
-
book.setLayoutMode('responsive'); // reader setting:
|
|
39
|
+
book.setLayoutMode('responsive'); // reader setting: single* | two-page | responsive | auto
|
|
40
40
|
book.setFlipSpeed(300);
|
|
41
41
|
book.setFlipStyle('default');
|
|
42
42
|
```
|
|
@@ -79,16 +79,18 @@ Single page vs facing spread is a **host setting**, like flip style. Stories sto
|
|
|
79
79
|
|
|
80
80
|
| API | Role |
|
|
81
81
|
|-----|------|
|
|
82
|
-
| `StorybookOptions.layoutMode` | `single`, `two-page`, `responsive`, or `auto` (default) |
|
|
82
|
+
| `StorybookOptions.layoutMode` | `single`, `single-right`, `single-left`, `two-page`, `responsive`, or `auto` (default) |
|
|
83
83
|
| `StorybookOptions.singleBreakpoint` | Width where `auto` switches to two-page (default `900`) |
|
|
84
84
|
| `book.setLayoutMode` | Change at runtime |
|
|
85
85
|
| `book.layoutPreference` | The host mode, before it resolves |
|
|
86
|
-
| `book.layoutMode` | Resolved
|
|
86
|
+
| `book.layoutMode` | Resolved one-page mode or `two-page` |
|
|
87
87
|
|
|
88
88
|
- **`two-page`**: facing pairs. With a front cover, open spreads start after the cover.
|
|
89
|
-
- **`single`**: one story page per turn
|
|
90
|
-
- **`
|
|
91
|
-
- **`
|
|
89
|
+
- **`single`**: one story page per turn; content alternates left/right with a blank mate offscreen (classic verso/recto).
|
|
90
|
+
- **`single-right`**: one page per turn, always on the right; blank left offscreen. Both next and prev peel the right leaf.
|
|
91
|
+
- **`single-left`**: one page per turn, always on the left; blank right offscreen. Both next and prev peel the left leaf.
|
|
92
|
+
- **`responsive`**: landscape (width ≥ height) → two-page; portrait → classic `single`.
|
|
93
|
+
- **`auto`**: two-page when the stage is at least `singleBreakpoint` wide; else classic `single`.
|
|
92
94
|
|
|
93
95
|
When the resolved mode changes, spreads rebuild and the view jumps to the spread that contains the current page.
|
|
94
96
|
|
package/dist/fancifully.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.fc-root{--fc-bg: #e8e2d6;--fc-page-bg: #faf6ef;--fc-ink: #1f1a14;--fc-accent: #c45c26;--fc-cue-active-bg: rgba(196, 92, 38, .28);--fc-cue-read-bg: rgba(196, 92, 38, .12);--fc-chrome-bg: rgba(31, 26, 20, .88);--fc-chrome-fg: #faf6ef;--fc-chrome-padding: .65rem;--fc-captions-bg: rgba(31, 26, 20, .82);--fc-captions-fg: #fff;--fc-captions-bottom: 4.5rem;--fc-btn-border: rgba(250, 246, 239, .35);--fc-btn-hover-bg: rgba(250, 246, 239, .12);--fc-btn-read-bg: var(--fc-accent);--fc-btn-read-fg: #fff;--fc-btn-prev-image: none;--fc-btn-next-image: none;--fc-btn-read-image: none;--fc-btn-image-size: 3.5rem;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:360px;background:var(--fc-bg);color:var(--fc-ink);font-family:inherit;outline:none;overflow:hidden}.fc-root *,.fc-root *:before,.fc-root *:after{box-sizing:border-box}.fc-stage{position:relative;flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:pan-y}.fc-stage.fc-stage-scroll{overflow:auto;align-items:safe center;justify-content:safe center}.fc-stage.fc-stage-fit-page{overflow-x:auto;overflow-y:hidden;align-items:center;justify-content:safe center}.fc-spread-viewport{--fc-hardback-overhang-x: 0px;--fc-hardback-overhang-y: 0px;position:relative;flex-shrink:0;overflow:hidden}.fc-spread-viewport-single{overflow:hidden}.fc-hardback{position:absolute;left:0;top:0;display:flex;flex-direction:row;pointer-events:none;z-index:0;will-change:transform}.fc-hardback-board{position:relative;flex:0 0 auto;overflow:hidden;background:var(--fc-page-bg);box-shadow:inset 0 0 0 1px #1f1a141a}.fc-hardback-board-left{border-radius:6px 0 0 6px}.fc-hardback-board-right{border-radius:0 6px 6px 0;box-shadow:inset 0 0 0 1px #1f1a141a,-4px 0 14px #1f1a1424}.fc-hardback-page{width:100%;height:100%}.fc-spread-viewport.fc-hardback-open .fc-spread{position:absolute;z-index:1}.fc-spread{--fc-page-width: 768px;--fc-page-height: 1024px;--fc-flip-duration: .4s;position:relative;display:flex;flex-direction:row;transform-origin:left top;will-change:transform}.fc-leaf.fc-leaf-dimmed{visibility:hidden;pointer-events:none}.fc-leaf{position:relative;width:var(--fc-page-width);height:var(--fc-page-height);flex:0 0 auto;overflow:hidden;background:var(--fc-page-bg);box-shadow:inset 0 0 0 1px #1f1a1414}.fc-leaf-left{border-radius:4px 0 0 4px}.fc-leaf-right{border-radius:0 4px 4px 0;box-shadow:inset 0 0 0 1px #1f1a1414,-6px 0 18px #1f1a141f}.fc-spread.is-solo-cover .fc-leaf.is-cover-hidden{display:none}.fc-spread.is-solo-cover .fc-leaf{border-radius:4px;box-shadow:inset 0 0 0 1px #1f1a1414}.fc-page{position:relative;width:100%;height:100%;overflow:hidden}.fc-page-blank{background:transparent;box-shadow:none}.fc-block{position:absolute}.fc-block-text{z-index:2;line-height:1.35}.fc-block-text p,.fc-block-text h1,.fc-block-text h2,.fc-block-text h3,.fc-block-text h4,.fc-block-text h5,.fc-block-text h6{margin:0}.fc-block-image{z-index:1;overflow:hidden}.fc-block-image img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}.fc-block-hotspot{z-index:3;margin:0;padding:0;border:2px dashed transparent;background:transparent;cursor:pointer}.fc-block-hotspot:focus-visible{border-color:var(--fc-accent);outline:none}.fc-block-hotspot:hover{background:#c45c2614}.fc-block-area{z-index:4;overflow:hidden;pointer-events:auto}.fc-cue.is-active{background:var(--fc-cue-active-bg);border-radius:.15em}.fc-cue.is-read:not(.is-active){background:var(--fc-cue-read-bg);border-radius:.15em}.fc-captions{position:absolute;left:50%;bottom:var(--fc-captions-bottom);transform:translate(-50%);max-width:min(36rem,90%);padding:.4rem .75rem;border-radius:.35rem;background:var(--fc-captions-bg);color:var(--fc-captions-fg);font-size:.95rem;text-align:center;pointer-events:none;z-index:5}.fc-captions:empty,.fc-captions[hidden]{display:none}.fc-chrome{display:flex;gap:.5rem;justify-content:center;align-items:center;padding:var(--fc-chrome-padding);background:var(--fc-chrome-bg);color:var(--fc-chrome-fg)}.fc-chrome[hidden]{display:none}.fc-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;line-height:0}.fc-icon svg{display:block;width:1.15rem;height:1.15rem}.fc-btn-label--sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fc-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;border:1px solid var(--fc-btn-border);background-color:transparent;background-image:none;background-repeat:no-repeat;background-position:center;background-size:contain;color:inherit;font:inherit;font-size:.95rem;padding:.4rem .9rem;border-radius:.3rem;cursor:pointer}.fc-btn:hover,.fc-btn:focus-visible{background-color:var(--fc-btn-hover-bg);outline:none}.fc-btn:disabled,.fc-btn.is-disabled{opacity:.35;pointer-events:none;cursor:default}.fc-btn-prev{background-image:var(--fc-btn-prev-image)}.fc-btn-next{background-image:var(--fc-btn-next-image)}.fc-btn-read{background-color:var(--fc-btn-read-bg);background-image:var(--fc-btn-read-image);border-color:transparent;color:var(--fc-btn-read-fg)}.fc-chrome.fc-chrome--images .fc-btn{width:var(--fc-btn-image-size);height:var(--fc-btn-image-size);padding:0;border:none;background-color:transparent;color:transparent;font-size:0;line-height:0;overflow:hidden}.fc-chrome.fc-chrome--images .fc-btn .fc-icon,.fc-chrome.fc-chrome--images .fc-btn .fc-btn-label{display:none}.fc-chrome.fc-chrome--images .fc-btn:hover,.fc-chrome.fc-chrome--images .fc-btn:focus-visible{background-color:transparent;filter:brightness(1.08)}.fc-chrome.fc-chrome--images .fc-btn-read{background-color:transparent}.fc-spread.fc-turn-next .fc-leaf-right{animation:fc-flip-next var(--fc-flip-duration) ease forwards;transform-origin:left center}.fc-spread.fc-turn-prev .fc-leaf-left{animation:fc-flip-prev var(--fc-flip-duration) ease forwards;transform-origin:right center}@keyframes fc-flip-next{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(-90deg)}}@keyframes fc-flip-prev{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(90deg)}}.fc-block-image.lit{filter:brightness(1.15) saturate(1.1);box-shadow:0 0 24px #ffc85073}
|
|
1
|
+
.fc-root{--fc-bg: #e8e2d6;--fc-page-bg: #faf6ef;--fc-ink: #1f1a14;--fc-accent: #c45c26;--fc-cue-active-bg: rgba(196, 92, 38, .28);--fc-cue-read-bg: rgba(196, 92, 38, .12);--fc-chrome-bg: rgba(31, 26, 20, .88);--fc-chrome-fg: #faf6ef;--fc-chrome-padding: .65rem;--fc-captions-bg: rgba(31, 26, 20, .82);--fc-captions-fg: #fff;--fc-captions-bottom: 4.5rem;--fc-btn-border: rgba(250, 246, 239, .35);--fc-btn-hover-bg: rgba(250, 246, 239, .12);--fc-btn-read-bg: var(--fc-accent);--fc-btn-read-fg: #fff;--fc-btn-prev-image: none;--fc-btn-next-image: none;--fc-btn-read-image: none;--fc-btn-image-size: 3.5rem;box-sizing:border-box;position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:360px;background:var(--fc-bg);color:var(--fc-ink);font-family:inherit;outline:none;overflow:hidden}.fc-root *,.fc-root *:before,.fc-root *:after{box-sizing:border-box}.fc-stage{position:relative;flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:pan-y}.fc-stage.fc-stage-scroll{overflow:auto;align-items:safe center;justify-content:safe center}.fc-stage.fc-stage-fit-page{overflow-x:auto;overflow-y:hidden;align-items:center;justify-content:safe center}.fc-spread-viewport{--fc-hardback-overhang-x: 0px;--fc-hardback-overhang-y: 0px;position:relative;flex-shrink:0;overflow:hidden}.fc-spread-viewport-single{overflow:hidden}.fc-hardback{position:absolute;left:0;top:0;display:flex;flex-direction:row;pointer-events:none;z-index:0;will-change:transform}.fc-hardback-board{position:relative;flex:0 0 auto;overflow:hidden;background:var(--fc-page-bg);box-shadow:inset 0 0 0 1px #1f1a141a}.fc-hardback-board-left{border-radius:6px 0 0 6px}.fc-hardback-board-right{border-radius:0 6px 6px 0;box-shadow:inset 0 0 0 1px #1f1a141a,-4px 0 14px #1f1a1424}.fc-hardback-page{width:100%;height:100%}.fc-spread-viewport.fc-hardback-open .fc-spread{position:absolute;z-index:1}.fc-spread{--fc-page-width: 768px;--fc-page-height: 1024px;--fc-flip-duration: .4s;position:relative;display:flex;flex-direction:row;transform-origin:left top;will-change:transform}.fc-leaf.fc-leaf-dimmed{visibility:hidden;pointer-events:none}.fc-leaf{position:relative;width:var(--fc-page-width);height:var(--fc-page-height);flex:0 0 auto;overflow:hidden;background:var(--fc-page-bg);box-shadow:inset 0 0 0 1px #1f1a1414}.fc-leaf-left{border-radius:4px 0 0 4px}.fc-leaf-right{border-radius:0 4px 4px 0;box-shadow:inset 0 0 0 1px #1f1a1414,-6px 0 18px #1f1a141f}.fc-spread.is-solo-cover .fc-leaf.is-cover-hidden{display:none}.fc-spread.is-solo-cover .fc-leaf{border-radius:4px;box-shadow:inset 0 0 0 1px #1f1a1414}.fc-page{position:relative;width:100%;height:100%;overflow:hidden}.fc-page-blank{background:transparent;box-shadow:none}.fc-block{position:absolute}.fc-block-text{z-index:2;line-height:1.35}.fc-block-text p,.fc-block-text h1,.fc-block-text h2,.fc-block-text h3,.fc-block-text h4,.fc-block-text h5,.fc-block-text h6{margin:0}.fc-block-image{z-index:1;overflow:hidden}.fc-block-image img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}.fc-block-hotspot{z-index:3;margin:0;padding:0;border:2px dashed transparent;background:transparent;cursor:pointer}.fc-block-hotspot:focus-visible{border-color:var(--fc-accent);outline:none}.fc-block-hotspot:hover{background:#c45c2614}.fc-block-area{z-index:4;overflow:hidden;pointer-events:auto}.fc-cue.is-active{background:var(--fc-cue-active-bg);border-radius:.15em}.fc-cue.is-read:not(.is-active){background:var(--fc-cue-read-bg);border-radius:.15em}.fc-captions{position:absolute;left:50%;bottom:var(--fc-captions-bottom);transform:translate(-50%);max-width:min(36rem,90%);padding:.4rem .75rem;border-radius:.35rem;background:var(--fc-captions-bg);color:var(--fc-captions-fg);font-size:.95rem;text-align:center;pointer-events:none;z-index:5}.fc-captions:empty,.fc-captions[hidden]{display:none}.fc-chrome{display:flex;gap:.5rem;justify-content:center;align-items:center;padding:var(--fc-chrome-padding);background:var(--fc-chrome-bg);color:var(--fc-chrome-fg)}.fc-chrome[hidden]{display:none}.fc-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;line-height:0}.fc-icon svg{display:block;width:1.15rem;height:1.15rem}.fc-btn-label--sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.fc-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:.35rem;border:1px solid var(--fc-btn-border);background-color:transparent;background-image:none;background-repeat:no-repeat;background-position:center;background-size:contain;color:inherit;font:inherit;font-size:.95rem;padding:.4rem .9rem;border-radius:.3rem;cursor:pointer}.fc-btn:hover,.fc-btn:focus-visible{background-color:var(--fc-btn-hover-bg);outline:none}.fc-btn:disabled,.fc-btn.is-disabled{opacity:.35;pointer-events:none;cursor:default}.fc-btn-prev{background-image:var(--fc-btn-prev-image)}.fc-btn-next{background-image:var(--fc-btn-next-image)}.fc-btn-read{background-color:var(--fc-btn-read-bg);background-image:var(--fc-btn-read-image);border-color:transparent;color:var(--fc-btn-read-fg)}.fc-chrome.fc-chrome--images .fc-btn{width:var(--fc-btn-image-size);height:var(--fc-btn-image-size);padding:0;border:none;background-color:transparent;color:transparent;font-size:0;line-height:0;overflow:hidden}.fc-chrome.fc-chrome--images .fc-btn .fc-icon,.fc-chrome.fc-chrome--images .fc-btn .fc-btn-label{display:none}.fc-chrome.fc-chrome--images .fc-btn:hover,.fc-chrome.fc-chrome--images .fc-btn:focus-visible{background-color:transparent;filter:brightness(1.08)}.fc-chrome.fc-chrome--images .fc-btn-read{background-color:transparent}.fc-spread.fc-turn-next .fc-leaf-right{animation:fc-flip-next var(--fc-flip-duration) ease forwards;transform-origin:left center}.fc-spread.fc-turn-prev .fc-leaf-left{animation:fc-flip-prev var(--fc-flip-duration) ease forwards;transform-origin:right center}.fc-spread.fc-turn-next-right .fc-leaf-right{animation:fc-flip-next var(--fc-flip-duration) ease forwards;transform-origin:left center}.fc-spread.fc-turn-prev-right .fc-leaf-right{animation:fc-flip-prev-fixed-right var(--fc-flip-duration) ease forwards;transform-origin:left center}.fc-spread.fc-turn-next-left .fc-leaf-left{animation:fc-flip-next-fixed-left var(--fc-flip-duration) ease forwards;transform-origin:right center}.fc-spread.fc-turn-prev-left .fc-leaf-left{animation:fc-flip-prev var(--fc-flip-duration) ease forwards;transform-origin:right center}@keyframes fc-flip-next{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(-90deg)}}@keyframes fc-flip-prev{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(90deg)}}@keyframes fc-flip-prev-fixed-right{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(90deg)}}@keyframes fc-flip-next-fixed-left{0%{transform:perspective(1200px) rotateY(0)}to{transform:perspective(1200px) rotateY(-90deg)}}.fc-block-image.lit{filter:brightness(1.15) saturate(1.1);box-shadow:0 0 24px #ffc85073}
|