Download script.js from Morioun/brainybytes-ai-memory-mastery: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/spaces/Morioun/brainybytes-ai-memory-mastery/resolve/main/script.js
- Command line
-
hf download hf://spaces/Morioun/brainybytes-ai-memory-mastery/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Morioun/brainybytes-ai-memory-mastery/resolve/main/script.js
1.88 kB
| // Duolingo-style animations | |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| const target = document.querySelector(this.getAttribute('href')); | |
| target.style.transform = 'translateY(-5px)'; | |
| setTimeout(() => { | |
| target.style.transform = 'translateY(0)'; | |
| }, 300); | |
| target.scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Duolingo-style scroll animations | |
| const animateOnScroll = () => { | |
| const elements = document.querySelectorAll('.feature-card, .step, .hero-content'); | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.style.animation = 'duoSlideUp 0.6s ease forwards'; | |
| observer.unobserve(entry.target); | |
| } | |
| }); | |
| }, { threshold: 0.1 }); | |
| elements.forEach(element => { | |
| element.style.opacity = '0'; | |
| element.style.transform = 'translateY(20px)'; | |
| observer.observe(element); | |
| }); | |
| }; | |
| // Add Duolingo-style animation | |
| const style = document.createElement('style'); | |
| style.textContent = ` | |
| @keyframes duoSlideUp { | |
| from { | |
| opacity: 0; | |
| transform: translateY(20px); | |
| } | |
| to { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| } | |
| `; | |
| document.head.appendChild(style); | |
| // Initialize when DOM is loaded | |
| document.addEventListener('DOMContentLoaded', () => { | |
| animateOnScroll(); | |
| // Mobile menu toggle | |
| const mobileMenuBtn = document.querySelector('.mobile-menu-btn'); | |
| if (mobileMenuBtn) { | |
| mobileMenuBtn.addEventListener('click', () => { | |
| const navLinks = document.querySelector('.nav-links'); | |
| navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex'; | |
| }); | |
| } | |
| }); |