activity-timeline icon indicating copy to clipboard operation
activity-timeline copied to clipboard

Add possibility to animate icon

Open agencetwogether opened this issue 4 months ago • 0 comments

Hello,

I made a little contribution, a possibility to animate icon in activity timeline according to tailwind presets animation (animate-spin, animate-pin, animate-pulse, animate-bounce)

So for example, if you want animate an icon you can use

ActivityIcon::make('status')
 //with Enum
 //->animation(IconAnimation::Pulse)
 //or with a closure
  ->animation(fn (?string $state) => match ($state) {
      'current' => IconAnimation::Pulse,
      default => null,
  })
  //or with a string
  ->animation('animate-ping')
  ->icon(fn (?string $state): ?string => match ($state) {
      'current' => 'heroicon-m-light-bulb',
      default => 'heroicon-o-light-bulb',
  })

Closure, Enum, or string are possibilities.

agencetwogether avatar Oct 10 '24 22:10 agencetwogether