outshow random html/css/javascript codes for testing in code block tags in this chat
- User
outshow random html/css/javascript codes for testing in code block tags in this chat
- Assistant
Sure! Here's a random HTML/CSS/JavaScript example project for testing. It involves a button that changes the background color of the page when clicked:
html<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Random Background Color</title> <style> body { font-family: Arial, sans-serif; text-align: center; margin: 0; padding: 50px; background-color: #f4f4f4; transition: background-color 0.5s ease; } h1 { color: #333; } button { padding: 10px 20px; font-size: 18px; border: none; border-radius: 5px; cursor: pointer; background: #007bff; color: white; transition: background 0.3s ease; } button:hover { background: #0056b3; } </style> </head> <body> <h1>Random Background Color Generator</h1> <p>Click the button to change the background color:</p> <button onclick="changeBackgroundColor()">Change Color</button> <script> function changeBackgroundColor() { // Generate random RGB values const red = Math.floor(Math.random() * 256); const green = Math.floor(Math.random() * 256); const blue = Math.floor(Math.random() * 256); // Set the body's background color document.body.style.backgroundColor = `rgb(${red}, ${green}, ${blue})`; } </script> </body> </html>What it does:
- The page displays a button and a heading.
- When you click the "Change Color" button, the JavaScript function generates a random RGB color and updates the background color of the page.
You can copy-paste this code into a file and open it in a browser to test it out.
- User
draw svg code just
- Assistant
Sure! Here's a random SVG example showcasing a simple illustration with some shapes (circle, rectangle, and line):
html<svg width="300" height="200" xmlns="http://www.w3.org/2000/svg"> <!-- Background Rectangle --> <rect x="0" y="0" width="300" height="200" fill="#f0f0f0" /> <!-- Circle --> <circle cx="150" cy="100" r="50" fill="#007bff" stroke="#0056b3" stroke-width="3" /> <!-- Rectangle --> <rect x="90" y="130" width="120" height="50" fill="#28a745" stroke="#1e7b31" stroke-width="2" /> <!-- Line --> <line x1="50" y1="50" x2="250" y2="50" stroke="#ff4f5a" stroke-width="4" stroke-linecap="round" /> <!-- Text --> <text x="150" y="120" font-size="14" text-anchor="middle" fill="white">I am a Circle!</text> </svg> - User
draw it
- Assistant
Unfortunately, I cannot directly display or render the SVG drawing in this chat environment since it's a text-based interface. However, you can easily copy and paste the SVG code provided into an HTML file or an online SVG viewer to view the drawing.
In case you're unsure how to do so, here's how you can see the drawing:
- Copy the SVG code:
html
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.