UNPKG

codebridge-ai

Version:

Complete fullstack AI coding platform with AST-based code integration and local LLM support. Now with comprehensive web technology support (HTML/CSS/JS) plus JavaScript, Python, Rust, and C++.

20 lines 1.93 kB
{ "timestamp": "2025-08-02T16:16:27.388Z", "model": "deepseek-coder:6.7b", "language": "web", "scenario": "css-responsive", "task": "Make responsive with flexbox/grid and mobile-first approach", "originalCode": ".container {\n width: 1200px;\n margin: 0 auto;\n}\n\n.card {\n width: 300px;\n float: left;\n margin: 10px;\n}", "rawResponse": "You can use Flexbox or Grid to make your web design more responsive. Here's how you could do it using Flexbox:\n\n```web\n<div class=\"container\">\n <div class=\"card\">Content 1</div>\n <div class=\"card\">Content 2</div>\n <!-- More cards... -->\n</div>\n```\n\nAnd the CSS:\n\n```web\n.container {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-around; /* This will distribute items evenly in the container */\n}\n\n.card {\n flex: 1 0 200px; /* This is a shorthand for flex-grow, flex-shrink and flex-basis combined. It means that the card will grow as needed but not shrink below its base size of 200px */\n margin: 10px;\n}\n```\n\nThis code will create a row of cards that wrap to the next line when there is not enough space, and evenly distribute the remaining space between them. The `flex` property is a shorthand for `flex-grow`, `flex-shrink` and `flex-basis` which determine how a flex item grows or shrinks to fit the container.\n", "improvedCode": "web\n.container {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-around; /* This will distribute items evenly in the container */\n}\n\n.card {\n flex: 1 0 200px; /* This is a shorthand for flex-grow, flex-shrink and flex-basis combined. It means that the card will grow as needed but not shrink below its base size of 200px */\n margin: 10px;\n}", "duration": 7071, "success": false, "qualityMetrics": { "hasCode": true, "hasResponsive": true, "score": 0.35714285714285715, "rawScore": 0.5, "maxScore": 1.4 }, "error": null }