scrollcraft 2.0.9 → 2.0.10

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.
Files changed (2) hide show
  1. package/README.md +65 -18
  2. package/package.json +20 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Transform media into interactive web experiences.**
4
4
 
5
- ScrollCraft is a modern animation SDK built for the era of high-performance, agent-driven development. It allows you to transform standard video or images into web assets that precisely track subjects and depth.
5
+ [ScrollCraft](https://scrollcraft.dev) is a modern animation SDK built for the era of high-performance, agent-driven development. It allows you to transform standard video or images into web assets that precisely track subjects and depth.
6
6
 
7
7
  ---
8
8
 
@@ -18,7 +18,10 @@ npm install scrollcraft
18
18
 
19
19
  ScrollCraft features a **Universal Asset Pipeline** that runs identical logic in both the **CLI** (Node.js) and the **Browser** (ideal for CMS integrations like WordPress).
20
20
 
21
- ### 1. CLI Usage (Node.js)
21
+ ### 1. Asset Pipeline
22
+ Asset pipeline is used to transform video or images into ScrollCraft projects. It outputs a folder with optimized variants and a scrollcraft.json file that you point to in your ScrollCraftProvider in step 2. You can use the pipeline in the CLI, browser or node.
23
+
24
+ #### CLI Usage (Node.js)
22
25
  Transform your video into a ScrollCraft project from your terminal:
23
26
 
24
27
  ```bash
@@ -26,7 +29,7 @@ Transform your video into a ScrollCraft project from your terminal:
26
29
  npx scft create "your-video.mp4" --name "my-project" --track "apple" --cloud --depth
27
30
  ```
28
31
 
29
- ### 2. Programmatic Usage (Browser/Node)
32
+ #### Programmatic Usage (Browser/Node)
30
33
  You can also import the pipeline into your own React apps or dashboard:
31
34
 
32
35
  ```javascript
@@ -46,28 +49,72 @@ const project = await pipeline.create({
46
49
  });
47
50
  ```
48
51
 
49
- ---
52
+ ### 2. Rendering Integration
53
+
54
+ All you have to do now, is to drop the scrollcraft.json project into your ScrollCraftProvider.
55
+
56
+ #### Vanilla JS Integration
57
+ For full implementation, please refer to the [Vanilla JS Example](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/examples/html/index.html).
58
+
59
+ [Live Demo](https://example-html.scrollcraft.dev)
60
+
61
+ ```html
62
+ <!-- 2. Drop it into your HTML -->
63
+ <script type="module">
64
+ import ScrollCraft from 'scrollcraft/core';
65
+
66
+ document.addEventListener('DOMContentLoaded', async () => {
67
+ const orchestrators = await ScrollCraft.CoreOrchestrator.initAll();
68
+ });
69
+ </script>
70
+ ```
71
+
72
+
73
+ #### React Integration
74
+ For full implementation, please refer to the [React Integration Example](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/examples/create-next-app/src/app/page.tsx).
75
+
76
+ [Live Demo](https://example-next.scrollcraft.dev)
77
+
50
78
 
51
79
  ```tsx
52
80
  // 2. Drop it into your Next.js app
53
- import project from './my-project/scrollcraft.json';
54
- import { ScrollCraftProvider, ScrollCraftCanvas, SubjectLayer } from 'scrollcraft/react';
81
+ import myproject from './example-apple-project/scrollcraft.json';
82
+ import { ScrollCraftProvider, ScrollCraftCanvas, ScrollCraftLayer, ScrollCraftLayerTracking, useScrollCraft } from 'scrollcraft/react';
83
+
55
84
 
56
85
  const App = () => (
57
86
  <ScrollCraftProvider
58
- project={project}
59
- scrub={0.1} // Smooth interpolation (0 = instant, 1 = 1 second lag)
87
+ project={myproject}
60
88
  >
61
- <div style={{ height: '400vh' }}>
89
+ <ScrollCraftLayer>
62
90
  <ScrollCraftCanvas />
91
+ </ScrollCraftLayer>
63
92
 
64
- {/* Automatically follows the 'apple' tracked in the CLI */}
65
- <SubjectLayer id="main">
66
- <h2>Pinned Element</h2>
67
- </SubjectLayer>
68
- </div>
93
+ {/* Automatically follows the 'apple' tracked in the CLI */}
94
+ <ScrollCraftLayerTracking id="main">
95
+ <h2>Apple</h2>
96
+ </ScrollCraftLayerTracking>
97
+
98
+ {/* Shows frame number and animates opacity based on scroll progress */}
99
+ <ScrollCraftLayer align="bottom-left">
100
+ <AppleInfo />
101
+ </ScrollCraftLayer>
69
102
  </ScrollCraftProvider>
70
103
  );
104
+
105
+ const AppleInfo = () => {
106
+ const { progress, frame } = useScrollCraft();
107
+ const opacity = progress > 0.2 && progress < 0.5 ? 1 : 0;
108
+
109
+ return (
110
+ <>
111
+ <h2 style={{ fontSize: '3rem', margin: 0, color: "white" }}>Green Apple</h2>
112
+ <p style={{ opacity: 0.7, color: "white" }}>Frame: {frame}</p>
113
+ </>
114
+ );
115
+ };
116
+
117
+
71
118
  ```
72
119
 
73
120
  ---
@@ -77,13 +124,13 @@ const App = () => (
77
124
  Choose your path based on your role:
78
125
 
79
126
  ### 👤 For Humans
80
- - [**Core Architecture**](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/docs/content/architecture.md): Understand the state-snapshot engine.
81
- - [**Asset Pipeline**](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/docs/content/asset-pipeline.md): Learn how to use the CLI and AI tracking.
82
- - [**React Hooks**](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/docs/content/react-integration.md): Build custom interactive components.
127
+ - [**Core Architecture**](https://docs.scrollcraft.dev/architecture): Understand the state-snapshot engine.
128
+ - [**Asset Pipeline**](https://docs.scrollcraft.dev/asset-pipeline): Learn how to use the CLI and AI tracking.
129
+ - [**React Hooks**](https://docs.scrollcraft.dev/react-integration): Build custom interactive components.
83
130
 
84
131
  ### 🤖 For AI Agents
85
132
  - [**AGENTS.md**](https://github.com/aleskozelsky/scrollcraft/blob/main/AGENTS.md): Technical standard operating procedures for the repository.
86
- - [**AI Integration Protocol**](https://github.com/aleskozelsky/scrollcraft/blob/main/packages/docs/content/ai-integration.md): How to prompt agents to build scenes for you.
133
+ - [**AI Integration Protocol**](https://docs.scrollcraft.dev/ai-integration): How to prompt agents to build scenes for you.
87
134
 
88
135
  ---
89
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scrollcraft",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "ScrollCraft is a web-based tool for scroll-triggered animations.",
5
5
  "main": "dist/core/scrollcraft.umd.min.js",
6
6
  "module": "dist/core/scrollcraft.umd.min.js",
@@ -74,5 +74,23 @@
74
74
  "bugs": {
75
75
  "url": "https://github.com/aleskozelsky/scrollcraft/issues"
76
76
  },
77
- "homepage": "https://github.com/aleskozelsky/scrollcraft#readme"
77
+ "homepage": "https://github.com/aleskozelsky/scrollcraft#readme",
78
+ "devDependencies": {
79
+ "@types/fluent-ffmpeg": "^2.1.28",
80
+ "@types/node": "^20.0.0",
81
+ "@types/react": "^18.0.0",
82
+ "@types/react-dom": "^18.0.0",
83
+ "chalk": "^4.1.2",
84
+ "clean-webpack-plugin": "^4.0.0",
85
+ "concurrently": "^8.2.0",
86
+ "css-loader": "^6.8.0",
87
+ "style-loader": "^3.3.0",
88
+ "terser-webpack-plugin": "^5.3.10",
89
+ "ts-loader": "^9.5.0",
90
+ "typescript": "^5.3.0",
91
+ "webpack": "^5.90.0",
92
+ "webpack-cli": "^5.1.0",
93
+ "@types/fs-extra": "^11.0.4",
94
+ "@types/sharp": "^0.31.1"
95
+ }
78
96
  }