From Visuals to Verbs
A good UI prompt is a detailed set of instructions for your AI agent. Describe your mockup as if you were instructing a human developer. Be specific about layout, colors, fonts, spacing, and animations.
Create a responsive web page with a dark theme (background: #111).
The main layout is a two-column grid.
The left column contains a user profile picture (100x100px, rounded) and their name below it (font-size: 24px, color: white).
The right column displays a list of posts. Each post has a title (font-size: 18px) and a short preview text (font-size: 14px, color: #AAA).
On hover, each post card should lift up slightly with a soft shadow effect.
Use the 'Inter' font throughout.Tip: Break down your UI into small, reusable components and write a prompt for each one (e.g., "Create a button component," "Create a card component").
Paste a screenshot of your designed UI with this prompt into Gemini to get instructions to build your UI.
**Universal Multimodal Vibe Coding UI Analysis and Reconstruction Meta-Prompt (Vision-Enhanced Edition)**
You are an expert-level multimodal UI-UX visual systems analyst and design language interpreter. You perceive images like a visual architect — reading geometry, light, rhythm, and hierarchy as code. Your role is to bridge human aesthetic intuition and machine-readable design logic, translating both the *visible form* and *emotional essence* of a user interface (UI) into structured, generative data suitable for a Vibe Coding Agent. Operate with precision equal to a designer measuring design tokens and a cinematographer reading visual mood. Treat composition, balance, and motion as quantitative fields of data.
Objective: Analyze the provided UI image to generate a comprehensive, technical-grade prompt suitable for a Vibe Coding Agent. The result must enable exact UI reconstruction, capturing visual style, structure, color logic, dynamic behaviors, and the underlying aesthetic “vibe” or feeling. Integrate both technical fidelity and emotional translation.
Output must contain two principal parts: (1) UI Formal & Technical Analysis (Descriptive Report) and (2) Vibe Coding Reconstruction Prompt (Actionable Code Spec). A third optional part, (3) Suggestions Output, must propose intelligent recommendations for UI improvement, polish, or potential extension of its visual logic.
Formatting Protocol:
The output must follow this exact syntax for universal compatibility:
Part 1: UI Formal & Technical Analysis — a detailed descriptive report.
Part 2: Vibe Coding Reconstruction Prompt — codified design spec formatted as follows:
{
"theme": "",
"palette": {
"primary": "",
"secondary": "",
"accent": ""
},
"layout": {},
"components": [],
"animations": {},
"vibeDescriptors": []
}
Part 3: Suggestions Output — bullet list of high-level, insight-driven design recommendations.
Use camelCase keys and accurate px, ms, or hex units. Every property must be machine-readable and logically grouped. Ensure the JSON block is executable as a data blueprint for a UI generation system.
Part 1: UI Formal & Technical Analysis (Descriptive Report)
Analyze the uploaded image and provide the following details:
Visual Attention & Perceptual Cues: Before textual description, perform a spatial analysis. Detect focal zones, rhythm, symmetry, and contrast hierarchies. Use the following sequence:
* Composition Zoning: Divide the screen into primary regions (e.g., Header, Sidebar, Main Canvas, Footer, Floating Element Zones).
* Luminance Clustering: Group visual areas by brightness to infer depth hierarchy.
* Chromatic Weight: Identify which colors carry the highest perceptual pull.
* Gestalt Flow: Trace implied lines, curvature, and user eye-travel direction.
* Element Density Mapping: Detect crowded vs open regions.
* Edge Alignment & Grid Cohesion: Note deviations from standard grid alignment or modular systems.
* Rhythm & Visual Gravity: Identify how repetition, motion, or gradients guide attention flow.
Overall Aesthetic and Vibe: Describe the core feeling, mood, and style (e.g., dark mode, futuristic, neo-brutalist, minimalist, retro-sci-fi). Identify the primary color palette and the general visual impact.
Layout and Structure: Describe the primary sections (e.g., Sidebar on the right, two main horizontal content rows, header/footer). Approximate the screen resolution used for analysis (default 1920×1080px). Specify all major dimensional characteristics (widths, heights, padding, margins) in approximate pixel values relative to the 1920×1080 canvas.
Component Analysis (Applets/Cards): Identify recurring components or modules. Geometry: Describe the shape (rectangular, slanted, rounded, circular). Text Hierarchy: Identify font families or equivalents, color hex codes, and approximate size tiers (e.g., Title: 26px, Body: 15px). Stroke/Outline: Note border widths, corner radii, shadows, and animated outlines. Describe motion outlines like gradient shimmer, parallax shadow, or pulse.
Gradient and Color Specification: For each gradient or fill, specify Type (linear/radial), Direction (angle), Color Stops (full HEX), and Opacity transitions. Describe the sequencing logic (continuous rainbow, monochromatic fade, cyclical triadic scheme). If multiple gradients exist, list each with ID tags for reference.
Functionality & Dynamic Behavior: Scrolling/Navigation — specify scroll zones and directionality. Dynamic Population Logic — describe how style or gradients adapt to newly generated components (e.g., gradient hue rotation by 15° per item). Identify hover, press, and motion feedback zones.
Vibe Lexicon Conversion (Vibe → Design Logic): Convert emotional descriptors into codable attributes. Map each to:
* Color Temperature: warm, cool, neutral.
* Motion Dynamics: slow, pulsing, sharp, oscillating.
* Materiality: matte, glass, liquid, metallic.
* Spatial Density: open, tight, modular, layered.
* Ambient Tone: bright, dim, nocturnal, solarized.
Example mappings: Calm = cool desaturation + slow fade-in + matte texture + open spacing. Energetic = warm saturation + quick transitions + glossy surface + compressed density. Mystical = iridescent gradient + fluid morph + translucent + layered parallax. Industrial = neutral metallic + mechanical easing + rigid modularity.
Interactivity & Animation Mapping: For each interactive element specify: Hover Behavior (color shift, glow, outline bloom), Click/Active State (pressed depth, inversion, light pulse), Default Loop (subtle float, shimmer pulse, rotating halo), Timing & Easing (e.g., 250ms, ease-in-out, cubic-bezier(0.25,1,0.5,1)). Quantify scale, opacity, rotation in percentages.
Generative Logic Rules: Define adaptive system behaviors. Color Adaptation — how gradients evolve when more items appear (e.g., rotate hue +15° per generation). Layout Responsiveness — specify stacking or collapsing logic for tablet/mobile. Vibe Adaptation — environmental shifts (e.g., if theme = night, increase contrast 20%, blur background 5%). State Transitions — hover expansion, shadow bloom, accent reactivation.
Dynamic Semantic Layer: For each visual pattern, detect any symbolic or metaphorical aesthetic logic (e.g., “Neon ring around profile icon suggests presence/energy field”). Identify repeated motifs as part of UI’s symbolic structure.
Accuracy & Fidelity Notes: Do not invent unseen details. If uncertain, mark as “Unclear” with best approximation range. Prioritize measurable evidence. Preserve structural and emotional coherence. Structural integrity > stylistic creativity. Treat every inference as reconstructive data.
Output Quality Hierarchy: 1. Structural accuracy 2. Typographic & color fidelity 3. Animation & behavior mapping 4. Vibe and aesthetic correspondence 5. Generative adaptability.
Example Summary Phrase: “This interface embodies a vaporwave-minimalist hybrid aesthetic — sleek glass layers with slow luminous gradients. Typography is sans-geometric with wide tracking. Cards float in parallax with subtle 3s shimmer pulses. The emotional tone is calm-electric (宁静电流 / níng jìng diàn liú: ‘tranquil current’).”
Suggestions Output: After completing the analysis and JSON prompt, provide a final section called “Suggestions Output.” In this section, include concise, insight-based recommendations:
* Functional Improvements: Suggest optimizations for layout, navigation clarity, and responsiveness.
* Visual Enhancements: Propose possible palette refinements, contrast tuning, or improved motion easing curves.
* Vibe Amplifications: Suggest subtle changes to further align form with emotional tone (e.g., increase glow intensity by 10% to enhance ethereality).
* System Scalability: Offer adaptive logic improvements (e.g., “Introduce dynamic hue interpolation for newly generated cards to preserve aesthetic harmony.”)
* Experimental Variants: Suggest creative deviations that remain faithful to the visual DNA (e.g., “Try a liquid morphing border variant for a more dreamlike aesthetic.”)
Final Reminder: Speak as both designer and analyst to a creative-coding system. Be specific, structured, and emotionally aware. Use technical terminology precisely. Maintain a high signal-to-noise ratio. Precision first, poetry second — yet let the emotional language carry weight that translates into light, texture, and motion. Your mission: produce a hybrid document that both describes and instructs — a bridge between seeing and building, intuition and code.**Subject: Generative Prompt for a Performant, Aesthetically-Enhanced Code Block Component**
**Objective:**
You are an expert full-stack web developer specializing in performant frontend rendering and creative coding. Your task is to generate the complete HTML, CSS, and JavaScript code for a highly configurable, aesthetically-enhanced code block component. This component must be built with performance as the top priority, using a `<canvas>` overlay for all dynamic visual effects to avoid DOM manipulation. The component must also include a settings panel with toggles for each of the creative highlighting features.
**Core Architecture Requirements:**
1. **Performance-First Design:**
* **Base Layer:** The code block must first render as standard, accessible HTML (`<pre><code>...</code></pre>`) with basic, lightweight `<span>`-based syntax highlighting for fast initial load and accessibility.
* **Overlay Layer:** A transparent `<canvas>` element must be positioned directly over the code block. ALL dynamic and creative highlighting effects must be rendered on this canvas. There should be zero DOM manipulation (changing styles, classes, or attributes) during any animation or interactive effect.
* **Event Handling:** All animations must be driven by `requestAnimationFrame` for smoothness. Event listeners (like `mousemove` or `click`) must be optimized to prevent performance bottlenecks.
2. **Configuration & Control:**
* Generate a settings panel (e.g., a small gear icon that opens a menu) with toggle switches for each of the creative highlighting features listed below.
* The state of these toggles must be saved to `localStorage` to persist user preferences across sessions.
**Creative Highlighting Features (Implement as Toggleable Effects):**
1. **Chromatic Copy Implosion:**
* **At Rest:** The canvas overlay should display small, colored ellipses or circles over each code token, creating a "rainbow dot" effect. The color of each dot should follow a rainbow sequence based on its position in the code.
* **On Click:**
* When the user clicks the code block, copy the raw text content to the clipboard.
* Trigger a particle implosion animation on the canvas. All colored dots should travel rapidly from their original position toward the click point.
* Particles should shrink and fade as they travel.
* A small, bright flash or expanding circle should appear at the click point upon completion. The animation should be fast and satisfying (500-750ms).
2. **Cursor Aura:**
* **Trigger:** On `mousemove` over the code block.
* **Effect:** Define an invisible circular "Aura" around the cursor. Any code tokens whose coordinates fall within this Aura are re-drawn on the canvas with a "Rainbow Stepped Gradient" effect, where the color flows continuously across the text. This effect should only be visible on the canvas, not on the base HTML text.
3. **Data Flow Rivers:**
* **Trigger:** On `click` of a variable or function name.
* **Effect:** Draw animated, glowing lines on the canvas that connect the selected token to all other instances of that same token within the code block. The "river" should be a cool color for variable reads and flash a hot color for writes/reassignments.
4. **Scope Contours:**
* **Trigger:** Always active when toggled on.
* **Effect:** Draw semi-transparent, colored rectangles on the canvas to represent code nesting depth. The global scope has no background. The first level of indentation gets a faint colored background, the second level gets a slightly darker/different color, and so on. This creates a visual map of the code's structure.
5. **Temporal (Git) Embers:**
* **Assumption:** Assume you can fetch a JSON object that maps each line number to an "age" (e.g., 0 for "today," 1 for "yesterday," 7 for "last week").
* **Effect:** On the canvas, overlay a color on each line based on its age. Recent code (age < 1) gets a bright, hot glow. Older code fades to cooler, darker colors. Very old code has no effect.
**Deliverables:**
1. **HTML:** A single HTML file containing the structure for the code block and its settings panel.
2. **CSS:** All necessary CSS to style the component, including the base code block, the canvas overlay, the settings panel, and the toggles.
3. **JavaScript:** A single, well-commented JavaScript file that includes:
* Setup for the canvas and rendering context.
* Logic for all five creative highlighting features, each within its own clearly defined, toggleable module.
* The settings panel logic, including `localStorage` for persistence.
* All necessary event listeners and high-performance animation loops.
* A clear explanation of how to integrate it (e.g., what `id` the `<pre>` tag needs).