lensfx 0.1.2 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to `lensfx` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.3] - 2026-10-17
9
+
10
+ ### Added
11
+ - Zero-dependency vanilla DOM engine: `createLens(target, options)` with real-time SVG displacement, chromatic aberration, pointer tracking (`interactive: true`), responsive auto-resizing via `ResizeObserver`, and dynamic lifecycle controls (`setPosition`, `update`, `destroy`).
12
+ - Standalone CDN IIFE builds (`dist/cdn/lensfx.min.js` and `dist/cdn/lensfx.js`) attaching to `window.lensfx` for direct `<script>` tag usage without bundlers or React.
13
+ - Subpath exports `"lensfx/vanilla"` and `"lensfx/cdn"` in `package.json`.
14
+ - Standard CDN distribution fields (`unpkg`, `jsdelivr`) pointing to `dist/cdn/lensfx.min.js`.
15
+ - Made peer dependencies (`react`, `react-dom`, `framer-motion`) optional for vanilla JS consumers.
16
+ - Live standalone CDN showcase demo (`examples/cdn-demo.html`).
17
+
8
18
  ## [0.1.2] - 2026-10-17
9
19
 
10
20
  ### Changed
package/README.md CHANGED
@@ -67,6 +67,45 @@ That's it. Zero configuration for a working lens.
67
67
 
68
68
  ---
69
69
 
70
+ ### Vanilla JS / Static HTML (via CDN — No React, No Bundler)
71
+
72
+ You don't need npm, React, or a bundler. Drop a `<script>` tag into any static `.html` file:
73
+
74
+ ```html
75
+ <!-- jsDelivr (always latest) -->
76
+ <script src="https://cdn.jsdelivr.net/npm/lensfx/dist/cdn/lensfx.min.js"></script>
77
+
78
+ <!-- or unpkg -->
79
+ <!-- <script src="https://unpkg.com/lensfx/dist/cdn/lensfx.min.js"></script> -->
80
+
81
+ <div id="card" style="width: 400px; height: 300px; position: relative;">
82
+ <h2>Refracted content</h2>
83
+ </div>
84
+
85
+ <script>
86
+ const lens = lensfx.createLens("#card", {
87
+ width: 200,
88
+ height: 120,
89
+ radius: 28,
90
+ depth: 2.5,
91
+ chroma: 0.7,
92
+ interactive: true, // tracks cursor automatically
93
+ });
94
+
95
+ // Dynamic API
96
+ // lens.setPosition(x, y);
97
+ // lens.update({ depth: 3 });
98
+ // lens.destroy();
99
+ </script>
100
+ ```
101
+
102
+ Or import the zero-dependency vanilla engine via npm:
103
+ ```ts
104
+ import { createLens } from "lensfx/vanilla";
105
+ ```
106
+
107
+ ---
108
+
70
109
  ## Components
71
110
 
72
111
  ### `<Lens>` — primitive (unstyled)