coulomb-social/docs/design-extract/coulomb-social-motion.gsap.js
tegwick 6fe263444a Extract authenticated coulomb.social design language via designlang
Session probe lands on /vw_pages (Research). Use main designlang extract
with --cookie-file — pack ignores auth. 39 artifacts under
docs/design-extract; tolerate designlang late summary crash when cores exist.
2026-08-09 01:31:00 +02:00

49 lines
2.2 KiB
JavaScript

// GSAP presets — generated by designlang (motionlang)
// Source: https://coulomb.social
// 2026-08-08T23:30:22.015Z
//
// import gsap from 'gsap';
// import { registerEases, reveals } from './coulomb.social-motion.gsap.js';
// registerEases(gsap); // one-time: registers CustomEases
// reveals.slideUp('.card');
/** CustomEase path data extracted from the live page, keyed by family. */
export const eases = {
standard: 'M0,0 C0.25,0.1 0.25,1 1,1',
};
/** Duration presets (seconds), extracted from the live page. */
export const durations = {
sm: 0.25,
};
/** Register every extracted curve as a named GSAP CustomEase. Call once. */
export function registerEases(gsap) {
const CustomEase = gsap.plugins?.CustomEase || (typeof window !== 'undefined' && window.CustomEase);
if (!CustomEase) {
console.warn('[motion.gsap] CustomEase plugin not registered — call gsap.registerPlugin(CustomEase) first.');
return;
}
for (const [name, path] of Object.entries(eases)) CustomEase.create(name, path);
}
/** gsap.from() reveal helpers. Pass any GSAP target + optional vars override. */
export const reveals = {
fadeIn: (target, vars = {}) => gsap.from(target, { opacity: 0, duration: 0.25, ease: 'standard', ...vars }),
slideUp: (target, vars = {}) => gsap.from(target, { opacity: 0, y: 24, duration: 0.25, ease: 'standard', ...vars }),
slideDown: (target, vars = {}) => gsap.from(target, { opacity: 0, y: -24, duration: 0.25, ease: 'standard', ...vars }),
scaleIn: (target, vars = {}) => gsap.from(target, { opacity: 0, scale: 0.96, duration: 0.25, ease: 'standard', ...vars }),
pop: (target, vars = {}) => gsap.from(target, { scale: 0.9, duration: 0.25, ease: 'standard', ...vars }),
};
/** Site uses scroll-/view-timeline. Batch-reveals elements as they enter. */
/** Requires: gsap.registerPlugin(ScrollTrigger). */
export function revealOnScroll(targets, vars = {}) {
return gsap.utils.toArray(targets).map((el) =>
gsap.from(el, {
opacity: 0, y: 24, duration: 0.25, ease: 'standard', ...vars,
scrollTrigger: { trigger: el, start: 'top 85%', toggleActions: 'play none none reverse' },
}));
}
export default { eases, durations, registerEases, reveals };