Animating SVGs
Building an Interactive FIFA Skills Trainer with SVG Animations
As a developer passionate about both coding and football, I wanted to create something that combined my love for both worlds. That's how my FIFA Skills project was born – an interactive web application that teaches FIFA controller tricks through animated SVG controllers.
The Vision
The concept was simple but ambitious: show animated controller inputs on one side of a card, and display the corresponding FIFA skill move on the other side. Users could click cards to flip between the controller animation and the actual skill demonstration. With dozens of skills to showcase, I needed a smooth infinite scroll experience to handle the content.
Why SVGs for Controller Animations?
When I started this project, I had a few options for creating the controller animations:
Canvas-based animations
CSS animations with DOM elements
SVG-based approach
Video files
I chose SVGs for several compelling reasons:
Scalability and Performance
SVGs are vector-based, meaning they look crisp at any screen size without losing quality. Since my app needed to work on everything from mobile phones to large monitors, this was crucial. The controllers needed to remain sharp and detailed regardless of the device.
Precise Control
Each controller element (buttons, sticks, triggers) needed to be individually animatable. SVGs gave me the granular control I needed – I could target specific paths and elements with CSS and JavaScript, creating smooth transitions for button presses and stick movements.
Small File Sizes
Compared to video files or image sequences, SVGs are incredibly lightweight. My entire PlayStation controller SVG, complete with all its components, weighs in at just a few kilobytes.
The SVG Architecture
I broke down each controller into modular SVG components:
This modular approach meant I could animate individual elements independently. For example, the left stick component (PlaystationControllerLeftStick.tsx
) is just a series of SVG paths that can be transformed and animated:
Animation System Design
The real magic happens in my animation orchestration system. I created a fluent API that lets me define complex controller sequences:
This system handles:
Timing coordination
: Each animation step knows when to start relative to previous actions
Element targeting
: Precisely control which controller parts animate
Smooth transitions
: CSS transforms handle the actual visual changes
The StickMovements
class generates the coordinate transformations for analog stick rotations:
Framer Motion Integration
I integrated Framer Motion to handle the smooth SVG animations. This gave me:
Hardware acceleration
: Animations run on the GPU for buttery smooth performance
Spring physics
: Natural-feeling button presses and stick movements
Complex choreography
: Multiple elements can animate in coordination
The result is controller animations that feel responsive and realistic, mimicking the actual tactile experience of performing FIFA skills.

Infinite Scroll Implementation
With 40+ FIFA skills to display, I needed a performant scrolling solution. I used react-infinite-scroll-component
for several reasons:
Performance Benefits
Instead of rendering all 40+ cards at once, infinite scroll only renders visible cards plus a small buffer. This keeps the DOM lightweight and maintains smooth scrolling performance.
User Experience
The infinite scroll creates a Netflix-like browsing experience. Users can continuously scroll through skills without pagination breaks, maintaining their flow state while learning.
Memory Management
As users scroll past cards, they're removed from the DOM, preventing memory bloat during long browsing sessions.
The Card Flip Animation
Each skill card has two states:
Front
: Shows the animated controller with the required inputs
Back
: Displays the actual FIFA skill move (GIF or video)
I implemented this with a simple state toggle and conditional rendering:
The CSS handles the smooth flip animation, while the SVG controller animations continue running on the front side.

Technical Challenges and Solutions
Challenge 1: Animation Synchronization
Problem: Multiple controller elements needed to animate in perfect sequence. Solution: Built a timing orchestration system that calculates start times relative to previous animations.
Challenge 2: SVG Responsiveness
Problem: Complex SVG controllers needed to scale properly across devices. Solution: Used responsive viewBox attributes and percentage-based sizing.
Challenge 3: Performance with Many Cards
Problem: Rendering 40+ animated cards simultaneously caused performance issues. Solution: Implemented infinite scroll with lazy loading and DOM cleanup.
Results and Impact
The final application delivers:
Smooth 60fps animations
even on mobile devices
Intuitive learning experience
that visually connects controller inputs to skills
Scalable architecture
that easily accommodates new skills and controllers
Cross-platform compatibility
from phones to desktops
Key Takeaways
SVGs are perfect for interactive UI elements
that need to be scalable and animatable
Modular component architecture
makes complex animations manageable
Performance optimization
is crucial when dealing with multiple animated elements
User experience
should drive technical decisions – the flip card interaction makes learning more engaging
The project proved that with the right architectural decisions, you can create rich, interactive experiences that are both performant and educational. SVGs, combined with modern React patterns and animation libraries, provide a powerful toolkit for building engaging web applications.
The complete source code showcases how thoughtful SVG structuring and animation orchestration can create compelling user experiences that would be difficult to achieve with other technologies.