vevet 5.3.0 → 5.5.0
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/lib/cdn/vevet.iife.min.js +31 -34
- package/lib/cjs/components/Cursor/HoverElement/index.js +250 -0
- package/lib/cjs/components/Cursor/HoverElement/index.js.map +1 -0
- package/lib/cjs/components/Cursor/HoverElement/types.js +3 -0
- package/lib/cjs/components/Cursor/HoverElement/types.js.map +1 -0
- package/lib/cjs/components/Cursor/Path/index.js +115 -0
- package/lib/cjs/components/Cursor/Path/index.js.map +1 -0
- package/lib/cjs/components/Cursor/Path/svgQuadraticCurvePath.js.map +1 -0
- package/lib/cjs/components/Cursor/Path/types.js +3 -0
- package/lib/cjs/components/Cursor/Path/types.js.map +1 -0
- package/lib/cjs/components/Cursor/constants.js +5 -0
- package/lib/cjs/components/Cursor/constants.js.map +1 -0
- package/lib/cjs/components/Cursor/index.js +175 -191
- package/lib/cjs/components/Cursor/index.js.map +1 -1
- package/lib/cjs/components/Cursor/styles.js +3 -2
- package/lib/cjs/components/Cursor/styles.js.map +1 -1
- package/lib/cjs/components/Marquee/index.js +46 -22
- package/lib/cjs/components/Marquee/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js +13 -4
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/Scrollbar/styles.js +2 -1
- package/lib/cjs/components/Scrollbar/styles.js.map +1 -1
- package/lib/cjs/components/Snap/index.js +26 -9
- package/lib/cjs/components/Snap/index.js.map +1 -1
- package/lib/cjs/components/Snap/logic/Swipe/index.js +2 -2
- package/lib/cjs/components/Snap/logic/Swipe/index.js.map +1 -1
- package/lib/cjs/components/Snap/logic/Track/index.js +20 -18
- package/lib/cjs/components/Snap/logic/Track/index.js.map +1 -1
- package/lib/cjs/components/Snap/logic/Wheel/index.js +2 -2
- package/lib/cjs/components/Snap/logic/Wheel/index.js.map +1 -1
- package/lib/cjs/components/Snap/slide/Slide/index.js +9 -9
- package/lib/cjs/components/Snap/slide/Slide/index.js.map +1 -1
- package/lib/cjs/components/Snap/slide/SlideParallax/index.js +30 -12
- package/lib/cjs/components/Snap/slide/SlideParallax/index.js.map +1 -1
- package/lib/cjs/internal/isFiniteNumber.js +8 -0
- package/lib/cjs/internal/isFiniteNumber.js.map +1 -0
- package/lib/cjs/internal/prependStyles.js +14 -0
- package/lib/cjs/internal/prependStyles.js.map +1 -0
- package/lib/cjs/manifest.json +1 -1
- package/lib/esm/components/Cursor/HoverElement/index.js +200 -0
- package/lib/esm/components/Cursor/HoverElement/index.js.map +1 -0
- package/lib/esm/components/Cursor/HoverElement/types.js +2 -0
- package/lib/esm/components/Cursor/HoverElement/types.js.map +1 -0
- package/lib/esm/components/Cursor/Path/index.js +97 -0
- package/lib/esm/components/Cursor/Path/index.js.map +1 -0
- package/lib/esm/components/Cursor/Path/svgQuadraticCurvePath.js.map +1 -0
- package/lib/esm/components/Cursor/Path/types.js +2 -0
- package/lib/esm/components/Cursor/Path/types.js.map +1 -0
- package/lib/esm/components/Cursor/constants.js +2 -0
- package/lib/esm/components/Cursor/constants.js.map +1 -0
- package/lib/esm/components/Cursor/index.js +171 -200
- package/lib/esm/components/Cursor/index.js.map +1 -1
- package/lib/esm/components/Cursor/styles.js +5 -7
- package/lib/esm/components/Cursor/styles.js.map +1 -1
- package/lib/esm/components/Marquee/index.js +46 -22
- package/lib/esm/components/Marquee/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +9 -4
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/Scrollbar/styles.js +3 -2
- package/lib/esm/components/Scrollbar/styles.js.map +1 -1
- package/lib/esm/components/Snap/index.js +21 -8
- package/lib/esm/components/Snap/index.js.map +1 -1
- package/lib/esm/components/Snap/logic/Swipe/index.js +2 -2
- package/lib/esm/components/Snap/logic/Swipe/index.js.map +1 -1
- package/lib/esm/components/Snap/logic/Track/index.js +20 -18
- package/lib/esm/components/Snap/logic/Track/index.js.map +1 -1
- package/lib/esm/components/Snap/logic/Wheel/index.js +2 -2
- package/lib/esm/components/Snap/logic/Wheel/index.js.map +1 -1
- package/lib/esm/components/Snap/slide/Slide/index.js +9 -9
- package/lib/esm/components/Snap/slide/Slide/index.js.map +1 -1
- package/lib/esm/components/Snap/slide/SlideParallax/index.js +30 -12
- package/lib/esm/components/Snap/slide/SlideParallax/index.js.map +1 -1
- package/lib/esm/internal/isFiniteNumber.js +5 -0
- package/lib/esm/internal/isFiniteNumber.js.map +1 -0
- package/lib/esm/internal/prependStyles.js +11 -0
- package/lib/esm/internal/prependStyles.js.map +1 -0
- package/lib/esm/manifest.json +1 -1
- package/lib/types/components/Cursor/HoverElement/index.d.ts +60 -0
- package/lib/types/components/Cursor/HoverElement/index.d.ts.map +1 -0
- package/lib/types/components/Cursor/HoverElement/types.d.ts +60 -0
- package/lib/types/components/Cursor/HoverElement/types.d.ts.map +1 -0
- package/lib/types/components/Cursor/Path/index.d.ts +26 -0
- package/lib/types/components/Cursor/Path/index.d.ts.map +1 -0
- package/lib/types/components/Cursor/Path/svgQuadraticCurvePath.d.ts +3 -0
- package/lib/types/components/Cursor/Path/svgQuadraticCurvePath.d.ts.map +1 -0
- package/lib/types/components/Cursor/Path/types.d.ts +11 -0
- package/lib/types/components/Cursor/Path/types.d.ts.map +1 -0
- package/lib/types/components/Cursor/constants.d.ts +2 -0
- package/lib/types/components/Cursor/constants.d.ts.map +1 -0
- package/lib/types/components/Cursor/index.d.ts +47 -59
- package/lib/types/components/Cursor/index.d.ts.map +1 -1
- package/lib/types/components/Cursor/styles.d.ts.map +1 -1
- package/lib/types/components/Cursor/types.d.ts +38 -42
- package/lib/types/components/Cursor/types.d.ts.map +1 -1
- package/lib/types/components/Marquee/index.d.ts +2 -2
- package/lib/types/components/Marquee/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/index.d.ts +2 -0
- package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/types.d.ts +5 -0
- package/lib/types/components/ProgressPreloader/types.d.ts.map +1 -1
- package/lib/types/components/Scrollbar/styles.d.ts.map +1 -1
- package/lib/types/components/Snap/index.d.ts +6 -1
- package/lib/types/components/Snap/index.d.ts.map +1 -1
- package/lib/types/components/Snap/logic/Swipe/index.d.ts.map +1 -1
- package/lib/types/components/Snap/logic/Track/index.d.ts.map +1 -1
- package/lib/types/components/Snap/slide/Slide/index.d.ts.map +1 -1
- package/lib/types/components/Snap/slide/SlideParallax/index.d.ts +4 -0
- package/lib/types/components/Snap/slide/SlideParallax/index.d.ts.map +1 -1
- package/lib/types/components/Snap/slide/SlideParallax/types.d.ts +3 -1
- package/lib/types/components/Snap/slide/SlideParallax/types.d.ts.map +1 -1
- package/lib/types/components/Snap/types.d.ts +8 -0
- package/lib/types/components/Snap/types.d.ts.map +1 -1
- package/lib/types/internal/isFiniteNumber.d.ts +2 -0
- package/lib/types/internal/isFiniteNumber.d.ts.map +1 -0
- package/lib/types/internal/prependStyles.d.ts +2 -0
- package/lib/types/internal/prependStyles.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Cursor/HoverElement/index.ts +283 -0
- package/src/components/Cursor/HoverElement/types.ts +75 -0
- package/src/components/Cursor/Path/index.ts +128 -0
- package/src/components/Cursor/{utils → Path}/svgQuadraticCurvePath.ts +1 -1
- package/src/components/Cursor/Path/types.ts +11 -0
- package/src/components/Cursor/constants.ts +1 -0
- package/src/components/Cursor/index.ts +245 -282
- package/src/components/Cursor/styles.ts +5 -7
- package/src/components/Cursor/types.ts +41 -45
- package/src/components/Marquee/index.ts +50 -23
- package/src/components/ProgressPreloader/index.ts +12 -3
- package/src/components/ProgressPreloader/types.ts +6 -0
- package/src/components/Scrollbar/styles.ts +3 -2
- package/src/components/Snap/index.ts +24 -7
- package/src/components/Snap/logic/Swipe/index.ts +7 -2
- package/src/components/Snap/logic/Track/index.ts +20 -18
- package/src/components/Snap/logic/Wheel/index.ts +2 -2
- package/src/components/Snap/slide/Slide/index.ts +10 -9
- package/src/components/Snap/slide/SlideParallax/index.ts +38 -10
- package/src/components/Snap/slide/SlideParallax/types.ts +3 -1
- package/src/components/Snap/types.ts +9 -0
- package/src/internal/isFiniteNumber.ts +5 -0
- package/src/internal/prependStyles.ts +9 -0
- package/src/manifest.json +1 -1
- package/lib/cjs/components/Cursor/utils/svgQuadraticCurvePath.js.map +0 -1
- package/lib/esm/components/Cursor/utils/svgQuadraticCurvePath.js.map +0 -1
- package/lib/types/components/Cursor/utils/svgQuadraticCurvePath.d.ts +0 -3
- package/lib/types/components/Cursor/utils/svgQuadraticCurvePath.d.ts.map +0 -1
- /package/lib/cjs/components/Cursor/{utils → Path}/svgQuadraticCurvePath.js +0 -0
- /package/lib/esm/components/Cursor/{utils → Path}/svgQuadraticCurvePath.js +0 -0
|
@@ -70,15 +70,18 @@ export class SnapSlideParallax {
|
|
|
70
70
|
? this._getScope(element, scopeAttr, [-1, 1])
|
|
71
71
|
: defaultScope;
|
|
72
72
|
|
|
73
|
-
const attrValue =
|
|
74
|
-
const target = parseFloat(attrValue) || 0;
|
|
73
|
+
const attrValue = this._getAttr(element, n);
|
|
75
74
|
const unit = attrValue.replace(/[-\d.]+/g, '') || defaultUnit;
|
|
75
|
+
const target = this._getFloatAttr(element, n, 0);
|
|
76
76
|
|
|
77
|
-
const
|
|
78
|
-
const
|
|
77
|
+
const offset = this._getFloatAttr(element, `${n}-offset`, 0);
|
|
78
|
+
const min = this._getFloatAttr(element, `${n}-min`, -Infinity);
|
|
79
|
+
const max = this._getFloatAttr(element, `${n}-max`, Infinity);
|
|
79
80
|
|
|
80
81
|
const influenceAttr = `${n}-influence`;
|
|
81
|
-
const
|
|
82
|
+
const influence = element.hasAttribute(influenceAttr)
|
|
83
|
+
? this._getFloatAttr(element, `${n}-influence`, 1)
|
|
84
|
+
: 0;
|
|
82
85
|
|
|
83
86
|
const directionalAttr = `${n}-directional`;
|
|
84
87
|
const isDirectional = element.hasAttribute(directionalAttr);
|
|
@@ -97,7 +100,9 @@ export class SnapSlideParallax {
|
|
|
97
100
|
target,
|
|
98
101
|
value: 0,
|
|
99
102
|
offset,
|
|
100
|
-
|
|
103
|
+
min,
|
|
104
|
+
max,
|
|
105
|
+
influence,
|
|
101
106
|
isDirectional,
|
|
102
107
|
isAbs,
|
|
103
108
|
};
|
|
@@ -105,18 +110,39 @@ export class SnapSlideParallax {
|
|
|
105
110
|
);
|
|
106
111
|
}
|
|
107
112
|
|
|
113
|
+
/** Get parallax attribute */
|
|
114
|
+
protected _getAttr(element: HTMLElement, name: string) {
|
|
115
|
+
return element.getAttribute(name) ?? '';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Get parallax float attribute */
|
|
119
|
+
protected _getFloatAttr(
|
|
120
|
+
element: HTMLElement,
|
|
121
|
+
name: string,
|
|
122
|
+
defaultValue: number,
|
|
123
|
+
) {
|
|
124
|
+
const float = parseFloat(this._getAttr(element, name));
|
|
125
|
+
|
|
126
|
+
return Number.isNaN(float) ? defaultValue : float;
|
|
127
|
+
}
|
|
128
|
+
|
|
108
129
|
/** Get parallax scope */
|
|
109
130
|
protected _getScope(
|
|
110
131
|
element: HTMLElement,
|
|
111
132
|
name: string,
|
|
112
133
|
defaultValue: number[],
|
|
113
134
|
) {
|
|
114
|
-
const attrValue =
|
|
135
|
+
const attrValue = this._getAttr(element, name);
|
|
136
|
+
const attrStringValue = attrValue.trim().toLowerCase();
|
|
115
137
|
|
|
116
|
-
if (
|
|
138
|
+
if (attrStringValue === 'none') {
|
|
117
139
|
return [-Infinity, Infinity];
|
|
118
140
|
}
|
|
119
141
|
|
|
142
|
+
if (attrStringValue === 'const') {
|
|
143
|
+
return [1, 1];
|
|
144
|
+
}
|
|
145
|
+
|
|
120
146
|
const cleanValue = attrValue.replace(/[\s\\[\]]+/g, '');
|
|
121
147
|
const minMax = cleanValue.split(',');
|
|
122
148
|
const minRaw = parseFloat(minMax[0]);
|
|
@@ -144,8 +170,8 @@ export class SnapSlideParallax {
|
|
|
144
170
|
items.forEach((item) => {
|
|
145
171
|
let progress = clamp(globalProgress, ...item.scope);
|
|
146
172
|
|
|
147
|
-
if (item.
|
|
148
|
-
progress *= Math.abs(snap.track.influence);
|
|
173
|
+
if (Math.abs(item.influence) > 0) {
|
|
174
|
+
progress *= Math.abs(snap.track.influence) * item.influence;
|
|
149
175
|
}
|
|
150
176
|
|
|
151
177
|
if (item.isDirectional) {
|
|
@@ -162,6 +188,8 @@ export class SnapSlideParallax {
|
|
|
162
188
|
if (item.modifier) {
|
|
163
189
|
item.value = item.modifier(item.value);
|
|
164
190
|
}
|
|
191
|
+
|
|
192
|
+
item.value = clamp(item.value, item.min, item.max);
|
|
165
193
|
});
|
|
166
194
|
|
|
167
195
|
parallaxGroups.forEach(({ name: groupName }) => {
|
|
@@ -26,7 +26,9 @@ export interface ISnapSlideParallaxItem extends ISnapSlideParallaxType {
|
|
|
26
26
|
target: number;
|
|
27
27
|
value: number;
|
|
28
28
|
offset: number;
|
|
29
|
-
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
influence: number;
|
|
30
32
|
isDirectional: boolean;
|
|
31
33
|
isAbs: boolean;
|
|
32
34
|
}
|
|
@@ -37,6 +37,15 @@ export interface ISnapMutableProps
|
|
|
37
37
|
*/
|
|
38
38
|
slides?: (HTMLElement | SnapSlide)[] | false;
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Container size. Supported values:
|
|
42
|
+
* - `auto` detects slide size depending on the container size.
|
|
43
|
+
* - `number` defines the slide size in pixels.
|
|
44
|
+
* - css units like `px`, `rem`, `vw`, `vh`, `svh`.
|
|
45
|
+
* @default 'auto'
|
|
46
|
+
*/
|
|
47
|
+
containerSize?: number | 'auto' | (string & {});
|
|
48
|
+
|
|
40
49
|
/**
|
|
41
50
|
* Indicates the number of slides to scroll on swipe or wheel.
|
|
42
51
|
* @default 1
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function prependStyles(style: HTMLStyleElement) {
|
|
2
|
+
const firstStyles = document.querySelector('link[rel="stylesheet"], style');
|
|
3
|
+
|
|
4
|
+
if (firstStyles) {
|
|
5
|
+
firstStyles.parentNode?.insertBefore(style, firstStyles);
|
|
6
|
+
} else {
|
|
7
|
+
document.head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
}
|
package/src/manifest.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svgQuadraticCurvePath.js","sourceRoot":"","sources":["../../../../../src/components/Cursor/utils/svgQuadraticCurvePath.ts"],"names":[],"mappings":";;;AAEO,IAAM,qBAAqB,GAAG,UAAC,MAA0B;IAC9D,IAAI,IAAI,GAAG,WAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,IAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACjD,IAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAEjD,IAAI,IAAI,YAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAK,IAAI,eAAK,IAAI,CAAE,CAAC;IAC/D,CAAC;IAED,IAAI,IAAI,YAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,eAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,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":"svgQuadraticCurvePath.d.ts","sourceRoot":"","sources":["../../../../../src/components/Cursor/utils/svgQuadraticCurvePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,qBAAqB,WAAY,gBAAgB,EAAE,WAa/D,CAAC"}
|
|
File without changes
|
|
File without changes
|