📋 Request ID: swe-1759098198466-5b008993
⏰ Generated: 28/09/2025, 18:23:18
📁 Files: 2 files created
State Management
Interactive Buttons
Live Text Input
Modern Styling
Responsive Design
Demo.jsx (React JSX)
import React, { useState } from 'react';
import './Demo.css';
const Demo = () => {
const [count, setCount] = useState(0);
const [message, setMessage] = useState('Hello from Demo!');
return (
<div className="demo">
<h1>{message}</h1>
<div className="counter-section">
<p>Count: {count}</p>
<button onClick={() => setCount(count + 1)}>Increment</button>
<button onClick={() => setCount(count - 1)}>Decrement</button>
<button onClick={() => setCount(0)}>Reset</button>
</div>
<div className="input-section">
<input
type="text"
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder="Enter your message..."
/>
</div>
</div>
);
};
export default Demo;
Demo.css (CSS)
.demo {
max-width: 600px;
margin: 0 auto;
padding: 40px 20px;
text-align: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.demo h1 {
font-size: 2.5rem;
margin-bottom: 30px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.counter-section {
background: rgba(255, 255, 255, 0.1);
padding: 30px;
border-radius: 20px;
margin-bottom: 30px;
backdrop-filter: blur(10px);
}
.counter-section p {
font-size: 1.5rem;
margin-bottom: 20px;
font-weight: 600;
}
.counter-section button {
background: rgba(255, 255, 255, 0.2);
color: white;
border: 2px solid rgba(255, 255, 255, 0.3);
padding: 12px 24px;
margin: 0 10px;
border-radius: 25px;
cursor: pointer;
font-weight: 600;
transition: all 0.3s ease;
}
.counter-section button:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.input-section {
background: rgba(255, 255, 255, 0.1);
padding: 20px;
border-radius: 15px;
backdrop-filter: blur(10px);
}
.input-section input {
width: 100%;
padding: 15px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 25px;
background: rgba(255, 255, 255, 0.1);
color: white;
font-size: 1rem;
text-align: center;
}
.input-section input::placeholder {
color: rgba(255, 255, 255, 0.7);
}
.input-section input:focus {
outline: none;
border-color: rgba(255, 255, 255, 0.6);
background: rgba(255, 255, 255, 0.2);
}