Animate

From nicolaiprodromov/puree · View interactive version

Animate is an AI agent skill from the GitHub repository nicolaiprodromov/puree. Review a Puree UI feature and enhance it with purposeful transitions and state changes that improve usability.

How to use this skill

Skill file

Analyze a Puree feature and strategically add transitions and state changes that enhance understanding, provide feedback, and create delight.

MANDATORY PREPARATION

Use the frontend-design skill — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no design context exists yet, you MUST run teach-impeccable first.


Understand Puree's Animation Model

Puree supports CSS transitions only — no @keyframes, no programmatic animation libraries. Work within these constraints:

Layout properties (width, padding, margin) cannot be animated and are ignored in :hover/:active rules.

Assess Transition Opportunities

Analyze where transitions would improve the experience:

  1. Identify static areas:
  1. Understand the context:

If any of these are unclear from the codebase, ask the user directly to clarify what you cannot infer.

Plan Transition Strategy

Create a purposeful transition plan:

IMPORTANT: A few well-tuned transitions beat scattered effects everywhere. Focus on high-impact moments.

Implement Transitions

Add motion systematically across these categories:

Hover State Feedback

Provide visual acknowledgment when users hover over interactive elements:

// Subtle background shift on hover
.nav_item {
  background-color: transparent;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: rgba(255, 255, 255, 0.08);
  }
}

// Color shift for text links
.action_link {
  color: $text-secondary;
  transition: color 0.2s ease;

  &:hover {
    color: $accent;
  }
}

Click/Active Feedback

Give tactile feedback when elements are pressed:

// Button press feedback via opacity and color
.btn_primary {
  background-color: $accent;
  opacity: 1.0;
  transition: background-color 0.1s ease, opacity 0.1s ease;

  &:hover {
    background-color: lighten($accent, 8%);
  }

  &:active {
    background-color: darken($accent, 10%);
    opacity: 0.85;
  }
}

State Color Transitions

Smooth out color changes triggered by Python at runtime:

// Status indicator with smooth color change
.status_badge {
  background-color: $neutral;
  transition: background-color 0.3s ease-out, color 0.3s ease-out;
}
# In script.py — transition happens automatically via SCSS
def update_status(container, status):
    colors = {'ok': 'rgba(46,204,113,1)', 'error': 'rgba(231,76,60,1)'}
    container.set_property('background-color', colors.get(status, 'rgba(149,165,166,1)'))
    container.mark_dirty()

Opacity Transitions

Use opacity for smooth show/reveal effects:

// Fade-in effect for content
.panel_content {
  opacity: 0.0;
  transition: opacity 0.3s ease-in-out;
}

// Python sets opacity to 1.0 when ready — the transition does the rest

Border Feedback

Use border-color transitions for input-like elements or selection states:

.input_field {
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease;

  &:hover {
    border-color: rgba(255, 255, 255, 0.3);
  }

  &:active {
    border-color: $accent;
  }
}

Multi-Property Transitions

Combine multiple animatable properties for richer effects:

.card {
  background-color: $surface;
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 1.0;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;

  &:hover {
    background-color: lighten($surface, 5%);
    border-color: rgba(255, 255, 255, 0.15);
  }
}

Timing & Easing Guidelines

Durations by purpose:

Easing choices:

Exit transitions should be faster than entrances. Use ~75% of enter duration.

NEVER:

Verify Quality

Test transitions thoroughly:

Remember: In Puree, transitions are your only animation tool — use them with precision. A well-timed 200ms color transition on hover communicates more than flashy effects ever could. Animate with purpose and restraint.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.