Skip to content
(function(){
const canvas = document.getElementById("nexadix-trail");
if(!canvas) return;
const ctx = canvas.getContext("2d");
let w,h;
function resize(){
w = canvas.width = window.innerWidth;
h = canvas.height = window.innerHeight;
}
resize();
window.addEventListener("resize",resize);
let trail = [];
window.addEventListener("mousemove",e=>{
trail.push({x:e.clientX,y:e.clientY,life:1});
if(trail.length>80) trail.shift(); // max trail length
});
function draw(){
ctx.clearRect(0,0,w,h);
if(trail.length>1){
ctx.beginPath();
ctx.moveTo(trail[0].x,trail[0].y);
for(let i=1;i{
trail.push({x:e.clientX,y:e.clientY,life:1});
if(trail.length>80) trail.shift(); // max trail length
});
function draw(){
ctx.clearRect(0,0,w,h);
if(trail.length>1){
ctx.beginPath();
ctx.moveTo(trail[0].x,trail[0].y);
for(let i=1;i
const lazyloadRunObserver = () => {
const lazyloadBackgrounds = document.querySelectorAll( `.e-con.e-parent:not(.e-lazyloaded)` );
const lazyloadBackgroundObserver = new IntersectionObserver( ( entries ) => {
entries.forEach( ( entry ) => {
if ( entry.isIntersecting ) {
let lazyloadBackground = entry.target;
if( lazyloadBackground ) {
lazyloadBackground.classList.add( 'e-lazyloaded' );
}
lazyloadBackgroundObserver.unobserve( entry.target );
}
});
}, { rootMargin: '200px 0px 200px 0px' } );
lazyloadBackgrounds.forEach( ( lazyloadBackground ) => {
lazyloadBackgroundObserver.observe( lazyloadBackground );
} );
};
const events = [
'DOMContentLoaded',
'elementor/lazyload/observe',
];
events.forEach( ( event ) => {
document.addEventListener( event, lazyloadRunObserver );
} );