Skip to content

Conversation

@subtleGradient
Copy link

Summary

  • Add playground page for prototyping atomic visual patterns
  • Create card flip components for teaching pull-based streams
  • Build interactive Stream pull/push prototypes with mystery card reveals
  • Extract reusable atomic patterns (borders, glows, timelines, card stacks)
  • Add Chunk and Stream sections to examples manifest
  • Fix Next.js 16 Turbopack compatibility and SSR warnings

New Components

Card Components 🃏

  • CardFaceFront/Back - Playing card faces with gradients and patterns
  • CardFlip - Y-axis flip animation with scale/lift effects
  • StackedCard - Positioned card with stack rotation and offsets
  • ChunkCardStack - Reusable stack with pull/push mechanics

Stream Prototypes

  • StreamPullPrototypeV2 - Cards flip to reveal values when pulled
  • StreamPushPullPrototypeV2 - Cloud pushes face-down cards, pull flips and reveals

Atomic Patterns

  • Border pulse, glow pulse, jitter, light sweeps, shape morph
  • Completion check, failure shake, death glitch, flash
  • Timeline components (dots, segments, ticks, retry visualization)

Playground Page

New /playground route showcasing all atomic visual patterns in isolation:

  • EffectNode state variations
  • Individual running patterns decomposed
  • Card component demos with interactive controls
  • Timeline pattern library
  • Stream pull/push interactions

Visual Improvements

  • Cards use playing card aspect ratio (64×88px)
  • Stacked cards with deterministic rotation tilts
  • Face-down mystery → face-up reveal metaphor for pull-based consumption
  • Proper z-index layering and 3D perspective
  • Animations respect component boundaries (borders/glows rotate with cards)

Technical Fixes

  • Fixed Next.js 16 Turbopack config compatibility
  • Added getServerSnapshot to useSyncExternalStore for SSR
  • Fixed routing to allow /playground independent of main app
  • Prevented duplicate card rendering with proper key management
  • Removed cards from queue immediately on pull to prevent race conditions

Next Steps

  • Wire card flip prototypes into real Stream examples
  • Add Chunk.make, Chunk.append, Chunk.concat examples
  • Create Stream.range example with proper EffectNode integration
  • Build progression of Stream teaching examples (map, filter, buffer, etc.)

This is a draft PR to showcase the visual pattern library and card flip mechanics before integrating into production examples.

…l variant

- Move StreamPullPrototype to src/components/playground/
- Create StreamPushPullPrototype with cloud push button
- Push adds chunks to top (with purple gradient cloud button)
- Pull consumes from bottom (existing green button)
- Both prototypes use polished visual style matching EffectNode aesthetic
- Stack cards with 12px overlap (like playing cards)
- Number bottom to top: 1 at bottom, 5 at top
- Initialize queue by adding items one at a time (150ms intervals)
- Bottom card pulses to show next pull target
- Cards stack with z-index depth effect
- 80x80px cards with larger text (2xl)
- Create ChunkCardStack pattern component in src/components/patterns/
- Array order: [newest/top, ..., oldest/bottom]
- Pull from bottom (oldest), push to top (newest)
- Initialize by adding 1→5 sequentially to build proper stack
- Both StreamPullPrototype and StreamPushPullPrototype now use shared component
- Export from patterns/index.ts
Border now rotates with the card during flip animation instead of staying fixed
Card scales to 1.15x and lifts 20px on z-axis during flip, creating a lifted-off-deck feel
…down

Scale: 1 → 1.2 → 1 (20% larger at peak)
Z-lift: 0 → 30px → 0 (lifts forward then returns)
Duration: 600ms total for smooth lift and settle
Scale and z-lift now animate on every flip (forward or back) instead of only when flipping to front
Add key and initial props to force Motion to re-run scale/z keyframes on each flip direction change
- Cards start face-down (mystery back)
- Flip to reveal value when pulled
- Uses StackedCard component with flip support
- Consumed rail shows face-up cards (CardFaceFront)
- 800ms pull sequence (600ms flip + 200ms buffer)
- Cloud button pushes new face-down cards to top
- Pull lever flips bottom card and moves to consumed
- Consumed rail shows face-up cards
- Both push and pull use StackedCard components
- 800ms pull sequence with flip animation
Prevents race condition where card could be pulled twice before state updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant