/** * Rongini Premium Animation System (JavaScript) */ document.addEventListener('DOMContentLoaded', () => { // 1. Scroll Reveal (IntersectionObserver) const revealElements = document.querySelectorAll('.scroll-reveal'); if (revealElements.length > 0) { const revealOptions = { threshold: 0.1, // Trigger when 10% visible rootMargin: "0px 0px -50px 0px" // Trigger slightly before it hits the bottom }; const revealObserver = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('is-visible'); // Unobserve after revealing to prevent repeating animation observer.unobserve(entry.target); } }); }, revealOptions); revealElements.forEach(el => { revealObserver.observe(el); }); } // 2. Global Setup setupWishlistMicroInteractions(); }); /** * Toast Notification System * Replaces native alert() with a premium floating toast. * * @param {string} message - The message to display * @param {string} type - 'success', 'error', or 'info' */ window.showToast = function(message, type = 'success') { let container = document.getElementById('toast-container'); if (!container) { container = document.createElement('div'); container.id = 'toast-container'; document.body.appendChild(container); } const toast = document.createElement('div'); toast.className = `toast toast-${type}`; let icon = 'fa-info-circle'; if (type === 'success') icon = 'fa-check-circle'; if (type === 'error') icon = 'fa-exclamation-circle'; toast.innerHTML = ` ${message}`; container.appendChild(toast); // Trigger reflow for transition void toast.offsetWidth; toast.classList.add('toast-show'); // Remove after 3 seconds setTimeout(() => { toast.classList.remove('toast-show'); toast.classList.add('toast-hide'); // Wait for CSS transition to finish before removing from DOM setTimeout(() => { if(toast.parentNode) { toast.parentNode.removeChild(toast); } }, 300); // matches --motion-normal }, 3000); }; /** * Wishlist Heart Micro-Interaction * Attaches pulse animation to all wishlist buttons */ function setupWishlistMicroInteractions() { const wishlistBtns = document.querySelectorAll('.wishlist-btn'); wishlistBtns.forEach(btn => { btn.addEventListener('click', function(e) { e.preventDefault(); // Toggle state const isCurrentlyActive = this.classList.contains('active'); if (isCurrentlyActive) { this.classList.remove('active'); this.innerHTML = ''; showToast('Removed from wishlist', 'info'); } else { // Add active class (triggers CSS pop animation) this.classList.add('active'); this.innerHTML = ''; showToast('Added to wishlist', 'success'); } // Note: In a real implementation, you would also make an AJAX call here // to update the backend database. }); }); }
Discover the latest additions to Rongini
Loved by our customers
Curated matching sets for your special occasions
Your signature look, now more special. Enjoy exclusive discounts on our premium range.
SHOP THE OFFER →Carefully selected pieces.
Available everywhere.
Your data is protected.
Nationwide reliable shipping.
Rongini brings you a signature collection of elegant sarees and exquisite jewelry, curated for women who desire sophisticated style and impeccable quality. With a focus on fine craftsmanship and timeless designs, our pieces are made to celebrate you.
LEARN MORE