UNPKG

firajs

Version:

A JavaScript library for animations using GSAP and ScrollTrigger

39 lines (33 loc) 1.2 kB
*{ margin: 0; padding: 0; box-sizing: border-box; } html,body{ width: 100%; height: 100%; } #main{ width: 100%; min-height: 100vh; /* background-color: black; */ } :root{ --mousefollowercolor: #fff; /* Define a CSS variable for the mouse follower color */ } body { background-color: #fff; /* Set the background color of the body */ } .mousefollower { pointer-events: none; /* Prevent the mouse follower from receiving pointer events */ transform: translate(-50%, -50%); /* Center the mouse follower */ position: fixed; /* Position the mouse follower relative to the viewport */ top: 50%; /* Initial position from the top */ left: 50%; /* Initial position from the left */ width: 15px; /* Width of the mouse follower */ height: 15px; /* Height of the mouse follower */ border-radius: 50%; /* Make the mouse follower circular */ z-index: 99999; /* Set a high z-index to ensure it appears above other elements */ mix-blend-mode: exclusion; /*Apply a blending mode to the mouse follower*/ background-color: var(--mousefollowercolor); /* Use the defined color variable for the background */ }