Skip to content

mxyhi/ok-skills / huashu-design

huashu-design

Unverified

花叔Design——用HTML做高保真原型、幻灯片、动画、可视化与专家评审。任何新设计100%先出三个方向初稿给用户选(指定风格/品牌也不豁免),选定后才执行。触发词:做原型、PPT、幻灯片、动画、设计风格、评审、做个HTML页面、UI mockup、导出MP4/GIF、做个好看的。生产级Web App/需后端的系统不适用。

FileKindSize
.env.exampleother463 B
.gitignoreother844 B
LICENSEother1.1 KB
README.en.mdmarkdown27.9 KB
README.mdmarkdown28.2 KB
SECURITY.mdmarkdown7.2 KB
SKILL.mdskill md15.2 KB
assets/android_frame.jsxother4.4 KB
assets/animations.jsxother10.3 KB
assets/banner.svgother9.3 KB
assets/bgm-ad.mp3binary4.7 MB
assets/bgm-educational-alt.mp3binary4.3 MB
assets/bgm-educational.mp3binary3.9 MB
assets/bgm-tech.mp3binary4.6 MB
assets/bgm-tutorial-alt.mp3binary3.8 MB
assets/bgm-tutorial.mp3binary5.3 MB
assets/browser_window.jsxother3.9 KB
assets/cursor.jsxother14.1 KB
assets/deck_index.htmlother20.8 KB
assets/deck_stage.jsscript11.4 KB
assets/design_canvas.jsxother5.1 KB
assets/director-notes-samples/launch-film-30s-sample.mdmarkdown78.3 KB
assets/ios_frame.jsxother4.6 KB
assets/macos_window.jsxother2.5 KB
assets/narration_stage.jsxother20.2 KB
assets/personal-asset-index.example.jsonconfig1.8 KB
assets/sfx/container/card-flip.mp3binary11.9 KB
assets/sfx/container/card-snap.mp3binary8.6 KB
assets/sfx/container/modal-open.mp3binary10.2 KB
assets/sfx/container/stack-collapse.mp3binary13.5 KB
assets/sfx/feedback/achievement.mp3binary24.1 KB
assets/sfx/feedback/error-tone.mp3binary11.9 KB
assets/sfx/feedback/notification-pop.mp3binary10.2 KB
assets/sfx/feedback/success-chime.mp3binary16.8 KB
assets/sfx/impact/brand-stamp.mp3binary16.8 KB
assets/sfx/impact/drop-thud.mp3binary11.9 KB
assets/sfx/impact/logo-reveal-v2.mp3binary24.1 KB
assets/sfx/impact/logo-reveal.mp3binary24.1 KB
assets/sfx/keyboard/delete-key.mp3binary8.6 KB
assets/sfx/keyboard/enter.mp3binary8.6 KB
assets/sfx/keyboard/space-tap.mp3binary8.6 KB
assets/sfx/keyboard/type-fast.mp3binary24.1 KB
assets/sfx/keyboard/type.mp3binary13.5 KB
assets/sfx/magic/ai-process.mp3binary19.6 KB
assets/sfx/magic/sparkle.mp3binary13.5 KB
assets/sfx/magic/transform.mp3binary16.8 KB
assets/sfx/progress/complete-done.mp3binary13.5 KB
assets/sfx/progress/generate-start.mp3binary13.5 KB
assets/sfx/progress/loading-tick.mp3binary8.6 KB
assets/sfx/terminal/command-execute.mp3binary8.6 KB
assets/sfx/terminal/cursor-blink.mp3binary8.6 KB
assets/sfx/terminal/output-appear.mp3binary10.2 KB
assets/sfx/transition/dissolve.mp3binary13.5 KB
assets/sfx/transition/slide-in.mp3binary10.2 KB
assets/sfx/transition/swipe-horizontal.mp3binary11.9 KB
assets/sfx/transition/whoosh-fast.mp3binary8.6 KB
assets/sfx/transition/whoosh.mp3binary10.2 KB
assets/sfx/ui/click-soft.mp3binary8.6 KB
assets/sfx/ui/click.mp3binary8.6 KB
assets/sfx/ui/focus.mp3binary8.6 KB
assets/sfx/ui/hover-subtle.mp3binary8.6 KB
assets/sfx/ui/tap-finger.mp3binary8.6 KB
assets/sfx/ui/toggle-on.mp3binary8.6 KB
assets/showcases/INDEX.mdmarkdown5.4 KB
assets/showcases/cover/cover-build.htmlother5.5 KB
assets/showcases/cover/cover-build.pngbinary113.6 KB
assets/showcases/cover/cover-pentagram.htmlother4.8 KB
assets/showcases/cover/cover-pentagram.pngbinary35.2 KB
assets/showcases/cover/cover-takram.htmlother11.5 KB
assets/showcases/cover/cover-takram.pngbinary151.7 KB
assets/showcases/infographic/infographic-build.htmlother11.4 KB
assets/showcases/infographic/infographic-build.pngbinary106.2 KB
assets/showcases/infographic/infographic-pentagram.htmlother13.6 KB
assets/showcases/infographic/infographic-pentagram.pngbinary155.3 KB
assets/showcases/infographic/infographic-takram.htmlother21.9 KB
assets/showcases/infographic/infographic-takram.pngbinary159.2 KB
assets/showcases/ppt/ppt-build.htmlother8.9 KB
assets/showcases/ppt/ppt-build.pngbinary82.4 KB
assets/showcases/ppt/ppt-pentagram.htmlother11.7 KB
assets/showcases/ppt/ppt-pentagram.pngbinary99.0 KB
assets/showcases/ppt/ppt-takram.htmlother15.3 KB
assets/showcases/ppt/ppt-takram.pngbinary456.2 KB
assets/showcases/website-ai-nav/ainav-build.htmlother9.4 KB
assets/showcases/website-ai-nav/ainav-build.pngbinary83.1 KB
assets/showcases/website-ai-nav/ainav-pentagram.htmlother10.3 KB
assets/showcases/website-ai-nav/ainav-pentagram.pngbinary103.1 KB
assets/showcases/website-ai-nav/ainav-takram.htmlother12.4 KB
assets/showcases/website-ai-nav/ainav-takram.pngbinary118.8 KB
assets/showcases/website-ai-writing/aiwriting-build.htmlother13.7 KB
assets/showcases/website-ai-writing/aiwriting-build.pngbinary127.5 KB
assets/showcases/website-ai-writing/aiwriting-pentagram.htmlother13.9 KB
assets/showcases/website-ai-writing/aiwriting-pentagram.pngbinary146.7 KB
assets/showcases/website-ai-writing/aiwriting-takram.htmlother17.6 KB
assets/showcases/website-ai-writing/aiwriting-takram.pngbinary153.5 KB
assets/showcases/website-devdocs/devdocs-build.htmlother9.7 KB
assets/showcases/website-devdocs/devdocs-build.pngbinary66.6 KB
assets/showcases/website-devdocs/devdocs-pentagram.htmlother12.5 KB
assets/showcases/website-devdocs/devdocs-pentagram.pngbinary114.3 KB
assets/showcases/website-devdocs/devdocs-takram.htmlother12.8 KB
assets/showcases/website-devdocs/devdocs-takram.pngbinary109.2 KB
assets/showcases/website-homepage/homepage-build.htmlother8.1 KB
assets/showcases/website-homepage/homepage-build.pngbinary60.3 KB
assets/showcases/website-homepage/homepage-pentagram.htmlother8.3 KB
assets/showcases/website-homepage/homepage-pentagram.pngbinary55.8 KB
assets/showcases/website-homepage/homepage-takram.htmlother10.3 KB
assets/showcases/website-homepage/homepage-takram.pngbinary124.6 KB
assets/showcases/website-saas/saas-build.htmlother12.6 KB
assets/showcases/website-saas/saas-build.pngbinary97.4 KB
assets/showcases/website-saas/saas-pentagram.htmlother14.7 KB
assets/showcases/website-saas/saas-pentagram.pngbinary94.3 KB
assets/showcases/website-saas/saas-takram.htmlother17.8 KB
assets/showcases/website-saas/saas-takram.pngbinary120.6 KB
assets/style-specimens/app/01-hardware-panel.htmlother7.1 KB
assets/style-specimens/app/01-hardware-panel.jpgbinary73.7 KB
assets/style-specimens/app/02-liquid-glass.htmlother6.8 KB
assets/style-specimens/app/02-liquid-glass.jpgbinary87.9 KB
assets/style-specimens/app/03-playful-3d.htmlother5.6 KB
assets/style-specimens/app/03-playful-3d.jpgbinary92.8 KB
assets/style-specimens/app/04-friendly-fintech.htmlother6.2 KB
assets/style-specimens/app/04-friendly-fintech.jpgbinary91.3 KB
assets/style-specimens/app/05-pro-camera.htmlother7.1 KB
assets/style-specimens/app/05-pro-camera.jpgbinary74.5 KB
assets/style-specimens/app/06-topo-outdoor.htmlother8.9 KB
assets/style-specimens/app/06-topo-outdoor.jpgbinary90.4 KB
assets/style-specimens/app/07-feed-waterfall.htmlother7.5 KB
assets/style-specimens/app/07-feed-waterfall.jpgbinary81.5 KB
assets/style-specimens/app/08-command-palette.htmlother6.4 KB
assets/style-specimens/app/08-command-palette.jpgbinary55.4 KB
assets/style-specimens/app/09-health-color-code.htmlother7.3 KB
assets/style-specimens/app/09-health-color-code.jpgbinary74.2 KB
assets/style-specimens/app/10-native-polish.htmlother6.4 KB
assets/style-specimens/app/10-native-polish.jpgbinary74.5 KB
assets/style-specimens/app/11-gentle-encouraging.htmlother6.3 KB
assets/style-specimens/app/11-gentle-encouraging.jpgbinary80.1 KB
assets/style-specimens/app/12-editorial-reader.htmlother5.9 KB
assets/style-specimens/app/12-editorial-reader.jpgbinary114.1 KB
assets/style-specimens/east/01-lu-jingren-bookcraft.htmlother4.0 KB
assets/style-specimens/east/01-lu-jingren-bookcraft.jpgbinary68.5 KB
assets/style-specimens/east/02-song-block-print.htmlother4.7 KB
assets/style-specimens/east/02-song-block-print.jpgbinary146.3 KB
assets/style-specimens/east/03-republic-book-jacket.htmlother4.6 KB
assets/style-specimens/east/03-republic-book-jacket.jpgbinary57.7 KB
assets/style-specimens/east/04-shanghai-deco-calendar.htmlother5.0 KB
assets/style-specimens/east/04-shanghai-deco-calendar.jpgbinary76.3 KB
assets/style-specimens/east/05-hanzi-experimental-poster.htmlother5.0 KB
assets/style-specimens/east/05-hanzi-experimental-poster.jpgbinary54.1 KB
assets/style-specimens/east/06-hk-street-signs.htmlother4.4 KB
assets/style-specimens/east/06-hk-street-signs.jpgbinary115.5 KB
assets/style-specimens/east/07-traditional-colors-solar-terms.htmlother6.0 KB
assets/style-specimens/east/07-traditional-colors-solar-terms.jpgbinary79.7 KB
assets/style-specimens/east/08-sugiura-info-mandala.htmlother27.9 KB
assets/style-specimens/east/08-sugiura-info-mandala.jpgbinary127.3 KB
assets/style-specimens/east/09-tanaka-geometric-poster.htmlother3.1 KB
assets/style-specimens/east/09-tanaka-geometric-poster.jpgbinary53.6 KB
assets/style-specimens/east/10-hattori-playful-offset.htmlother2.9 KB
assets/style-specimens/east/10-hattori-playful-offset.jpgbinary89.6 KB
assets/style-specimens/east/11-sato-minimal-symbol.htmlother2.8 KB
assets/style-specimens/east/11-sato-minimal-symbol.jpgbinary45.4 KB
assets/style-specimens/east/12-japan-magazine-dense.htmlother14.2 KB
assets/style-specimens/east/12-japan-magazine-dense.jpgbinary122.6 KB
assets/style-specimens/info/01-personal-annual-report.htmlother9.3 KB
assets/style-specimens/info/01-personal-annual-report.jpgbinary121.4 KB
assets/style-specimens/info/02-explanation-graphics.htmlother4.9 KB
assets/style-specimens/info/02-explanation-graphics.jpgbinary109.8 KB
assets/style-specimens/info/03-cross-section-epic.htmlother7.1 KB
assets/style-specimens/info/03-cross-section-epic.jpgbinary150.3 KB
assets/style-specimens/info/04-magazine-pop-data.htmlother3.6 KB
assets/style-specimens/info/04-magazine-pop-data.jpgbinary84.8 KB
assets/style-specimens/info/05-isotype.htmlother3.9 KB
assets/style-specimens/info/05-isotype.jpgbinary120.6 KB
assets/style-specimens/info/06-data-humanism.htmlother5.9 KB
assets/style-specimens/info/06-data-humanism.jpgbinary85.7 KB
assets/style-specimens/info/07-scrollytelling.htmlother4.9 KB
assets/style-specimens/info/07-scrollytelling.jpgbinary69.8 KB
assets/style-specimens/info/08-cartographic-lead.htmlother4.6 KB
assets/style-specimens/info/08-cartographic-lead.jpgbinary83.8 KB
assets/style-specimens/info/09-newsroom-chart.htmlother5.1 KB
assets/style-specimens/info/09-newsroom-chart.jpgbinary63.9 KB
assets/style-specimens/info/10-computational-portrait.htmlother4.4 KB
assets/style-specimens/info/10-computational-portrait.jpgbinary147.4 KB
assets/style-specimens/info/11-beautiful-information.htmlother4.2 KB
assets/style-specimens/info/11-beautiful-information.jpgbinary92.2 KB
assets/style-specimens/info/12-open-research-data.htmlother3.4 KB
assets/style-specimens/info/12-open-research-data.jpgbinary84.8 KB
assets/style-specimens/info/13-speculative-tech-diagram.htmlother4.0 KB
assets/style-specimens/info/13-speculative-tech-diagram.jpgbinary49.0 KB
assets/style-specimens/info/14-pictogram-system.htmlother4.3 KB
assets/style-specimens/info/14-pictogram-system.jpgbinary79.8 KB
assets/style-specimens/info/15-small-multiples.htmlother3.0 KB
assets/style-specimens/info/15-small-multiples.jpgbinary68.6 KB
assets/style-specimens/info/16-topological-transit-map.htmlother3.6 KB
assets/style-specimens/info/16-topological-transit-map.jpgbinary63.1 KB
assets/style-specimens/info/17-ma-emptiness.htmlother2.0 KB
assets/style-specimens/info/17-ma-emptiness.jpgbinary20.5 KB
assets/style-specimens/info/18-bookcraft-data.htmlother3.0 KB
assets/style-specimens/info/18-bookcraft-data.jpgbinary96.8 KB
assets/style-specimens/info/19-scientific-figure-plate.htmlother5.2 KB
assets/style-specimens/info/19-scientific-figure-plate.jpgbinary80.6 KB
assets/style-specimens/info/20-swiss-grid-report.htmlother3.2 KB
assets/style-specimens/info/20-swiss-grid-report.jpgbinary69.2 KB

