build something in one html file
- User
build something in one html file
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
build something in one html file
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here's a simple but complete HTML file that creates a colorful interactive counter:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Interactive Counter</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
}
.container {
text-align: center;
padding: 2rem;
background: white;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.counter {
font-size: 4rem;
margin: 1rem 0;
color: #374151;
}
button {
padding: 0.5rem 1rem;
margin: 0 0.5rem;
font-size: 1.2rem;
border: none;
border-radius: 5px;
cursor: pointer;
transition: transform 0.1s;
}
button:active {
transform: scale(0.95);
}
.increment {
background: #10B981;
color: white;
}
.decrement {
background: #EF4444;
color: white;
}
.reset {
background: #6B7280;
color: white;
}
</style>
</head>
<body>
<div class="container">
<h1>Counter</h1>
<div class="counter" id="count">0</div>
<div>
<button class="decrement" onclick="updateCounter(-1)">-</button>
<button class="reset" onclick="resetCounter()">Reset</button>
<button class="increment" onclick="updateCounter(1)">+</button>
</div>
</div>
<script>
let count = 0;
const countDisplay = document.getElementById('count');
function updateCounter(value) {
count += value;
countDisplay.textContent = count;
}
function resetCounter() {
count = 0;
countDisplay.textContent = count;
}
</script>
</body>
</html>
This creates a modern-looking counter with increment, decrement, and reset buttons. You can save this code in a file with a .html extension and open it in any web browser. Would you like me to explain any part of the code or create something different?