User:TheMcr/common.js: Difference between revisions

Boobpedia - Encyclopedia of big boobs
Jump to navigationJump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener("DOMContentLoaded", function () {
     // Handle images
     const table = document.querySelector('.wikitable');
    var images = document.querySelectorAll('img'); // Select all images on the page


  images.forEach(function (image) {
    // Apply fade-in effect
     // On mouse enter (hover)
    table.style.opacity = 0;
     image.addEventListener('mouseenter', function () {
    table.style.transition = "opacity 2s";
        image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease'; // Smooth transition for scaling and shadow
    setTimeout(function() {
        image.style.transform = 'scale(1.1) translateY(-10px)'; // Grow and move up by 10px
        table.style.opacity = 1;
         image.style.boxShadow = '0px 10px 20px rgba(0, 0, 0, 0.3)';
    }, 10);
 
 
    });
     // Hover effect for each row
    const rows = table.querySelectorAll('tr');
     rows.forEach(row => {
        row.addEventListener('mouseenter', function() {
            row.style.transform = "scale(1.05)";
            row.style.transition = "transform 0.3s ease, background-color 0.3s ease";
            row.style.backgroundColor = "#f0f0f0";
         });


    // On mouse leave (hover out)
        row.addEventListener('mouseleave', function() {
    image.addEventListener('mouseleave', function () {
            row.style.transform = "scale(1)";
        image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';
            row.style.backgroundColor = ""; // reset background color
        image.style.transform = 'scale(1) translateY(0)'; // Reset size and position
        });
        image.style.boxShadow = 'none'; // Remove the shadow
     });
     });
});
console.log("donne");
});
});

Latest revision as of 15:59, 5 April 2025

document.addEventListener("DOMContentLoaded", function () {
    const table = document.querySelector('.wikitable');

    // Apply fade-in effect
    table.style.opacity = 0;
    table.style.transition = "opacity 2s";
    setTimeout(function() {
        table.style.opacity = 1;
    }, 10);

    // Hover effect for each row
    const rows = table.querySelectorAll('tr');
    rows.forEach(row => {
        row.addEventListener('mouseenter', function() {
            row.style.transform = "scale(1.05)";
            row.style.transition = "transform 0.3s ease, background-color 0.3s ease";
            row.style.backgroundColor = "#f0f0f0";
        });

        row.addEventListener('mouseleave', function() {
            row.style.transform = "scale(1)";
            row.style.backgroundColor = ""; // reset background color
        });
    });
});