Animated Content
Checks for large GIFs that could be converted to video
Checks for large GIFs that could be converted to video
| Rule ID | perf/animated-content |
| Category | Performance |
| Scope | Per-page |
| Severity | warning |
| Weight | 4/10 |
Solution
Convert large animated GIFs to video formats (MP4, WebM) for 50-90% smaller files. Use <video autoplay loop muted playsinline> for GIF-like behavior. Tools: ffmpeg, gif2webm, or Cloudinary can automate conversion. Modern video codecs are far more efficient than GIF for animation.
Options
This rule supports the following configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
gif_size_threshold_kb | unknown | undefined | GIF size threshold in KB above which to suggest video conversion |
Configuration Example
squirrel.toml
toml[rules."perf/animated-content"]
gif_size_threshold_kb = undefinedEnable / Disable
Disable this rule
squirrel.toml
toml[rules]
disable = ["perf/animated-content"]Disable all Performance rules
squirrel.toml
toml[rules]
disable = ["perf/*"]Enable only this rule
squirrel.toml
toml[rules]
enable = ["perf/animated-content"]
disable = ["*"]