Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const bruhButton = document.querySelector('.bruh-button');
+ const bruhCount = document.querySelector('.bruh-count');
+ let count = 0;
+
+ // Create audio context and buffer on first click
+ let audioContext;
+ let audioBuffer;
+
+ async function initAudio() {
+ audioContext = new (window.AudioContext || window.webkitAudioContext)();
+ const oscillator = audioContext.createOscillator();
+ const gainNode = audioContext.createGain();
+
+ oscillator.connect(gainNode);
+ gainNode.connect(audioContext.destination);
+
+ oscillator.frequency.setValueAtTime(150, audioContext.currentTime);
+ gainNode.gain.setValueAtTime(1, audioContext.currentTime);
+ gainNode.gain.exponentialRampToValueAtTime(0.01, audioContext.currentTime + 0.5);
+
+ oscillator.start();
+ oscillator.stop(audioContext.currentTime + 0.5);
+ }
+
+ bruhButton.addEventListener('click', async () => {
+ if (!audioContext) {
+ await initAudio();
+ }
+
+ count++;
+ bruhCount.textContent = `Bruh Count: ${count}`;
+
+ // Visual feedback
+ bruhButton.style.transform = 'scale(0.95)';
+ setTimeout(() => {
+ bruhButton.style.transform = '';
+ }, 100);
+
+ // Create new audio instance
+ initAudio();
+
+ // Add floating "bruh" text
+ const bruh = document.createElement('div');
+ bruh.textContent = 'bruh';
+ bruh.style.cssText = `
+ position: fixed;
+ color: var(--accent);
+ font-size: ${Math.random() * 20 + 20}px;
+ left: ${Math.random() * window.innerWidth}px;
+ top: ${Math.random() * window.innerHeight}px;
+ pointer-events: none;
+ animation: float-away 2s forwards;
+ `;
+ document.body.appendChild(bruh);
+
+ setTimeout(() => {
+ document.body.removeChild(bruh);
+ }, 2000);
+ });
+ });
+
+ // Add floating animation
+ const style = document.createElement('style');
+ style.textContent = `
+ @keyframes float-away {
+ 0% {
+ opacity: 1;
+ transform: translateY(0) rotate(0deg);
+ }
+ 100% {
+ opacity: 0;
+ transform: translateY(-100px) rotate(${Math.random() * 360}deg);
+ }
+ }
+ `;
+ document.head.appendChild(style);