Add LLM-driven theme-matched quote card generator with emotion-based palettes#141
Open
Add LLM-driven theme-matched quote card generator with emotion-based palettes#141
Conversation
Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add theme-matched background based on quote meaning
Add LLM-driven theme-matched quote card generator with emotion-based palettes
Dec 5, 2025
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.
Implements dynamic Quote of the Day cards that analyze quote sentiment via LLM and apply matching visual themes. Cards adapt background gradients and stylistic effects based on emotional tone.
Core Components
scripts/analyze_quote.py: OpenAI-powered quote analysis extracting sentiment, tone, theme, and color profile. Falls back to neutral palette when API unavailable.scripts/generate_quote_card.py: CardBase-integrated SVG generator with smart text wrapping, dynamic gradient selection, and conditional visual effects.Emotion Palettes: 6 gradient pairs in
theme.json(warm/cool/neutral/ethereal/cosmic/grounded) mapped to quote emotional profiles.Stylistic Effects: Conditional decorations based on keywords:
sunrise/sky→ horizontal gradient bandsstorm/rain→ diagonal streakscosmic/universe→ dynamically positioned starfieldgentle/soft→ vignette overlaySchema & Configuration
Extended
theme.schema.jsonwith emotion gradient definitions. Added quote card dimensions (480×200) to theme config. OpenAI settings configurable viaOPENAI_MODELenv var (defaults to gpt-4o-mini, temp=0.3, max_tokens=200).Workflow Integration
Integrated into
build-profile.ymlbetween Oura mood generation and SVG optimization. Creates sample quote if missing, analyzes with LLM, generates card, commitsquotes/quote*.{json,svg}.Example
Generates card with
#FFAD7A → #FF6F5Egradient plus sunrise effect overlay.Testing
21 unit tests covering fallback logic, text wrapping, palette selection, and effect generation. All 247 existing tests pass. Zero CodeQL alerts, zero dependency vulnerabilities.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.