ideya-kanala-veselye-druzya/script.js

38 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function notify() {
const btn = event.target;
btn.textContent = '✅ Спасибо! Мы сообщим о выходе';
btn.style.background = 'linear-gradient(135deg, #98FB98 0%, #87CEEB 100%)';
btn.disabled = true;
}
function subscribe(event) {
event.preventDefault();
const form = event.target;
const message = document.getElementById('subscribe-message');
const email = form.querySelector('input').value;
form.style.display = 'none';
message.textContent = '🎉 Спасибо за подписку! Письмо с подтверждением отправлено на ' + email;
message.style.color = 'white';
}
document.addEventListener('DOMContentLoaded', function() {
const cards = document.querySelectorAll('.character-card, .episode-card');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, { threshold: 0.1 });
cards.forEach(card => {
card.style.opacity = '0';
card.style.transform = 'translateY(30px)';
card.style.transition = 'all 0.6s ease';
observer.observe(card);
});
});