gclass-anims 1.0.0-beta.22.2 → 1.0.0-beta.23
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/AnimToggle.js +39 -1
- package/CHANGELOG.md +3 -0
- package/dist/gclass.cjs +42 -0
- package/dist/gclass.esm.js +43 -2
- package/index.d.ts +5 -0
- package/index.js +1 -1
- package/package.json +1 -1
package/AnimToggle.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import initListeners from './Listeners.js'
|
|
2
2
|
import { defaults, animations } from './Config.js'
|
|
3
3
|
import { gsap } from 'gsap'
|
|
4
|
-
|
|
4
|
+
import { GSDevTools } from 'gsap/all'
|
|
5
|
+
gsap.registerPlugin(GSDevTools)
|
|
5
6
|
// localStorage key controlling whether the GSAP animation system is mounted.
|
|
6
7
|
const STORAGE_KEY = 'gclass-animations-enabled'
|
|
7
8
|
// localStorage key for a forced reduced-motion override (see
|
|
@@ -181,6 +182,43 @@ const readBootTime = (els, fallback) => {
|
|
|
181
182
|
return max ?? fallback
|
|
182
183
|
}
|
|
183
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Create GSDevTools UI styled like doc/ (Header.jsx:8 slate-800/50 ring + layout.js:85 slate-950).
|
|
187
|
+
* Accepts: gclassDev() | gclassDev("width:50%; bottom:30px") | gclassDev({width:"50%"}) | gclassDev({css:{}, minimal:true, animation:tl})
|
|
188
|
+
*/
|
|
189
|
+
export function gclassDev(cssOrOpts){
|
|
190
|
+
const docCss = {
|
|
191
|
+
backgroundColor: "rgba(15,23,42,0.96)", // slate-900 ~ doc bg-slate-950/900
|
|
192
|
+
border: "1px solid rgba(51,65,85,0.8)", // ring-slate-700 Header.jsx:8
|
|
193
|
+
borderRadius: "12px", // rounded-xl
|
|
194
|
+
boxShadow: "0 0 0 1px rgba(51,65,85,0.5), 0 8px 32px rgba(0,0,0,0.45)",
|
|
195
|
+
backdropFilter: "blur(8px)",
|
|
196
|
+
color: "#e2e8f0", // slate-200
|
|
197
|
+
bottom: "16px",
|
|
198
|
+
width: "92%",
|
|
199
|
+
maxWidth: "860px",
|
|
200
|
+
left: "50%",
|
|
201
|
+
transform: "translateX(-50%)",
|
|
202
|
+
}
|
|
203
|
+
let opts = {}
|
|
204
|
+
let css = docCss
|
|
205
|
+
if (typeof cssOrOpts === "string") {
|
|
206
|
+
css = cssOrOpts // verbatim string: "width:50%; bottom:30px"
|
|
207
|
+
} else if (cssOrOpts && typeof cssOrOpts === "object") {
|
|
208
|
+
// {width:"50%", bottom:"30px"} shorthand OR {css:{}, animation, minimal,...} full opts
|
|
209
|
+
const hasFullOpts = "css" in cssOrOpts || "animation" in cssOrOpts || "container" in cssOrOpts || "minimal" in cssOrOpts || "id" in cssOrOpts
|
|
210
|
+
if (hasFullOpts) {
|
|
211
|
+
const { css: userCss, ...rest } = cssOrOpts
|
|
212
|
+
opts = rest
|
|
213
|
+
if (typeof userCss === "string") css = userCss
|
|
214
|
+
else if (userCss && typeof userCss === "object") css = { ...docCss, ...userCss }
|
|
215
|
+
} else {
|
|
216
|
+
css = { ...docCss, ...cssOrOpts }
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return GSDevTools.create({ css, ...opts })
|
|
220
|
+
}
|
|
221
|
+
|
|
184
222
|
// Boots the GSAP animation system unless animations are disabled (stored "off"
|
|
185
223
|
// or reduced-motion fallback with no explicit choice). Idempotent: calling it
|
|
186
224
|
// again tears down any previous run first.
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `gclass-anims` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.0-beta.23] - 2026-09-09
|
|
6
|
+
- Added `gclassDev()` helper — `AnimToggle.js:185` `gclassDev(cssOrOpts)` wraps `GSDevTools.create()` with doc-styled defaults (`slate-900` `rgba(15,23,42,0.96)`, `slate-700` border, `rounded-xl`, `backdrop-blur`). Accepts `gclassDev()` (defaults), `gclassDev("width:50%; bottom:30px")` (CSS string), `gclassDev({width:"50%"})` (style object shorthand), or `gclassDev({css, animation, minimal, ...})` (full `GSDevTools` opts). Registers `GSDevTools` via `gsap.registerPlugin(GSDevTools)` (`AnimToggle.js:4`), re-exported from `index.js:1` and typed in `index.d.ts:35`.
|
|
7
|
+
|
|
5
8
|
## [1.0.0-beta.22.2] - 2026-09-06
|
|
6
9
|
- Fixed `m:order` (and any `bp:order` / `bp:priority-*` / `bp:ease-*` / `bp:time-*`) disabling the entire `scroll` animation on smaller screens — `Listeners.js:1200,1232,1262` previously wrapped `setupScroll` / `playText` scroll variants in generic `runWithBreakpoint(el, ...)` which gated on *any* `bp:*` class on the element (so `m:order` gated `scroll`). Now uses per-animation `qAllAllVariants` + `runWithBreakpointForSel` (`".scroll"`, `".scroll-progress"`, `tSel`) so only a true `m:scroll` / `m:spawn-*` gates its own animation; unrelated modifiers like `m:order` only affect `hasGClass("order")` / `readTiming` (stagger) and `spawn-*` + `scroll` still play on all sizes (without stagger on <m). Keeps live `gsap.matchMedia` handling for true breakpoint-gated scroll. Reverts `HowWorkSection.jsx` workaround from `m:order` back to plain `order` for the default staggered landing.
|
|
7
10
|
|
package/dist/gclass.cjs
CHANGED
|
@@ -2947,6 +2947,7 @@ function initListeners(root = document, throttlePerFrame) {
|
|
|
2947
2947
|
}
|
|
2948
2948
|
//#endregion
|
|
2949
2949
|
//#region AnimToggle.js
|
|
2950
|
+
gsap.gsap.registerPlugin(gsap_all.GSDevTools);
|
|
2950
2951
|
var STORAGE_KEY = "gclass-animations-enabled";
|
|
2951
2952
|
var REDUCED_KEY = "gclass-reduced-motion";
|
|
2952
2953
|
var reducedMotionQuery = typeof window !== "undefined" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
|
|
@@ -3079,6 +3080,46 @@ var readBootTime = (els, fallback) => {
|
|
|
3079
3080
|
}
|
|
3080
3081
|
return max ?? fallback;
|
|
3081
3082
|
};
|
|
3083
|
+
/**
|
|
3084
|
+
* Create GSDevTools UI styled like doc/ (Header.jsx:8 slate-800/50 ring + layout.js:85 slate-950).
|
|
3085
|
+
* Accepts: gclassDev() | gclassDev("width:50%; bottom:30px") | gclassDev({width:"50%"}) | gclassDev({css:{}, minimal:true, animation:tl})
|
|
3086
|
+
*/
|
|
3087
|
+
function gclassDev(cssOrOpts) {
|
|
3088
|
+
const docCss = {
|
|
3089
|
+
backgroundColor: "rgba(15,23,42,0.96)",
|
|
3090
|
+
border: "1px solid rgba(51,65,85,0.8)",
|
|
3091
|
+
borderRadius: "12px",
|
|
3092
|
+
boxShadow: "0 0 0 1px rgba(51,65,85,0.5), 0 8px 32px rgba(0,0,0,0.45)",
|
|
3093
|
+
backdropFilter: "blur(8px)",
|
|
3094
|
+
color: "#e2e8f0",
|
|
3095
|
+
bottom: "16px",
|
|
3096
|
+
width: "92%",
|
|
3097
|
+
maxWidth: "860px",
|
|
3098
|
+
left: "50%",
|
|
3099
|
+
transform: "translateX(-50%)"
|
|
3100
|
+
};
|
|
3101
|
+
let opts = {};
|
|
3102
|
+
let css = docCss;
|
|
3103
|
+
if (typeof cssOrOpts === "string") css = cssOrOpts;
|
|
3104
|
+
else if (cssOrOpts && typeof cssOrOpts === "object") {
|
|
3105
|
+
if ("css" in cssOrOpts || "animation" in cssOrOpts || "container" in cssOrOpts || "minimal" in cssOrOpts || "id" in cssOrOpts) {
|
|
3106
|
+
const { css: userCss, ...rest } = cssOrOpts;
|
|
3107
|
+
opts = rest;
|
|
3108
|
+
if (typeof userCss === "string") css = userCss;
|
|
3109
|
+
else if (userCss && typeof userCss === "object") css = {
|
|
3110
|
+
...docCss,
|
|
3111
|
+
...userCss
|
|
3112
|
+
};
|
|
3113
|
+
} else css = {
|
|
3114
|
+
...docCss,
|
|
3115
|
+
...cssOrOpts
|
|
3116
|
+
};
|
|
3117
|
+
}
|
|
3118
|
+
return gsap_all.GSDevTools.create({
|
|
3119
|
+
css,
|
|
3120
|
+
...opts
|
|
3121
|
+
});
|
|
3122
|
+
}
|
|
3082
3123
|
function initAnimations(throttlePerFrame, fps) {
|
|
3083
3124
|
let effThrottle = currentThrottle;
|
|
3084
3125
|
let effFps = currentFps;
|
|
@@ -3216,6 +3257,7 @@ exports.expandV = expandV;
|
|
|
3216
3257
|
exports.expandmove = expandmove;
|
|
3217
3258
|
exports.finalOpacity = finalOpacity;
|
|
3218
3259
|
exports.flip = flip;
|
|
3260
|
+
exports.gclassDev = gclassDev;
|
|
3219
3261
|
exports.gclassOpts = gclassOpts;
|
|
3220
3262
|
exports.getGClassConfig = getGClassConfig;
|
|
3221
3263
|
exports.hover = hover;
|
package/dist/gclass.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gsap } from "gsap";
|
|
2
|
-
import { DrawSVGPlugin, Flip, MotionPathPlugin, ScrambleTextPlugin, ScrollTrigger, SplitText, TextPlugin } from "gsap/all";
|
|
2
|
+
import { DrawSVGPlugin, Flip, GSDevTools, MotionPathPlugin, ScrambleTextPlugin, ScrollTrigger, SplitText, TextPlugin } from "gsap/all";
|
|
3
3
|
//#region Config.js
|
|
4
4
|
var defaults = {
|
|
5
5
|
orderDivide: 5,
|
|
@@ -2946,6 +2946,7 @@ function initListeners(root = document, throttlePerFrame) {
|
|
|
2946
2946
|
}
|
|
2947
2947
|
//#endregion
|
|
2948
2948
|
//#region AnimToggle.js
|
|
2949
|
+
gsap.registerPlugin(GSDevTools);
|
|
2949
2950
|
var STORAGE_KEY = "gclass-animations-enabled";
|
|
2950
2951
|
var REDUCED_KEY = "gclass-reduced-motion";
|
|
2951
2952
|
var reducedMotionQuery = typeof window !== "undefined" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
|
|
@@ -3078,6 +3079,46 @@ var readBootTime = (els, fallback) => {
|
|
|
3078
3079
|
}
|
|
3079
3080
|
return max ?? fallback;
|
|
3080
3081
|
};
|
|
3082
|
+
/**
|
|
3083
|
+
* Create GSDevTools UI styled like doc/ (Header.jsx:8 slate-800/50 ring + layout.js:85 slate-950).
|
|
3084
|
+
* Accepts: gclassDev() | gclassDev("width:50%; bottom:30px") | gclassDev({width:"50%"}) | gclassDev({css:{}, minimal:true, animation:tl})
|
|
3085
|
+
*/
|
|
3086
|
+
function gclassDev(cssOrOpts) {
|
|
3087
|
+
const docCss = {
|
|
3088
|
+
backgroundColor: "rgba(15,23,42,0.96)",
|
|
3089
|
+
border: "1px solid rgba(51,65,85,0.8)",
|
|
3090
|
+
borderRadius: "12px",
|
|
3091
|
+
boxShadow: "0 0 0 1px rgba(51,65,85,0.5), 0 8px 32px rgba(0,0,0,0.45)",
|
|
3092
|
+
backdropFilter: "blur(8px)",
|
|
3093
|
+
color: "#e2e8f0",
|
|
3094
|
+
bottom: "16px",
|
|
3095
|
+
width: "92%",
|
|
3096
|
+
maxWidth: "860px",
|
|
3097
|
+
left: "50%",
|
|
3098
|
+
transform: "translateX(-50%)"
|
|
3099
|
+
};
|
|
3100
|
+
let opts = {};
|
|
3101
|
+
let css = docCss;
|
|
3102
|
+
if (typeof cssOrOpts === "string") css = cssOrOpts;
|
|
3103
|
+
else if (cssOrOpts && typeof cssOrOpts === "object") {
|
|
3104
|
+
if ("css" in cssOrOpts || "animation" in cssOrOpts || "container" in cssOrOpts || "minimal" in cssOrOpts || "id" in cssOrOpts) {
|
|
3105
|
+
const { css: userCss, ...rest } = cssOrOpts;
|
|
3106
|
+
opts = rest;
|
|
3107
|
+
if (typeof userCss === "string") css = userCss;
|
|
3108
|
+
else if (userCss && typeof userCss === "object") css = {
|
|
3109
|
+
...docCss,
|
|
3110
|
+
...userCss
|
|
3111
|
+
};
|
|
3112
|
+
} else css = {
|
|
3113
|
+
...docCss,
|
|
3114
|
+
...cssOrOpts
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
return GSDevTools.create({
|
|
3118
|
+
css,
|
|
3119
|
+
...opts
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3081
3122
|
function initAnimations(throttlePerFrame, fps) {
|
|
3082
3123
|
let effThrottle = currentThrottle;
|
|
3083
3124
|
let effFps = currentFps;
|
|
@@ -3189,4 +3230,4 @@ function initAnimations(throttlePerFrame, fps) {
|
|
|
3189
3230
|
cleanup = initListeners(document, effThrottle);
|
|
3190
3231
|
}
|
|
3191
3232
|
//#endregion
|
|
3192
|
-
export { SpawnH, SpawnV, animatecss, animations, bell, bounce, countTargetVars, countUp, curtainHorizontal, curtainVertical, customAnims, defaults, disableReducedMotion, drawsvg, drawsvgSplit, enableReducedMotion, expandA, expandDown, expandH, expandLeft, expandRight, expandUp, expandV, expandmove, finalOpacity, flip, gclassOpts, getGClassConfig, hover, initAnimations, initListeners, magnet, magnet3d, marquee, normalize, pulse, radiate, registerComplete, reset, scramble, scrambleSegments, scrambleVars, shake, spawnBlur, spawnClipReveal, spawnFade, spawnSpinCCW, spawnSpinCW, spawnXDown, spawnXUp, spawnYLeft, spawnYRight, spinCCW, spinCW, splitPaths, stashText, subscribeGClassConfig, toggleAnimations, typewriter, verticalmove };
|
|
3233
|
+
export { SpawnH, SpawnV, animatecss, animations, bell, bounce, countTargetVars, countUp, curtainHorizontal, curtainVertical, customAnims, defaults, disableReducedMotion, drawsvg, drawsvgSplit, enableReducedMotion, expandA, expandDown, expandH, expandLeft, expandRight, expandUp, expandV, expandmove, finalOpacity, flip, gclassDev, gclassOpts, getGClassConfig, hover, initAnimations, initListeners, magnet, magnet3d, marquee, normalize, pulse, radiate, registerComplete, reset, scramble, scrambleSegments, scrambleVars, shake, spawnBlur, spawnClipReveal, spawnFade, spawnSpinCCW, spawnSpinCW, spawnXDown, spawnXUp, spawnYLeft, spawnYRight, spinCCW, spinCW, splitPaths, stashText, subscribeGClassConfig, toggleAnimations, typewriter, verticalmove };
|
package/index.d.ts
CHANGED
|
@@ -32,6 +32,11 @@ export function toggleAnimations(): void
|
|
|
32
32
|
export function enableReducedMotion(): void
|
|
33
33
|
/** Clear the forced reduced-motion override and reload. */
|
|
34
34
|
export function disableReducedMotion(): void
|
|
35
|
+
/**
|
|
36
|
+
* Create GSDevTools UI styled like doc/ (slate-900 / slate-800 ring).
|
|
37
|
+
* Accepts: gclassDev() | gclassDev("width:50%; bottom:30px") | gclassDev({width:"50%"}) | gclassDev({css, animation, minimal, ...GSDevTools opts})
|
|
38
|
+
*/
|
|
39
|
+
export function gclassDev(cssOrOpts?: string | Record<string, string> | Record<string, any>): any
|
|
35
40
|
|
|
36
41
|
// --- Listeners -------------------------------------------------------------
|
|
37
42
|
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { initAnimations, gclassOpts, getGClassConfig, subscribeGClassConfig, toggleAnimations, enableReducedMotion, disableReducedMotion } from './AnimToggle.js'
|
|
1
|
+
export { initAnimations, gclassOpts, getGClassConfig, subscribeGClassConfig, toggleAnimations, enableReducedMotion, disableReducedMotion , gclassDev} from './AnimToggle.js'
|
|
2
2
|
export { default as initListeners, registerComplete } from './Listeners.js'
|
|
3
3
|
export { customAnims } from './CustomAnims.js'
|
|
4
4
|
export { defaults, animations, normalize } from './Config.js'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gclass-anims",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.23",
|
|
4
4
|
"description": "A Tailwind-style utility layer on top of GSAP. Framework-agnostic - works in vanilla JS, React, Vue, Svelte, or any bundler.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/gclass.cjs",
|