Quick Reference

Ecosistema completo para organización y gestión de contenido con interfaces espaciales

🎨 Flash Animations - Quick Reference

Fast lookup for all flash-animations features


🚀 Quick Start

1. Route Animations (Automatic)

Just add animation type to route config:

{
  path: 'my-route',
  data: {
    animation: 'slideUp'  // Choose from available types
  }
}

That's it! The hybrid system handles the rest.

2. Element Animations (Directives)

<!-- Basic -->
<div flashAnim="fade-in" faSpeed="fast">Content</div>

<!-- Click -->
<button flashAnimClick="bounce-in">Click me!</button>

<!-- Hover -->
<div flashAnimHover="glow" flashAnimExit="fade-out">Hover me</div>

<!-- Scroll -->
<div flashAnimViewport="slide-up" [flashAnimThreshold]="0.5">Scroll to reveal</div>

3. Programmatic (TypeScript)

import { flashAnimate, flashSuccess } from '@widgets-editor/flash-animations';

// Simple animation
await flashAnimate(this.element, 'fade-in', 'fast');

// Feedback
flashSuccess(this.element, 'Saved!');
flashError(this.element, 'Failed!');

🎭 Route Animation Types

Type Visual Effect Use Case
elegant Subtle fade + slide + scale Default, main areas
fade Simple opacity Quick transitions
slideUp Rise from below Content pages
slideLeft Slide from right Forward navigation
slideRight Slide from left Back navigation
scale Zoom in/out Focus changes
bounce Playful spring Fun interactions

⚡ Speed Settings

Speed Duration Use Case
instant 100ms Data updates
fast 300ms Quick transitions
normal 600ms Standard (default)
slow 1200ms Dramatic effects
elegant 800ms Polished feel

🎯 Element Animation Presets

Entrance

Exit

Attention

Special


📦 Imports

For Route Animations

import { RouteAnimationHostComponent } from '@widgets-editor/flash-animations';

// In component:
imports: [RouteAnimationHostComponent]

// In template:
<flash-route-animation-host></flash-route-animation-host>

For Element Animations

import {
  FlashAnimateDirective,
  FlashAnimateInteractionDirective,
  FlashAnimateViewportDirective
} from '@widgets-editor/flash-animations';

imports: [
  FlashAnimateDirective,
  FlashAnimateInteractionDirective,
  FlashAnimateViewportDirective
]

For Programmatic Control

import {
  FlashAnimationController,
  flashAnimate,
  flashSuccess,
  flashError,
  flashPulse,
  createAnimationChain
} from '@widgets-editor/flash-animations';

🎮 Directive Reference

flashAnim - Basic Animations

<div 
  [flashAnim]="preset"
  [faSpeed]="speed"
  [faDelay]="100"
  [faDuration]="600"
  [faEnabled]="true"
  [faTrigger]="counter">
</div>

flashAnimClick/Hover/Focus - Interactive

<button
  flashAnimClick="bounce-in"
  flashAnimHover="pulse"
  flashAnimFocus="glow"
  [faSpeed]="'fast'"
  [faEnabled]="true">
</button>

flashAnimViewport - Scroll Triggered

<div
  flashAnimViewport="slide-up"
  [flashAnimThreshold]="0.5"
  [faTriggerOnce]="true"
  [faSpeed]="'normal'"
  (faEnter)="onEnter()"
  (faExit)="onExit()">
</div>

💻 Helper Functions

// Basic
flashAnimate(element, 'fade-in', 'fast')

// Feedback
flashSuccess(element, 'Operation complete!')
flashError(element, 'Something went wrong')
flashWarning(element, 'Please review')
flashInfo(element, 'Helpful tip')

// Attention
flashPulse(element, 2)  // Pulse twice
flashShake(element, 'strong')  // Strong shake
flashGlow(element, '#22c55e', 800)  // Green glow

// Special
flashRipple(element, x, y)  // Material ripple
flashReveal(element, 'glass')  // Glassmorphism
flashEnter(element, 'up', 'normal')  // Smart entrance
flashExit(element, 'fade', 'fast')  // Smart exit

// Loading
const stop = flashStartLoading(element, 'Loading...');
// ... do work ...
stop();  // Stop loading animation

🔧 Advanced: Animation Controller

export class MyComponent {
  private controller = inject(FlashAnimationController);
  @ViewChild('element') element!: ElementRef;

  // Single animation
  async animate() {
    await this.controller.animate(this.element, 'bounce-in', {
      speed: 'fast',
      delay: 300,
      onComplete: () => console.log('Done!')
    });
  }

  // Sequence
  async sequence() {
    await this.controller.sequence(this.element, [
      { preset: 'fade-in', speed: 'fast' },
      { preset: 'glow', duration: 800, delay: 200 },
      { preset: 'pulse', speed: 'normal' }
    ]);
  }

  // Stagger (multiple elements)
  async stagger() {
    await this.controller.stagger(
      [this.card1, this.card2, this.card3],
      'slide-up',
      { speed: 'fast', staggerDelay: 150 }
    );
  }

  // Chain (fluent API)
  async chain() {
    const animation = this.controller.createChain(this.element)
      .fadeIn('fast')
      .wait(300)
      .pulse(2)
      .glow(1000)
      .bounceIn('elegant');
    
    await animation.play();
  }
}

♿ Accessibility

Flash-animations automatically:


🎯 Current Route Animations

Based on your app.routes.ts:

Route Animation Speed
/dashboard elegant normal
/ux-test slideLeft fast
/editor slideLeft elegant
/space-map scale elegant
/singularity slideUp normal
/storage slideUp elegant
/theme-test fade normal

All working with the hybrid system! ✨


🐛 Troubleshooting

Animations not working?

  1. Check component imports RouteAnimationHostComponent
  2. Verify <flash-route-animation-host> in template
  3. Ensure provideAnimations() in main.ts
  4. Rebuild library: yarn nx build flash-animations

Nested routes not animating?

Wrap the nested <router-outlet> with <flash-route-animation-host>.

Want different animation?

Change route.data.animation to any supported type!


📚 Full Documentation


🎨 Flash Animations - Powerful, Flexible, Reliable!