| |
|
| | |
| | function animateOnScroll() { |
| | const elements = document.querySelectorAll('.fade-in, .slide-in'); |
| | elements.forEach(el => { |
| | const rect = el.getBoundingClientRect(); |
| | if (rect.top < window.innerHeight - 100) { |
| | el.style.opacity = '1'; |
| | el.style.transform = 'translateY(0)'; |
| | } |
| | }); |
| | } |
| |
|
| | |
| | document.addEventListener('DOMContentLoaded', () => { |
| | window.addEventListener('scroll', animateOnScroll); |
| | animateOnScroll(); |
| | }); |
| |
|
| | |
| | function formatDate(dateString) { |
| | const options = { year: 'numeric', month: 'short', day: 'numeric' }; |
| | return new Date(dateString).toLocaleDateString('ar-EG', options); |
| | } |
| | function copyToClipboard(text) { |
| | navigator.clipboard.writeText(text).then(() => { |
| | const toast = document.querySelector('toast-notification'); |
| | toast.show(`تم نسخ: ${text}`, 'success'); |
| | }).catch(err => { |
| | const toast = document.querySelector('toast-notification'); |
| | toast.show('فشل النسخ!', 'error'); |
| | }); |
| | } |
| | |
| | document.addEventListener('DOMContentLoaded', () => { |
| | const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); |
| | tooltipTriggerList.map(function (tooltipTriggerEl) { |
| | return new bootstrap.Tooltip(tooltipTriggerEl); |
| | }); |
| | }); |