Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Copy button functionality
+ const copyButtons = document.querySelectorAll('.copy-btn');
+
+ copyButtons.forEach(button => {
+ button.addEventListener('click', async () => {
+ const prefix = button.getAttribute('data-prefix');
+
+ try {
+ await navigator.clipboard.writeText(prefix);
+ const originalText = button.textContent;
+ button.textContent = 'Copied!';
+ button.style.backgroundColor = '#27ae60';
+
+ setTimeout(() => {
+ button.textContent = originalText;
+ button.style.backgroundColor = '';
+ }, 2000);
+ } catch (err) {
+ console.error('Failed to copy text: ', err);
+ }
+ });
+ });
+
+ // Mobile menu toggle
+ const menuToggle = document.querySelector('.menu-toggle');
+
+ if (menuToggle) {
+ menuToggle.addEventListener('click', () => {
+ menuToggle.classList.toggle('active');
+ // Add mobile menu functionality here if needed
+ });
+ }
+
+ // Smooth scroll for anchor links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
+ behavior: 'smooth'
+ });
+ });
+ });
+
+ // Add animation on scroll
+ const cards = document.querySelectorAll('.card');
+
+ const observerOptions = {
+ threshold: 0.1,
+ rootMargin: '0px 0px -50px 0px'
+ };
+
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.style.opacity = '1';
+ entry.target.style.transform = 'translateY(0)';
+ }
+ });
+ }, observerOptions);
+
+ cards.forEach(card => {
+ card.style.opacity = '0';
+ card.style.transform = 'translateY(20px)';
+ card.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
+ observer.observe(card);
+ });
+ });