> loading_
# To see the new AI-powered animation generation in action,
# modify the prompt sent to your local LLM (e.g., via LM Studio).
# 1. Locate the `generateThemeFromPrompt` function in your service layer.
# Previously, the prompt was focused solely on colors.
# BEFORE: Prompt for a simple color array
# const oldPrompt = `
# Based on the following description, generate a JSON array of 5 hex color codes
# that represent the mood. Only return the JSON array.
# Description: "${userText}"
# `;
# 2. Update the prompt to ask for a structured JSON object including animation params.
# This new prompt engineering is key to getting the desired output.
const newPrompt = `
Analyze the mood and context of the following description.
Generate a JSON object with two keys: "colors" and "animation".
- "colors" should be an array of 5 hex color strings.
- "animation" should be an object with three keys:
- "style": string (e.g., "waves", "orbs", "plasma")
- "speed": float (a value between 0.1 and 2.0)
- "complexity": integer (a value between 1 and 5)
Only return the raw JSON object and nothing else.
Description: "${userText}"
`;
# 3. Update the React component that renders the screen cover.
# It should now accept the 'animation' object from the theme preset.
# BEFORE: Component only needed colors
# <GradientAnimationComponent colors={theme.colors} />
# AFTER: Pass the entire animation object to the component
# The component's internal logic will now use these new props to control the animation.
<GradientAnimationComponent
colors={theme.colors}
animation={theme.animation}
/>
# Try it out with a prompt like "calm, serene ocean" and observe how the LLM
# generates both a blue/green palette and a slow 'waves' animation style.