assets/animations.jsx

View on GitHub
/**
 * animations.jsx — 时间轴动画引擎
 *
 * Stage + Sprite 模式,借鉴Remotion但轻量化。
 *
 * 导出(挂到 window.Animations):
 * - Stage: 整个动画容器,提供时间+控制
 * - Sprite: 时间片段,start/end内显示,提供本地进度
 * - useTime(): 读全局时间(秒)
 * - useSprite(): 读本地进度 {t: 0→1, elapsed: seconds, duration: seconds}
 * - Easing: {linear, easeIn, easeOut, easeInOut, spring, anticipation}
 * - interpolate(t, [input0, input1], [output0, output1], easing?)
 *
 * 用法:
 *   <Stage duration={10}>
 *     <Sprite start={0} end={3}>
 *       <Title />
 *     </Sprite>
 *     <Sprite start={2} end={5}>
 *       <Subtitle />
 *     </Sprite>
 *   </Stage>
 *
 * 在Sprite子组件里用 useSprite() 读当前片段进度。
 */

(function() {
  const { createContext, useContext, useState, useEffect, useRef, useCallback } = React;

  const TimeContext = createContext({ time: 0, duration: 10, playing: false });
  const SpriteContext = createContext(null);

  const Easing = {
    linear: t => t,
    easeIn: t => t * t,
    easeOut: t => 1 - (1 - t) * (1 - t),
    easeInOut: t => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2,
    // expoOut: Anthropic-level 主 easing (cubic-bezier(0.16, 1, 0.3, 1))
    // 迅速启动 + 缓慢刹车,给数字元素物理重量感
    expoOut: t => t === 1 ? 1 : 1 - Math.pow(2, -10 * t),
    // overshoot: 带弹性的 toggle/按钮弹出 (cubic-bezier(0.34, 1.56, 0.64, 1))
    overshoot: t => {
      const c1 = 1.70158, c3 = c1 + 1;
      return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
    },
    spring: t => {
      const c = (2 * Math.PI) / 3;
      return t === 0 ? 0 : t === 1 ? 1 : Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * c) + 1;
    },
    anticipation: t => {
      if (t < 0.2) return -0.3 * (t / 0.2) * (t / 0.2);
      const adjusted = (t - 0.2) / 0.8;
      return -0.012 + 1.012 * adjusted * adjusted * (3 - 2 * adjusted);
    },
  };

  function interpolate(t, input, output, easing) {
    const [inStart, inEnd] = input;
    const [outStart, outEnd] = output;

    if (t <= inStart) return outStart;
    if (t >= inEnd) return outEnd;

    let progress = (t - inStart) / (inEnd - inStart);
    if (easing) {
      progress = easing(progress);
    }

    return outStart + (outEnd - outStart) * progress;
  }

  function useTime() {
    const ctx = useContext(TimeContext);
    return ctx.time;
  }

  function useSprite() {
    const sprite = useContext(SpriteContext);
    if (!sprite) {
      return { t: 0, elapsed: 0, duration: 0 };
    }
    return sprite;
  }

  const stageStyles = {
    wrapper: {
      position: 'fixed',
      inset: 0,
      background: '#000',
      display: 'flex',
      flexDirection: 'column',
      fontFamily: '-apple-system, sans-serif',
    },
    stageHolder: {
      flex: 1,
      position: 'relative',
      overflow: 'hidden',
    },
    canvas: {
      position: 'absolute',
      top: '50%',
      left: '50%',
      transformOrigin: 'center center',
      background: '#111',
      overflow: 'hidden',
    },
    controls: {
      position: 'fixed',
      bottom: 0,
      left: 0,
      right: 0,
      background: 'rgba(0, 0, 0, 0.8)',
      backdropFilter: 'blur(10px)',
      padding: '12px 20px',
      display: 'flex',
      alignItems: 'center',
      gap: 16,
      color: '#fff',
      fontSize: 12,
      zIndex: 100,
    },
    button: {
      background: 'none',
      border: '1px solid rgba(255,255,255,0.3)',
      color: '#fff',
      padding: '6px 14px',
      borderRadius: 4,
      cursor: 'pointer',
      fontSize: 12,
    },
    timeDisplay: {
      fontFamily: 'ui-monospace, monospace',
      fontVariantNumeric: 'tabular-nums',
      minWidth: 90,
    },
    scrubber: {
      flex: 1,
      height: 4,
      background: 'rgba(255,255,255,0.2)',
      borderRadius: 2,
      position: 'relative',
      cursor: 'pointer',
    },
    scrubberFill: {
      position: 'absolute',
      top: 0,
      left: 0,
      height: '100%',
      background: '#fff',
      borderRadius: 2,
      pointerEvents: 'none',
    },
    scrubberHandle: {
      position: 'absolute',
      top: '50%',
      width: 12,
      height: 12,
      background: '#fff',
      borderRadius: '50%',
      transform: 'translate(-50%, -50%)',
      pointerEvents: 'none',
    },
  };

  function Stage({ duration = 10, width = 1920, height = 1080, fps = 60, loop = true, children, bgColor = '#fff' }) {
    const [time, setTime] = useState(0);
    const [playing, setPlaying] = useState(true);
    const [scale, setScale] = useState(1);
    const rafRef = useRef(null);
    const startTimeRef = useRef(performance.now());
    const canvasRef = useRef(null);

    // Recording mode: render-video.js injects window.__recording = true before goto.
    // When set, force loop=false so the export ends on the final frame instead of
    // wrapping back to t=0 and capturing the start of the next cycle.
    // (Browsers viewing manually still loop because __recording is undefined there.)
    const effectiveLoop = (typeof window !== 'undefined' && window.__recording) ? false : loop;

    useEffect(() => {
      function updateScale() {
        const vw = window.innerWidth;
        const vh = window.innerHeight - 56;
        const s = Math.min(vw / width, vh / height);
        setScale(s);
      }
      updateScale();
      window.addEventListener('resize', updateScale);
      return () => window.removeEventListener('resize', updateScale);
    }, [width, height]);

    useEffect(() => {
      // Seek-render mode (render-video-seek.js sets window.__seekRender): freeze the
      // self-driven clock and let the external renderer advance each frame via
      // window.__seek(t). No rAF self-drive here — every frame is a deterministic seek.
      if (typeof window !== 'undefined' && window.__seekRender) {
        window.__ready = true;
        window.__seek = (t) => setTime(Math.min(t, duration - 0.001));
        return;
      }
      if (!playing) return;
      let cancelled = false;
      let last = null;

      function tick(now) {
        if (cancelled) return;
        if (last === null) {
          // First animation frame. Set last=now so delta starts at 0,
          // AND announce readiness for video export.
          // This pairing is critical: window.__ready must flip to true at
          // the exact moment WebM captures frame 0 of the animation, so
          // render-video.js's trim offset equals the pre-animation gap.
          last = now;
          if (typeof window !== 'undefined') window.__ready = true;
        }
        const delta = (now - last) / 1000;
        last = now;
        setTime(prev => {
          const next = prev + delta;
          if (next >= duration) {
            // effectiveLoop honors window.__recording (forced non-loop during export).
            // Stop just shy of duration so the final-frame state stays rendered
            // (avoids exiting all Sprites that end exactly at `duration`).
            return effectiveLoop ? 0 : duration - 0.001;
          }
          return next;
        });
        rafRef.current = requestAnimationFrame(tick);
      }

      // Wait for fonts before starting the clock — makes frame 0 the
      // real "finished-loading" frame users see, not a fallback-font flash.
      const startAfterFonts = () => {
        if (cancelled) return;
        rafRef.current = requestAnimationFrame(tick);
      };
      if (typeof document !== 'undefined' && document.fonts && document.fonts.ready) {
        document.fonts.ready.then(startAfterFonts);
      } else {
        startAfterFonts();
      }

      return () => {
        cancelled = true;
        cancelAnimationFrame(rafRef.current);
      };
    }, [playing, duration, effectiveLoop]);

    const handleScrub = useCallback((e) => {
      const rect = e.currentTarget.getBoundingClientRect();
      const ratio = (e.clientX - rect.left) / rect.width;
      setTime(Math.max(0, Math.min(duration, ratio * duration)));
    }, [duration]);

    const handleSeek = useCallback((e) => {
      handleScrub(e);
      setPlaying(false);
    }, [handleScrub]);

    const progress = time / duration;

    const ctx = {
      time,
      duration,
      playing,
      setPlaying,
      setTime,
    };

    const canvasStyle = {
      ...stageStyles.canvas,
      width,
      height,
      background: bgColor,
      transform: `translate(-50%, -50%) scale(${scale})`,
    };

    return (
      <TimeContext.Provider value={ctx}>
        <div style={stageStyles.wrapper}>
          <div style={stageStyles.stageHolder}>
            <div ref={canvasRef} style={canvasStyle}>
              {children}
            </div>
          </div>

          <div style={stageStyles.controls}>
            <button
              style={stageStyles.button}
              onClick={() => setPlaying(p => !p)}
            >
              {playing ? '⏸ 暂停' : '▶ 播放'}
            </button>

            <button
              style={stageStyles.button}
              onClick={() => setTime(0)}
            >
              ⏮ 开始
            </button>

            <div style={stageStyles.timeDisplay}>
              {time.toFixed(2)}s / {duration.toFixed(2)}s
            </div>

            <div style={stageStyles.scrubber} onMouseDown={handleSeek}>
              <div style={{ ...stageStyles.scrubberFill, width: `${progress * 100}%` }} />
              <div style={{ ...stageStyles.scrubberHandle, left: `${progress * 100}%` }} />
            </div>
          </div>
        </div>
      </TimeContext.Provider>
    );
  }

  function Sprite({ start = 0, end, children, style }) {
    const { time } = useContext(TimeContext);
    const actualEnd = end == null ? Infinity : end;

    if (time < start || time >= actualEnd) {
      return null;
    }

    const duration = actualEnd - start;
    const elapsed = time - start;
    const t = duration === 0 ? 1 : Math.max(0, Math.min(1, elapsed / duration));

    const spriteValue = { t, elapsed, duration, start, end: actualEnd };

    return (
      <SpriteContext.Provider value={spriteValue}>
        <div style={{ position: 'absolute', inset: 0, ...style }}>
          {children}
        </div>
      </SpriteContext.Provider>
    );
  }

  if (typeof window !== 'undefined') {
    window.Animations = {
      Stage,
      Sprite,
      useTime,
      useSprite,
      Easing,
      interpolate,
    };
  }
})();
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 323kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall