Open
Conversation
Implement a new widget that fetches GIFs from the Giphy API, decodes
them frame-by-frame, converts each frame to ASCII art using luminance
mapping, and animates them in the terminal.
New files:
- src/feeds/giphy.rs: Giphy API client supporting search, trending,
and random modes. Downloads GIFs and decodes frames into ASCII art
using brightness-to-character mapping (" .:-=+*#%@").
- src/ui/widgets/giphy.rs: TUI widget that renders ASCII frames with
configurable animation speed, pause/resume, and manual frame stepping
via scroll keys.
Modified files:
- Cargo.toml: Add gif crate for GIF frame decoding
- src/feeds/mod.rs: Add Giphy variant to FeedData enum, GiphyGif struct
- src/config.rs: Add GiphyConfig with api_key, query, mode,
frame_delay_ms options
- src/ui/widgets/mod.rs: Register giphy widget module
- src/app.rs: Wire up GiphyWidget creation and animation ticking
Configuration example (config.toml):
[[widgets]]
type = "giphy"
title = "GIF Player"
api_key = "YOUR_GIPHY_API_KEY"
query = "cats"
mode = "search"
frame_delay_ms = 150
position = { row = 0, col = 2 }
Closes #55
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new widget that fetches GIFs from the Giphy API, decodes them frame-by-frame, converts each frame to ASCII art, and animates them directly in the terminal.
src/feeds/giphy.rs): Supports three modes —search(query-based),trending, andrandom. Fetches the small fixed-height variant for optimal terminal rendering. Downloads the GIF binary and decodes all frames.0.299R + 0.587G + 0.114B), then mapped to an ASCII character gradient:" .:-=+*#%@".src/ui/widgets/giphy.rs): Renders ASCII frames sequentially with configurable frame delay (default 150ms). Supports pause/resume and manual frame stepping via scroll keys. Shows frame counter and GIF title in the border.config.toml:Files changed
Cargo.tomlgifcrate dependencysrc/feeds/giphy.rssrc/feeds/mod.rsGiphyvariant toFeedData,GiphyGifstructsrc/ui/widgets/giphy.rssrc/ui/widgets/mod.rsgiphymodulesrc/config.rsGiphyConfigstruct +Giphywidget variantsrc/app.rsPerformance considerations
Test plan
Closes #55
🤖 Generated with Claude Code