Spaces:
Running
Running
File size: 12,248 Bytes
081eb50 5bfbbae | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BeatBot - Celebrate GPT-5</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tone@14.7.77/build/Tone.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Exo+2:wght@300;400;600&display=swap');
:root {
--primary: #6366f1;
--secondary: #a855f7;
--accent: #06b6d4;
--dark: #0f172a;
--light: #f8fafc;
}
body {
font-family: 'Exo 2', sans-serif;
background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
color: var(--light);
overflow-x: hidden;
}
.orbitron {
font-family: 'Orbitron', sans-serif;
}
.beat-grid {
display: grid;
grid-template-columns: repeat(8, 1fr);
gap: 0.5rem;
margin: 1rem 0;
}
.beat-pad {
aspect-ratio: 1;
border-radius: 0.5rem;
background: rgba(255, 255, 255, 0.1);
border: 2px solid rgba(255, 255, 255, 0.2);
cursor: pointer;
transition: all 0.2s ease;
}
.beat-pad.active {
background: var(--accent);
border-color: var(--accent);
box-shadow: 0 0 15px var(--accent);
transform: scale(1.05);
}
.beat-pad.playing {
animation: pulse 0.3s ease;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.1); }
100% { transform: scale(1); }
}
.visualizer {
height: 150px;
background: rgba(0, 0, 0, 0.3);
border-radius: 0.5rem;
margin: 2rem 0;
position: relative;
overflow: hidden;
}
.viz-bar {
position: absolute;
bottom: 0;
width: 4px;
background: var(--primary);
border-radius: 2px 2px 0 0;
transition: height 0.1s ease;
}
.glow-text {
text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}
.neon-border {
border: 2px solid var(--primary);
box-shadow: 0 0 10px var(--primary), inset 0 0 10px var(--primary);
}
</style>
</head>
<body class="min-h-screen flex flex-col">
<!-- Hero Section -->
<header class="text-center py-20 relative overflow-hidden">
<div class="absolute inset-0 bg-gradient-to-b from-transparent to-black opacity-50"></div>
<div class="container mx-auto px-4 relative z-10">
<h1 class="orbitron text-5xl md:text-7xl font-black mb-4 glow-text" style="color: var(--accent);" data-aos="fade-down">
BEAT<span style="color: var(--primary);">BOT</span>
</h1>
<p class="text-xl md:text-2xl mb-8 text-gray-300" data-aos="fade-up" data-aos-delay="200">
Generate the ultimate beat to celebrate <span class="font-bold text-indigo-300">GPT-5</span>
</p>
<div class="flex justify-center gap-4" data-aos="zoom-in" data-aos-delay="400">
<button id="play-btn" class="px-8 py-3 bg-indigo-600 hover:bg-indigo-700 rounded-full font-semibold flex items-center gap-2 transition-all hover:scale-105">
<i data-feather="play"></i> Generate Beat
</button>
<button id="stop-btn" class="px-8 py-3 bg-gray-700 hover:bg-gray-600 rounded-full font-semibold flex items-center gap-2 transition-all">
<i data-feather="square"></i> Stop
</button>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 container mx-auto px-4 py-12">
<div class="max-w-4xl mx-auto">
<!-- Beat Controls -->
<div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl p-6 mb-12 neon-border" data-aos="fade-up">
<h2 class="orbitron text-2xl mb-6 text-center">Beat Matrix</h2>
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Tempo: <span id="tempo-value">120</span> BPM</label>
<input type="range" id="tempo" min="60" max="180" value="120" class="w-full h-2 bg-gray-600 rounded-lg appearance-none cursor-pointer">
</div>
<div class="beat-grid" id="beat-grid">
<!-- Beat pads will be generated by JS -->
</div>
<div class="mt-6 grid grid-cols-2 md:grid-cols-4 gap-4">
<button class="px-4 py-2 bg-purple-600 hover:bg-purple-700 rounded-lg transition-colors" onclick="changePattern('techno')">Techno</button>
<button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors" onclick="changePattern('hiphop')">Hip Hop</button>
<button class="px-4 py-2 bg-cyan-600 hover:bg-cyan-700 rounded-lg transition-colors" onclick="changePattern('dubstep')">Dubstep</button>
<button class="px-4 py-2 bg-pink-600 hover:bg-pink-700 rounded-lg transition-colors" onclick="changePattern('random')">Random</button>
</div>
</div>
<!-- Visualizer -->
<div class="visualizer" id="visualizer" data-aos="fade-up" data-aos-delay="200">
<!-- Visualizer bars will be generated by JS -->
</div>
<!-- GPT-5 Celebration Message -->
<div class="text-center mt-16" data-aos="fade-up" data-aos-delay="400">
<h2 class="orbitron text-3xl mb-4 glow-text" style="color: var(--secondary);">Celebrating GPT-5!</h2>
<p class="text-lg text-gray-300 max-w-2xl mx-auto">
The future of AI is here! This beat celebrates the incredible advancements and possibilities
that GPT-5 brings to the world. Let the rhythm of innovation move you!
</p>
</div>
</div>
</main>
<!-- Footer -->
<footer class="py-8 text-center text-gray-400">
<p>Made with <i data-feather="heart" class="inline w-4 h-4 text-red-500"></i> for the AI community</p>
</footer>
<script>
// Initialize libraries
AOS.init({
duration: 800,
once: true
});
feather.replace();
// Audio context and synth setup
let audioContext;
let isPlaying = false;
let currentStep = 0;
let interval;
const synth = new Tone.PolySynth(Tone.Synth).toDestination();
const reverb = new Tone.Reverb(2).toDestination();
synth.connect(reverb);
// Beat patterns
const patterns = {
techno: [1,0,1,0,1,0,1,0, 0,1,0,1,0,1,0,1, 1,0,1,0,1,0,1,0, 0,1,0,1,0,1,0,1],
hiphop: [1,0,0,0,1,0,0,1, 0,0,1,0,0,0,1,0, 1,0,0,0,1,0,0,1, 0,0,1,0,0,1,0,0],
dubstep: [1,0,0,0,0,0,0,0, 0,0,1,1,0,0,0,0, 1,0,0,0,0,0,0,0, 0,0,1,1,1,0,0,1],
random: Array(32).fill(0).map(() => Math.random() > 0.7 ? 1 : 0)
};
let currentPattern = patterns.techno;
// Initialize beat grid
function initBeatGrid() {
const grid = document.getElementById('beat-grid');
grid.innerHTML = '';
for (let i = 0; i < 32; i++) {
const pad = document.createElement('div');
pad.className = 'beat-pad';
pad.dataset.index = i;
pad.addEventListener('click', () => toggleBeat(i));
grid.appendChild(pad);
}
updateGrid();
}
function toggleBeat(index) {
currentPattern[index] = currentPattern[index] ? 0 : 1;
updateGrid();
}
function updateGrid() {
const pads = document.querySelectorAll('.beat-pad');
pads.forEach((pad, i) => {
pad.classList.toggle('active', currentPattern[i] === 1);
pad.classList.toggle('playing', isPlaying && i === currentStep);
});
}
function changePattern(type) {
currentPattern = [...patterns[type]];
updateGrid();
}
// Visualizer setup
function initVisualizer() {
const visualizer = document.getElementById('visualizer');
visualizer.innerHTML = '';
for (let i = 0; i < 32; i++) {
const bar = document.createElement('div');
bar.className = 'viz-bar';
bar.style.left = `${i * (100 / 32)}%`;
bar.style.height = '0%';
visualizer.appendChild(bar);
}
}
function updateVisualizer() {
const bars = document.querySelectorAll('.viz-bar');
bars.forEach((bar, i) => {
const height = Math.random() * 80 + 20;
bar.style.height = `${height}%`;
bar.style.background = i === currentStep % 32 ? 'var(--accent)' : 'var(--primary)';
});
}
// Play/stop functions
document.getElementById('play-btn').addEventListener('click', () => {
if (!audioContext) {
audioContext = new AudioContext();
Tone.start();
}
if (isPlaying) {
stopBeat();
} else {
playBeat();
}
});
document.getElementById('stop-btn').addEventListener('click', stopBeat);
function playBeat() {
isPlaying = true;
document.getElementById('play-btn').innerHTML = '<i data-feather="pause"></i> Pause';
feather.replace();
const tempo = parseInt(document.getElementById('tempo').value);
const stepDuration = 60 / tempo / 2;
let step = 0;
currentStep = 0;
function playStep() {
if (currentPattern[step]) {
const note = ['C3', 'E3', 'G3', 'B3'][step % 4];
synth.triggerAttackRelease(note, '8n');
}
currentStep = step;
updateGrid();
updateVisualizer();
step = (step + 1) % 32;
}
// Initial play
playStep();
// Set interval for subsequent steps
interval = setInterval(playStep, stepDuration * 1000);
}
function stopBeat() {
isPlaying = false;
clearInterval(interval);
document.getElementById('play-btn').innerHTML = '<i data-feather="play"></i> Generate Beat';
feather.replace();
currentStep = -1;
updateGrid();
// Reset visualizer
const bars = document.querySelectorAll('.viz-bar');
bars.forEach(bar => bar.style.height = '0%');
}
// Tempo control
document.getElementById('tempo').addEventListener('input', (e) => {
document.getElementById('tempo-value').textContent = e.target.value;
if (isPlaying) {
stopBeat();
playBeat();
}
});
// Initialize
initBeatGrid();
initVisualizer();
</script>
</body>
</html>
|