PR pixi-reels
All recipes

Custom per-symbol animation

Skip playWin(). drive each cell with a GSAP timeline, styled per win.id.

Loading recipe…

The minimum code

const presenter = new WinPresenter(reelSet, {
  stagger: 70,
  symbolAnim: async (symbol, cell, win) => {
    const peak = win.id === 0 ? 1.35 : 1.18;  // per-win styling
    await bouncePulse(symbol.view, peak, 220);
  },
});

Three modes in one field

symbolAnim accepts three shapes:

ValueBehaviour
'win' (default)calls symbol.playWin(). your ReelSymbol subclass’s hook
any other stringcalls symbol.playAnimation(name) if present (e.g. SpineSymbol), else falls back to playWin()
(symbol, cell, win) => Promise<void>fully custom. you decide what to run

The presenter still owns dim, stagger, events, and cancellation. the callback only replaces the per-cell gesture.