Create video elephant ridung bike
- User
Create video elephant ridung bike
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Create video elephant ridung bike
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
I'll help you create a simple HTML5 Canvas animation of an elephant riding a bicycle. This single-file solution uses vanilla JavaScript and can be run in any modern browser:
<!DOCTYPE html>
<html>
<head>
<title>Elephant Riding Bike Animation</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
canvas {
border: 3px solid #333;
border-radius: 8px;
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
</style>
</head>
<body>
<canvas id="animationCanvas" width="800" height="400"></canvas>
<script>
const canvas = document.getElementById('animationCanvas');
const ctx = canvas.getContext('2d');
let animationFrame;
let position = -100;
let pedalAngle = 0;
function drawBike(x) {
// Bike frame
ctx.fillStyle = '#2c3e50';
ctx.beginPath();
ctx.moveTo(x, 250);
ctx.lineTo(x + 80, 250);
ctx.lineTo(x + 120, 200);
ctx.lineTo(x + 200, 200);
ctx.lineTo(x + 240, 250);
ctx.lineTo(x + 320, 250);
ctx.stroke();
// Wheels
ctx.fillStyle = '#34495e';
ctx.beginPath();
ctx.arc(x + 50, 300, 50, 0, Math.PI*2);
ctx.fill();
ctx.beginPath();
ctx.arc(x + 250, 300, 50, 0, Math.PI*2);
ctx.fill();
// Pedals
ctx.save();
ctx.translate(x + 120, 200);
ctx.rotate(pedalAngle);
ctx.fillStyle = '#e74c3c';
ctx.fillRect(-10, -50, 20, 30);
ctx.restore();
}
function drawElephant(x) {
// Body
ctx.fillStyle = '#95a5a6';
ctx.beginPath();
ctx.ellipse(x + 180, 180, 50, 30, 0, 0, Math.PI*2);
ctx.fill();
// Head
ctx.beginPath();
ctx.arc(x + 230, 150, 40, 0, Math.PI*2);
ctx.fill();
// Trunk
ctx.beginPath();
ctx.moveTo(x + 250, 150);
ctx.quadraticCurveTo(x + 270, 180, x + 290, 160);
ctx.stroke();
// Legs
ctx.fillStyle = '#7f8c8d';
ctx.fillRect(x + 150, 200, 20, 80);
ctx.fillRect(x + 200, 200, 20, 80);
}
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Draw road
ctx.fillStyle = '#95a5a6';
ctx.fillRect(0, 300, canvas.width, 100);
// Update animation values
position += 2;
pedalAngle += 0.1;
// Reset position when off-screen
if(position > canvas.width) position = -100;
// Draw elements
drawBike(position);
drawElephant(position);
animationFrame = requestAnimationFrame(animate);
}
// Start animation
animate();
</script>
</body>
</html>
This code creates a simple looping animation with:
To run:
For a more realistic version, you could:
Would you like me to enhance any particular aspect of the animation?
3
I'll enhance the animation with sound effects as you requested. Here's the updated code with sound integration:
<!DOCTYPE html>
<html>
<head>
<title>Elephant Riding Bike Animation</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
font-family: Arial, sans-serif;
}
.container {
position: relative;
}
canvas {
border: 3px solid #333;
border-radius: 8px;
box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.controls {
margin-top: 15px;
text-align: center;
}
button {
background: #3498db;
border: none;
color: white;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin: 0 5px;
}
button:hover {
background: #2980b9;
}
</style>
</head>
<body>
<div class="container">
<canvas id="animationCanvas" width="800" height="400"></canvas>
<div class="controls">
<button id="soundToggle">🔊 Sound On</button>
</div>
</div>
<script>
const canvas = document.getElementById('animationCanvas');
const ctx = canvas.getContext('2d');
let animationFrame;
let position = -100;
let pedalAngle = 0;
let isSoundOn = true;
// Sound setup
const bikeSound = new Audio('https://freesound.org/data/previews/447/447933_6142149-lq.mp3');
const elephantSound = new Audio('https://freesound.org/data/previews/389/389659_8372070-lq.mp3');
// Configure sounds
bikeSound.loop = true;
bikeSound.volume = 0.3;
elephantSound.volume = 0.7;
// Sound toggle button
document.getElementById('soundToggle').addEventListener('click', function() {
isSoundOn = !isSoundOn;
if (isSoundOn) {
this.textContent = "🔊 Sound On";
bikeSound.play();
} else {
this.textContent = "🔇 Sound Off";
bikeSound.pause();
}
});
function drawBike(x) {
// Bike frame
ctx.fillStyle = '#2c3e50';
ctx.beginPath();
ctx.moveTo(x, 250);
ctx.lineTo(x + 80, 250);
ctx.lineTo(x + 120, 200);
ctx.lineTo(x + 200, 200);
ctx.lineTo(x + 240, 250);
ctx.lineTo(x + 320, 250);
ctx.stroke();
// Wheels
ctx.fillStyle = '#34495e';
ctx.beginPath();
ctx.arc(x + 50, 300, 50, 0, Math.PI*2);
ctx.fill();
ctx.beginPath();
ctx.arc(x + 250, 300, 50, 0, Math.PI*2);
ctx.fill();
// Pedals
ctx.save();
ctx.translate(x + 120, 200);
ctx.rotate(pedalAngle);
ctx.fillStyle = '#e74c3c';
ctx.fillRect(-10, -50, 20, 30);
ctx.restore();
// Add a simple basket
ctx.fillStyle = '#f1c40f';
ctx.fillRect(x + 170, 190, 30, 20);
}
function drawElephant(x) {
// Body
ctx.fillStyle = '#95a5a6';
ctx.beginPath();
ctx.ellipse(x + 180, 180, 50, 30, 0, 0, Math.PI*2);
ctx.fill();
// Head
ctx.beginPath();
ctx.arc(x + 230, 150, 40, 0, Math.PI*2);
ctx.fill();
// Trunk
ctx.beginPath();
ctx.moveTo(x + 250, 150);
ctx.quadraticCurveTo(x + 270, 180, x + 290, 160);
ctx.stroke();
// Ears
ctx.fillStyle = '#7f8c8d';
ctx.beginPath();
ctx.ellipse(x + 210, 130, 25, 15, Math.PI/4, 0, Math.PI*2);
ctx.fill();
ctx.beginPath();
ctx.ellipse(x + 250, 130, 25, 15, -Math.PI/4, 0, Math.PI*2);
ctx.fill();
// Legs
ctx.fillStyle = '#7f8c8d';
ctx.fillRect(x + 150, 200, 20, 80);
ctx.fillRect(x + 200, 200, 20, 80);
ctx.fillRect(x + 220, 200, 20, 80);
ctx.fillRect(x + 270, 200, 20, 80);
// Eyes
ctx.fillStyle = 'black';
ctx.beginPath();
ctx.arc(x + 245, 140, 5, 0, Math.PI*2);
ctx.fill();
// Tusks
ctx.fillStyle = 'white';
ctx.beginPath();
ctx.moveTo(x + 265, 160);
ctx.lineTo(x + 285, 175);
ctx.stroke();
}
function drawBackground() {
// Sky
ctx.fillStyle = '#87CEEB';
ctx.fillRect(0, 0, canvas.width, 300);
// Sun
ctx.fillStyle = '#F9D71C';
ctx.beginPath();
ctx.arc(700, 80, 40, 0, Math.PI*2);
ctx.fill();
// Clouds
ctx.fillStyle = 'white';
drawCloud(100, 80, 1);
drawCloud(400, 50, 1.5);
drawCloud(600, 100, 0.8);
// Road
ctx.fillStyle = '#95a5a6';
ctx.fillRect(0, 300, canvas.width, 100);
// Road markings
ctx.fillStyle = '#f1c40f';
for(let i = 0; i < canvas.width; i += 80) {
ctx.fillRect(i, 350, 40, 5);
}
}
function drawCloud(x, y, scale) {
ctx.beginPath();
ctx.arc(x, y, 20 * scale, 0, Math.PI*2);
ctx.arc(x + 15 * scale, y - 10 * scale, 15 * scale, 0, Math.PI*2);
ctx.arc(x + 30 * scale, y, 20 * scale, 0, Math.PI*2);
ctx.arc(x + 15 * scale, y + 10 * scale, 15 * scale, 0, Math.PI*2);
ctx.fill();
}
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Draw background
drawBackground();
// Update animation values
position += 2;
pedalAngle += 0.1;
// Reset position when off-screen
if(position > canvas.width) position = -100;
// Draw elements
drawBike(position);
drawElephant(position);
// Play sounds
if (isSoundOn) {
if (position === -100) {
bikeSound.currentTime = 0;
bikeSound.play();
}
// Play elephant sound periodically
if (Math.floor(position) % 300 === 0) {
elephantSound.currentTime = 0;
elephantSound.play();
}
}
animationFrame = requestAnimationFrame(animate);
}
// Start animation
animate();
</script>
</body>
</html>
This enhanced version includes:
Note: The sound URLs are placeholders pointing to free sound effects on freesound.org. You may need to:
Would you like me to make any other enhancements to this animation?