lensfx 0.1.2 → 0.1.4
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 +16 -0
- package/README.md +39 -0
- package/dist/cdn/lensfx.js +1717 -0
- package/dist/cdn/lensfx.js.map +1 -0
- package/dist/cdn/lensfx.min.js +371 -0
- package/dist/cdn/lensfx.min.js.map +1 -0
- package/dist/index.d.mts +6 -371
- package/dist/index.d.ts +6 -371
- package/dist/index.js +419 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +418 -6
- package/dist/index.mjs.map +1 -1
- package/dist/vanilla.d.mts +493 -0
- package/dist/vanilla.d.ts +493 -0
- package/dist/vanilla.js +1694 -0
- package/dist/vanilla.js.map +1 -0
- package/dist/vanilla.mjs +1675 -0
- package/dist/vanilla.mjs.map +1 -0
- package/package.json +28 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.4] - 2026-10-17
|
|
9
|
+
|
|
10
|
+
### Refactored
|
|
11
|
+
- Replaced internal `AaveGlass` with `src/primitives/Lens.tsx` as the core primitive component.
|
|
12
|
+
- Removed legacy `src/lib/glass/` directory and updated all internal component imports to `{ Lens }` from `../primitives/Lens`.
|
|
13
|
+
|
|
14
|
+
## [0.1.3] - 2026-10-17
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- 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`).
|
|
18
|
+
- 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.
|
|
19
|
+
- Subpath exports `"lensfx/vanilla"` and `"lensfx/cdn"` in `package.json`.
|
|
20
|
+
- Standard CDN distribution fields (`unpkg`, `jsdelivr`) pointing to `dist/cdn/lensfx.min.js`.
|
|
21
|
+
- Made peer dependencies (`react`, `react-dom`, `framer-motion`) optional for vanilla JS consumers.
|
|
22
|
+
- Live standalone CDN showcase demo (`examples/cdn-demo.html`).
|
|
23
|
+
|
|
8
24
|
## [0.1.2] - 2026-10-17
|
|
9
25
|
|
|
10
26
|
### 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)
|