User:TheMcr/common.js: Difference between revisions

Boobpedia - Encyclopedia of big boobs
Jump to navigationJump to search
No edit summary
No edit summary
Line 8: Line 8:
         image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';  // Smooth transition for scaling and shadow
         image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';  // Smooth transition for scaling and shadow
         image.style.transform = 'scale(1.1) translateY(-10px)'; // Grow and move up by 10px
         image.style.transform = 'scale(1.1) translateY(-10px)'; // Grow and move up by 10px
         image.style.boxShadow = '0px 10px 20px rgba(0, 0, 0, 0.3)'; // Add a subtle shadow
         image.style.boxShadow = '0px 10px 20px rgba(0, 0, 0, 0.3)';
  image.style.position = 'relative'; // Ensure z-index works
        image.style.zIndex = '10'; / Add a subtle shadow
     });
     });


Line 16: Line 18:
         image.style.transform = 'scale(1) translateY(0)'; // Reset size and position
         image.style.transform = 'scale(1) translateY(0)'; // Reset size and position
         image.style.boxShadow = 'none'; // Remove the shadow
         image.style.boxShadow = 'none'; // Remove the shadow
  image.style.position = 'relative'; // Ensure z-index works
        image.style.zIndex = '0';
     });
     });
});
});
Line 21: Line 25:




     var links = document.querySelectorAll('p'); // Select all spans inside links
     var links = document.querySelectorAll('a'); // Select all spans inside links


     links.forEach(function (link) {
     links.forEach(function (link) {
Line 27: Line 31:
         link.addEventListener('mouseenter', function () {
         link.addEventListener('mouseenter', function () {
             link.style.transition = 'transform 0.3s ease';  // Smooth transition for scaling
             link.style.transition = 'transform 0.3s ease';  // Smooth transition for scaling
             link.style.transform = 'scale(1.2)'; // Increase link size by 20%
             link.style.transform = 'scale(1.1)'; // Increase link size by 20%
         });
         });


Line 33: Line 37:
         link.addEventListener('mouseleave', function () {
         link.addEventListener('mouseleave', function () {
             link.style.transform = 'scale(1)'; // Reset to original size
             link.style.transform = 'scale(1)'; // Reset to original size
link.style.transition = 'transform 0.3s ease';
         });
         });
     });
     });
});
});

Revision as of 23:19, 1 April 2025

document.addEventListener('DOMContentLoaded', function () {
    // Handle images
    var images = document.querySelectorAll('img'); // Select all images on the page

   images.forEach(function (image) {
    // On mouse enter (hover)
    image.addEventListener('mouseenter', function () {
        image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';  // Smooth transition for scaling and shadow
        image.style.transform = 'scale(1.1) translateY(-10px)'; // Grow and move up by 10px
        image.style.boxShadow = '0px 10px 20px rgba(0, 0, 0, 0.3)';
  image.style.position = 'relative'; // Ensure z-index works
        image.style.zIndex = '10'; / Add a subtle shadow
    });

    // On mouse leave (hover out)
    image.addEventListener('mouseleave', function () {
        image.style.transition = 'transform 0.3s ease, box-shadow 0.3s ease';
        image.style.transform = 'scale(1) translateY(0)'; // Reset size and position
        image.style.boxShadow = 'none'; // Remove the shadow
  image.style.position = 'relative'; // Ensure z-index works
        image.style.zIndex = '0'; 
    });
});



    var links = document.querySelectorAll('a'); // Select all spans inside links

    links.forEach(function (link) {
        // On mouse enter (hover)
        link.addEventListener('mouseenter', function () {
            link.style.transition = 'transform 0.3s ease';  // Smooth transition for scaling
            link.style.transform = 'scale(1.1)'; // Increase link size by 20%
        });

        // On mouse leave (hover out)
        link.addEventListener('mouseleave', function () {
            link.style.transform = 'scale(1)'; // Reset to original size
 link.style.transition = 'transform 0.3s ease'; 
        });
    });
});