Spaces:
Running

streamflix / script.js
kevenb00s's picture
add video sessions like youtobe with videos ready to watch
5a76192 verified
Raw History Blame Contribute Delete
1.51 kB
// Initialize Feather Icons
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
});
// Video card hover effect enhancement
document.querySelectorAll('.video-card').forEach(card => {
card.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-5px)';
});
card.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0)';
});
});
// Search functionality
const searchInput = document.getElementById('search-input');
if (searchInput) {
searchInput.addEventListener('keyup', function(e) {
if (e.key === 'Enter') {
const query = this.value.trim();
if (query) {
alert(`Searching for: ${query}`);
// In a real app, this would redirect to search results page
}
}
});
}
// Theme toggle functionality
const themeToggle = document.getElementById('theme-toggle');
if (themeToggle) {
themeToggle.addEventListener('click', function() {
document.body.classList.toggle('dark-mode');
// Save preference to localStorage
const isDark = document.body.classList.contains('dark-mode');
localStorage.setItem('theme', isDark ? 'dark' : 'light');
});
}
// Load saved theme preference
document.addEventListener('DOMContentLoaded', function() {
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'dark') {
document.body.classList.add('dark-mode');
}
});