{"version":3,"file":"buttons.js","mappings":"CACC,WA0CG,IAzCA,IAAIA,EAAQC,EAAiBC,EAGvBC,EAAW,SAAUC,EAAMC,GAC7B,IAAIC,EAEJ,OADAA,OAAaC,EACN,WACH,IAAIC,EAAMC,EAIV,OAHAA,EAAUC,KACVF,EAAOG,UACPC,aAAaN,GACNA,EAAaO,YAAW,WAC3B,OAAOT,EAAKU,MAAML,EAASD,EAC/B,GAAGH,EACP,CACJ,EAGMU,EAAY,SAAUC,GACxB,IAAIhB,EAAQiB,EAAKC,EAASC,EAAMC,EAAOC,EASvC,OAPAF,GADAnB,EAASU,MACKY,YACdL,EAAMjB,EAAOuB,wBACbL,EAAUM,SAASC,cAAc,QACjCJ,EAAIL,EAAEU,QAAUT,EAAIU,KAAQR,EAAO,EAEnCC,EAAQ,QADJJ,EAAEY,QAAUX,EAAIY,IAAOV,EAAO,GACb,YAAcE,EAAI,eAAiBF,EAAO,cAAgBA,EAAO,MACtFnB,EAAOC,gBAAgB6B,YAAYZ,GAC5BA,EAAQa,aAAa,QAASX,EACzC,EAGMY,EAAU,WAEZ,IADA,IAAIC,EAAYvB,KAAKT,gBACdgC,EAAUC,YACbD,EAAUE,YAAYF,EAAUC,WAExC,EAISE,EAAI,EAAGC,GADhBnC,EAAUsB,SAASc,iBAAiB,YACNC,OAAQH,EAAIC,EAAKD,IAC3CpC,EAASE,EAAQkC,IACjBnC,EAAkBuB,SAASC,cAAc,QACzBe,UAAY,oBAC5BxC,EAAOyC,iBAAiB,YAAa1B,GACrCf,EAAOyC,iBAAiB,UAAWtC,EAAS6B,EAAS,MACrDhC,EAAOC,gBAAkBA,EACzBD,EAAO8B,YAAY7B,EAE1B,CAnDA","sources":["webpack://certification/./src/buttons.js"],"sourcesContent":["// Auto run function for Button effects\r\n(function () {\r\n let ripple, rippleContainer, buttons;\r\n\r\n // Allows for a delay on a function so it can completely run\r\n const debounce = function (func, delay) {\r\n let inDebounce;\r\n inDebounce = undefined;\r\n return function () {\r\n let args, context;\r\n context = this;\r\n args = arguments;\r\n clearTimeout(inDebounce);\r\n return inDebounce = setTimeout(function () {\r\n return func.apply(context, args);\r\n }, delay);\r\n }\r\n }\r\n\r\n // Adds the ripple span to the ripple--container with associated styles for the position of the click\r\n const addRipple = function (e) {\r\n let ripple, pos, rippler, size, style, x, y;\r\n ripple = this;\r\n size = ripple.offsetWidth;\r\n pos = ripple.getBoundingClientRect();\r\n rippler = document.createElement('span');\r\n x = e.clientX - pos.left - (size / 2);\r\n y = e.clientY - pos.top - (size / 2);\r\n style = 'top:' + y + 'px; left:' + x + 'px; height: ' + size + 'px; width: ' + size + 'px;';\r\n ripple.rippleContainer.appendChild(rippler);\r\n return rippler.setAttribute('style', style);\r\n }\r\n\r\n // Cleans up the ripple--container spans\r\n const cleanUp = function () {\r\n let container = this.rippleContainer;\r\n while (container.firstChild) {\r\n container.removeChild(container.firstChild);\r\n }\r\n }\r\n\r\n // Create the ripple--container for all buttons and add the click event handlers\r\n buttons = document.querySelectorAll('.button');\r\n for (let i = 0, len = buttons.length; i < len; i++) {\r\n ripple = buttons[i];\r\n rippleContainer = document.createElement('div');\r\n rippleContainer.className = 'ripple--container';\r\n ripple.addEventListener('mousedown', addRipple);\r\n ripple.addEventListener('mouseup', debounce(cleanUp, 2000));\r\n ripple.rippleContainer = rippleContainer;\r\n ripple.appendChild(rippleContainer);\r\n }\r\n}());\r\n"],"names":["ripple","rippleContainer","buttons","debounce","func","delay","inDebounce","undefined","args","context","this","arguments","clearTimeout","setTimeout","apply","addRipple","e","pos","rippler","size","style","x","offsetWidth","getBoundingClientRect","document","createElement","clientX","left","clientY","top","appendChild","setAttribute","cleanUp","container","firstChild","removeChild","i","len","querySelectorAll","length","className","addEventListener"],"sourceRoot":""}