@vanduo-oss/framework 1.3.4 → 1.3.5
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/LICENSE +0 -14
- package/README.md +33 -176
- package/css/components/tooltips.css +8 -8
- package/css/effects/morph.css +259 -0
- package/css/vanduo.css +1 -0
- package/dist/build-info.json +3 -3
- package/dist/vanduo.cjs.js +113 -2
- package/dist/vanduo.cjs.js.map +3 -3
- package/dist/vanduo.cjs.min.js +4 -4
- package/dist/vanduo.cjs.min.js.map +4 -4
- package/dist/vanduo.css +241 -9
- package/dist/vanduo.css.map +1 -1
- package/dist/vanduo.esm.js +113 -2
- package/dist/vanduo.esm.js.map +3 -3
- package/dist/vanduo.esm.min.js +4 -4
- package/dist/vanduo.esm.min.js.map +4 -4
- package/dist/vanduo.js +113 -2
- package/dist/vanduo.js.map +3 -3
- package/dist/vanduo.min.css +2 -2
- package/dist/vanduo.min.css.map +1 -1
- package/dist/vanduo.min.js +4 -4
- package/dist/vanduo.min.js.map +4 -4
- package/js/components/morph.js +137 -0
- package/js/index.js +2 -1
- package/package.json +1 -1
package/dist/vanduo.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Vanduo v1.3.
|
|
1
|
+
/*! Vanduo v1.3.5 | Built: 2026-04-15T18:39:53.955Z | git:3ca4f62 | development */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -132,7 +132,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
132
132
|
// js/vanduo.js
|
|
133
133
|
(function() {
|
|
134
134
|
"use strict";
|
|
135
|
-
const VANDUO_VERSION = true ? "1.3.
|
|
135
|
+
const VANDUO_VERSION = true ? "1.3.5" : "0.0.0-dev";
|
|
136
136
|
const Vanduo2 = {
|
|
137
137
|
version: VANDUO_VERSION,
|
|
138
138
|
components: {},
|
|
@@ -6597,6 +6597,117 @@ module.exports = __toCommonJS(index_exports);
|
|
|
6597
6597
|
window.VanduoGlassScroll = GlassScroll;
|
|
6598
6598
|
})();
|
|
6599
6599
|
|
|
6600
|
+
// js/components/morph.js
|
|
6601
|
+
(function() {
|
|
6602
|
+
"use strict";
|
|
6603
|
+
const MORPH_DURATION_MS = 750;
|
|
6604
|
+
const Morph = {
|
|
6605
|
+
instances: /* @__PURE__ */ new Map(),
|
|
6606
|
+
init: function() {
|
|
6607
|
+
const elements = document.querySelectorAll(".vd-morph, [data-vd-morph]");
|
|
6608
|
+
elements.forEach(function(el) {
|
|
6609
|
+
if (Morph.instances.has(el)) return;
|
|
6610
|
+
if (el.getAttribute("data-vd-morph") === "manual") return;
|
|
6611
|
+
Morph.initInstance(el);
|
|
6612
|
+
});
|
|
6613
|
+
},
|
|
6614
|
+
initInstance: function(el) {
|
|
6615
|
+
Morph._ensureLayers(el);
|
|
6616
|
+
const cleanup = [];
|
|
6617
|
+
let morphing = false;
|
|
6618
|
+
const handleClick = function(e) {
|
|
6619
|
+
if (morphing) return;
|
|
6620
|
+
Morph._runMorph(el, e, function() {
|
|
6621
|
+
morphing = false;
|
|
6622
|
+
});
|
|
6623
|
+
morphing = true;
|
|
6624
|
+
};
|
|
6625
|
+
el.addEventListener("click", handleClick);
|
|
6626
|
+
cleanup.push(function() {
|
|
6627
|
+
el.removeEventListener("click", handleClick);
|
|
6628
|
+
});
|
|
6629
|
+
this.instances.set(el, { cleanup });
|
|
6630
|
+
},
|
|
6631
|
+
morph: function(el) {
|
|
6632
|
+
if (!el) return;
|
|
6633
|
+
if (!this.instances.has(el)) this.initInstance(el);
|
|
6634
|
+
this._runMorph(el, null, null);
|
|
6635
|
+
},
|
|
6636
|
+
destroy: function(el) {
|
|
6637
|
+
const instance = this.instances.get(el);
|
|
6638
|
+
if (!instance) return;
|
|
6639
|
+
instance.cleanup.forEach(function(fn) {
|
|
6640
|
+
fn();
|
|
6641
|
+
});
|
|
6642
|
+
this.instances.delete(el);
|
|
6643
|
+
},
|
|
6644
|
+
destroyAll: function() {
|
|
6645
|
+
this.instances.forEach(function(_, el) {
|
|
6646
|
+
Morph.destroy(el);
|
|
6647
|
+
});
|
|
6648
|
+
},
|
|
6649
|
+
/* ── Internal helpers ── */
|
|
6650
|
+
_ensureLayers: function(el) {
|
|
6651
|
+
if (!el.querySelector(".vd-morph-wave")) {
|
|
6652
|
+
const wave = document.createElement("span");
|
|
6653
|
+
wave.className = "vd-morph-wave";
|
|
6654
|
+
wave.setAttribute("aria-hidden", "true");
|
|
6655
|
+
el.insertBefore(wave, el.firstChild);
|
|
6656
|
+
}
|
|
6657
|
+
if (!el.querySelector(".vd-morph-shine")) {
|
|
6658
|
+
const shine = document.createElement("span");
|
|
6659
|
+
shine.className = "vd-morph-shine";
|
|
6660
|
+
shine.setAttribute("aria-hidden", "true");
|
|
6661
|
+
const waveEl = el.querySelector(".vd-morph-wave");
|
|
6662
|
+
if (waveEl && waveEl.nextSibling) {
|
|
6663
|
+
el.insertBefore(shine, waveEl.nextSibling);
|
|
6664
|
+
} else {
|
|
6665
|
+
el.insertBefore(shine, el.firstChild);
|
|
6666
|
+
}
|
|
6667
|
+
}
|
|
6668
|
+
},
|
|
6669
|
+
_runMorph: function(el, pointerEvent, onComplete) {
|
|
6670
|
+
const wave = el.querySelector(".vd-morph-wave");
|
|
6671
|
+
if (wave) {
|
|
6672
|
+
const rect = el.getBoundingClientRect();
|
|
6673
|
+
const cx = rect.left + rect.width / 2;
|
|
6674
|
+
const cy = rect.top + rect.height / 2;
|
|
6675
|
+
const px = pointerEvent ? pointerEvent.clientX || cx : cx;
|
|
6676
|
+
const py = pointerEvent ? pointerEvent.clientY || cy : cy;
|
|
6677
|
+
wave.style.left = px - rect.left + "px";
|
|
6678
|
+
wave.style.top = py - rect.top + "px";
|
|
6679
|
+
}
|
|
6680
|
+
el.classList.add("is-morphing");
|
|
6681
|
+
let duration = MORPH_DURATION_MS;
|
|
6682
|
+
const custom = getComputedStyle(el).getPropertyValue("--morph-duration");
|
|
6683
|
+
if (custom) {
|
|
6684
|
+
const parsed = parseFloat(custom);
|
|
6685
|
+
if (!isNaN(parsed)) duration = parsed * (custom.indexOf("ms") !== -1 ? 1 : 1e3);
|
|
6686
|
+
}
|
|
6687
|
+
setTimeout(function() {
|
|
6688
|
+
el.classList.remove("is-morphing");
|
|
6689
|
+
const current = el.querySelector(".vd-morph-current");
|
|
6690
|
+
const next = el.querySelector(".vd-morph-next");
|
|
6691
|
+
if (current && next) {
|
|
6692
|
+
current.classList.remove("vd-morph-current");
|
|
6693
|
+
current.classList.add("vd-morph-next");
|
|
6694
|
+
next.classList.remove("vd-morph-next");
|
|
6695
|
+
next.classList.add("vd-morph-current");
|
|
6696
|
+
}
|
|
6697
|
+
el.classList.add("morph-done");
|
|
6698
|
+
setTimeout(function() {
|
|
6699
|
+
el.classList.remove("morph-done");
|
|
6700
|
+
}, 350);
|
|
6701
|
+
if (typeof onComplete === "function") onComplete();
|
|
6702
|
+
}, duration);
|
|
6703
|
+
}
|
|
6704
|
+
};
|
|
6705
|
+
if (typeof window.Vanduo !== "undefined") {
|
|
6706
|
+
window.Vanduo.register("morph", Morph);
|
|
6707
|
+
}
|
|
6708
|
+
window.VanduoMorph = Morph;
|
|
6709
|
+
})();
|
|
6710
|
+
|
|
6600
6711
|
// js/components/flow.js
|
|
6601
6712
|
(function() {
|
|
6602
6713
|
"use strict";
|