// ============================================
// ri.js - Optimized (keeping GIFs as GIF)
// ============================================
(function() {
    'use strict';
    
    const ris = [
        "data/media/linux-tux.gif",      // Optimized GIF
        "data/media/Titebouille.gif",    // Optimized GIF
        "data/media/gurl1.gif",          // Optimized GIF
        "data/media/gurl2.gif",          // Optimized GIF
        "data/media/gurl3.gif",          // Optimized GIF
        "data/media/Dance1.gif",         // Optimized GIF
        "data/media/Duck2.webp",         // WebP (was PNG)
        "data/media/Honk.gif",           // Optimized GIF
        "data/media/petpet.gif",         // Optimized GIF
        "data/media/Ereaser.jpg",
    ];
    
    const riIndex = Math.floor(Date.now() / (1000 * 60 * 60 * 24)) % ris.length;
    
    document.addEventListener("DOMContentLoaded", () => {
        const riElement = document.getElementById("ris");
        if (riElement) {
            // Set loading attribute for better performance
            riElement.loading = "lazy";
            riElement.src = ris[riIndex];
        }
    });
})();
