leafthrough 0.1.0 → 0.1.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/README.md +3 -1
- package/dist/LeafThrough.d.ts +2 -0
- package/dist/{chunk-U2OBPSZN.js → chunk-DQL4R32K.js} +60 -11
- package/dist/chunk-DQL4R32K.js.map +1 -0
- package/dist/element.js +1 -1
- package/dist/engine.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/options.d.ts +4 -3
- package/dist/plain/PlainEngine.d.ts +4 -0
- package/dist/react.js +1 -1
- package/dist/single/SingleEngine.d.ts +6 -0
- package/dist/spread/SpreadEngine.d.ts +4 -0
- package/dist/svelte.js +1 -1
- package/dist/textures.d.ts +6 -2
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-U2OBPSZN.js.map +0 -1
package/dist/options.d.ts
CHANGED
|
@@ -135,9 +135,10 @@ export interface LeafThroughOptions {
|
|
|
135
135
|
/** Upper limit for the canvas pixel ratio. Default `2`. */
|
|
136
136
|
maxPixelRatio?: number;
|
|
137
137
|
/**
|
|
138
|
-
* How many pages either side of the visible ones to load ahead.
|
|
139
|
-
*
|
|
140
|
-
*
|
|
138
|
+
* How many pages either side of the visible ones to load ahead. Visible means on screen:
|
|
139
|
+
* pages mid-turn count, and in `single` so do read pages still rolled up behind the magazine.
|
|
140
|
+
* Pages more than twice as far away are unloaded, which frees their memory. `Infinity` loads
|
|
141
|
+
* and keeps every page. Default `6`.
|
|
141
142
|
*/
|
|
142
143
|
preload?: number;
|
|
143
144
|
/**
|
|
@@ -27,6 +27,10 @@ export declare class PlainEngine implements Engine {
|
|
|
27
27
|
constructor(ctx: PlainEngineContext);
|
|
28
28
|
get position(): number;
|
|
29
29
|
get turning(): boolean;
|
|
30
|
+
pagesInView(): {
|
|
31
|
+
from: number;
|
|
32
|
+
to: number;
|
|
33
|
+
};
|
|
30
34
|
get activeSide(): "both" | "left" | "right";
|
|
31
35
|
update(): boolean;
|
|
32
36
|
flip(forward: boolean): boolean;
|
package/dist/react.js
CHANGED
|
@@ -22,6 +22,7 @@ export declare class SingleEngine implements Engine {
|
|
|
22
22
|
private readonly fallDuration;
|
|
23
23
|
private readonly abort;
|
|
24
24
|
private current;
|
|
25
|
+
private turned;
|
|
25
26
|
private flights;
|
|
26
27
|
private drag;
|
|
27
28
|
private press;
|
|
@@ -38,6 +39,11 @@ export declare class SingleEngine implements Engine {
|
|
|
38
39
|
get position(): number;
|
|
39
40
|
get turning(): boolean;
|
|
40
41
|
readonly activeSide = "both";
|
|
42
|
+
pagesInView(): {
|
|
43
|
+
from: number;
|
|
44
|
+
to: number;
|
|
45
|
+
};
|
|
46
|
+
private pileTop;
|
|
41
47
|
setPageTexture(page: number, texture: THREE.Texture): void;
|
|
42
48
|
dispose(): void;
|
|
43
49
|
private randomWobble;
|
|
@@ -35,6 +35,10 @@ export declare class SpreadEngine implements Engine {
|
|
|
35
35
|
constructor(ctx: EngineContext);
|
|
36
36
|
get position(): number;
|
|
37
37
|
get turning(): boolean;
|
|
38
|
+
pagesInView(): {
|
|
39
|
+
from: number;
|
|
40
|
+
to: number;
|
|
41
|
+
};
|
|
38
42
|
get activeSide(): "both" | "left" | "right";
|
|
39
43
|
setPageTexture(page: number, texture: THREE.Texture): void;
|
|
40
44
|
dispose(): void;
|
package/dist/svelte.js
CHANGED
package/dist/textures.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare class PageLoader {
|
|
|
24
24
|
private first;
|
|
25
25
|
private from;
|
|
26
26
|
private to;
|
|
27
|
+
private around;
|
|
27
28
|
private wrap;
|
|
28
29
|
private waiting;
|
|
29
30
|
private settleFirst;
|
|
@@ -34,8 +35,11 @@ export declare class PageLoader {
|
|
|
34
35
|
* within reach are in (or failed).
|
|
35
36
|
*/
|
|
36
37
|
start(from: number, to: number, first: number[]): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Follows the reader: loads around the pages in view (`from`–`to`), the page being read
|
|
40
|
+
* (`around`) first, and unloads pages left far behind.
|
|
41
|
+
*/
|
|
42
|
+
focus(from: number, to?: number, around?: number): void;
|
|
39
43
|
setWrap(wrap: boolean): void;
|
|
40
44
|
setRadius(radius: number): void;
|
|
41
45
|
/** Loads the pages that failed again. */
|
package/dist/vue.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leafthrough",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A 3D magazine you can flip through, with paper that bends, rolls and casts shadows. Built on three.js, with React, Vue, Svelte and Web Component bindings.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"magazine",
|