Sha256: c878a4e7d8bd06e6ddefa6022e17230ed6a15ac827854c5a2af0188e730116fc
Contents?: true
Size: 1.83 KB
Versions: 19
Compression:
Stored size: 1.83 KB
Contents
Roller.morph.over = (tl, input, value, output, index, data, live) => { tl.pause(); input.map((index,value)=>{ if ($(value).hasClass("active")) { Save.input = value; Save.index = index; HandleClass(value,'remove'); } }); HandleClass(output,'clear'); $(value.classList).map((index,value) => { if (value.startsWith("title-")) { live = value.slice(6); } }); data = `path#${live}`; gsap.to(output,{ morphSVG : data, duration : 0.3 }); HandleClass(value,'add'); HandleClass(output,'add',live); } Roller.morph.out = (tl, input, output, live, data) => { input.map((index,value) => { if ($(value).hasClass("active")) { HandleClass(value,'remove'); } }); HandleClass(output,'clear'); $(Save.input.classList).map((index,value) => { if (value.startsWith("title-")) { live = value.slice(6); } }); data = `path#${live}`; gsap.to(output,{ morphSVG : data, duration : 0.3 }); HandleClass(Save.input,'add'); HandleClass(output,'add',live); tl.play(); } Roller.morph.tl = (input, output) => { let tl = gsap.timeline({ repeat : -1 }), live = "", data = ""; input.map((index,value) => { $(value.classList).map((index,value) => { if (value.startsWith("title-")) { live = value.slice(6); } }); data = `path#${live}`; tl .call(HandleClass,[value,'add']) .call(HandleClass,[output,'add',live]) .to(output,{ morphSVG : data, duration : 0.3 }) .call(HandleClass,[value,'remove'],"+=1") .call(HandleClass,[output,'remove',live]) ; $(value).hover(function(){ Roller.morph.over(tl, input, value, output, index, data, live); }, function() { Roller.morph.out(tl, input, output); }); }); }
Version data entries
19 entries across 19 versions & 1 rubygems