From bc9cdd54c0a268b5439e4e2a7efa9f3c2c33fcc5 Mon Sep 17 00:00:00 2001 From: thatkookooguy Date: Wed, 15 Nov 2023 21:38:29 +0200 Subject: [PATCH] new build --- lib/index.js | 69 +++++++++++++++++++++++++++++++++++++----------- lib/index.js.map | 2 +- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index 96fb7f6..c1f6411 100644 --- a/lib/index.js +++ b/lib/index.js @@ -505,7 +505,7 @@ function start() { quotes.push({ quote: "Warning: Dates in Calendar are closer than they appear.", }); - quotes.push({ quote: "Give me ambiguity or give me something else." }); + // quotes.push({ quote: "Give me ambiguity or give me something else." }); quotes.push({ quote: "Make it idiot proof and someone will make a better idiot.", }); @@ -514,13 +514,13 @@ function start() { quotes.push({ quote: "Always remember you're unique, just like everyone else.", }); - quotes.push({ quote: "Save the whales, collect the whole set" }); + // quotes.push({ quote: "Save the whales, collect the whole set" }); // quotes.push("A flashlight is a case for holding dead batteries."); quotes.push({ quote: "Lottery: A tax on people who are bad at math." }); quotes.push({ quote: "There's too much blood in my caffeine system." }); - quotes.push({ - quote: "Artificial Intelligence usually beats real stupidity.", - }); + // quotes.push({ + // quote: "Artificial Intelligence usually beats real stupidity.", + // }); quotes.push({ quote: "Hard work has a future payoff. Laziness pays off now.", }); @@ -531,7 +531,7 @@ function start() { quote: "I wont rise to the occasion, but I'll slide over to it.", }); quotes.push({ quote: "What is a free gift ? Aren't all gifts free?" }); - quotes.push({ quote: "Very funny, Scotty. Now beam down my clothes." }); + // quotes.push({ quote: "Very funny, Scotty. Now beam down my clothes." }); quotes.push({ quote: "Consciousness: that annoying time between naps." }); quotes.push({ quote: "Oops. My brain just hit a bad sector." }); // quotes.push("I used to have a handle on life, then it broke."); @@ -545,21 +545,21 @@ function start() { quote: "Better to understand a little than to misunderstand a lot.", }); quotes.push({ quote: "The gene pool could use a little chlorine." }); - quotes.push({ quote: "When there's a will, I want to be in it." }); - quotes.push({ - quote: "All generalizations are false, including this one.", - }); + // quotes.push({ quote: "When there's a will, I want to be in it." }); + // quotes.push({ + // quote: "All generalizations are false, including this one.", + // }); quotes.push({ quote: "Change is inevitable, except from a vending machine.", }); - quotes.push({ - quote: "C program run. C program crash. C programmer quit.", - }); - quotes.push({ quote: "Criminal Lawyer is a redundancy." }); + // quotes.push({ + // quote: "C program run. C program crash. C programmer quit.", + // }); + // quotes.push({ quote: "Criminal Lawyer is a redundancy." }); quotes.push({ quote: "90% of all statistics are made up" }); // quotes.push("A man needs a good memory after he has lied."); quotes.push({ quote: "Beam me up, Scotty!" }); - quotes.push({ quote: "Oh Beulah, peel me a grape." }); + // quotes.push({ quote: "Oh Beulah, peel me a grape." }); quotes.push({ quote: "C++ should have been called B" }); quotes.push({ quote: "Energizer Bunny Arrested! Charged with battery." }); quotes.push({ @@ -601,6 +601,45 @@ function start() { quote: "TypeScript is easy! You just do exactly the opposite of what you did in java", }); + quotes.push({ + quote: + `Why did the JavaScript developer go broke?\n...\n...\nBecause he used typeof on a penny and got a "string" instead of a "number."`, + }); + + quotes.push({ + quote: + `Why did the JavaScript array go out of bounds?\n...\n...\nBecause it didn't know its own length.`, + }); + + quotes.push({ + quote: + `Why was the JavaScript developer sad?\n...\n...\nBecause they didn't Node how to Express himself.`, + }); + + quotes.push({ + quote: + `Why did the child component have such great self-esteem?\n...\n...\nBecause its parent kept giving it props!`, + }); + + quotes.push({ + quote: + `Don't trust JavaScript programmers. All they do is promises but they never callback.`, + }); + + quotes.push({ + quote: + `Why did the functional component feel lost?\n...\n...\nBecause it didn't know what state it was in!`, + }); + + quotes.push({ + quote: + `JavaScript is a lot like English; No one knows how to use semicolons properly.`, + }); + + quotes.push({ + quote: + `You want to hear a javascript joke?\n...\n...\nI'll callback later.`, + }); return quotes[Math.floor(Math.random() * quotes.length)]; } diff --git a/lib/index.js.map b/lib/index.js.map index 0daf32d..a55cd3a 100644 --- a/lib/index.js.map +++ b/lib/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,MAAM;AACnC;AACA;AACA;;;;;;UCnDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;ACNyD;;AAEzD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;;AAEhE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA,IAAI,wDAAS;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI,wDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,cAAc;AAC7C,gCAAgC,gCAAgC;AAChE,uCAAuC,YAAY;AACnD,mCAAmC,sBAAsB;AACzD;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,0CAA0C,SAAS,MAAM,SAAS;AAClE,uCAAuC,SAAS,MAAM,SAAS;AAC/D,sCAAsC,SAAS,MAAM,SAAS;AAC9D,gCAAgC,SAAS,MAAM,SAAS;AACxD,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA,cAAc,MAAM;AACpB;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,2DAAY;AAChB;AACA;;AAEA;AACA;AACA,qBAAqB,+CAA+C;AACpE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,uDAAuD;AACzE;AACA;AACA,KAAK;AACL,kBAAkB,4DAA4D;AAC9E,kBAAkB,6CAA6C;AAC/D;AACA;AACA,KAAK;AACL,kBAAkB,iDAAiD;AACnE;AACA,kBAAkB,wDAAwD;AAC1E,kBAAkB,wDAAwD;AAC1E;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,uDAAuD;AACzE,kBAAkB,wDAAwD;AAC1E,kBAAkB,0DAA0D;AAC5E,kBAAkB,gDAAgD;AAClE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,qDAAqD;AACvE,kBAAkB,mDAAmD;AACrE;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,2CAA2C;AAC7D,kBAAkB,4CAA4C;AAC9D;AACA,kBAAkB,8BAA8B;AAChD,kBAAkB,sCAAsC;AACxD,kBAAkB,wCAAwC;AAC1D,kBAAkB,0DAA0D;AAC5E;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,MAAM;AAC7C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qCAAqC,YAAY;AACjD;AACA,oBAAoB,SAAS;AAC7B;AACA,8BAA8B,qCAAqC;;AAEnE,mCAAmC,YAAY;AAC/C;AACA,oBAAoB,sCAAsC;AAC1D;AACA,kCAAkC,2CAA2C;AAC7E,kCAAkC,sCAAsC;;AAExE;AACA;AACA;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;AACA","sources":["webpack://@kibibit/kb-talking-avatars/./src/sound-engine.js","webpack://@kibibit/kb-talking-avatars/webpack/bootstrap","webpack://@kibibit/kb-talking-avatars/webpack/runtime/define property getters","webpack://@kibibit/kb-talking-avatars/webpack/runtime/hasOwnProperty shorthand","webpack://@kibibit/kb-talking-avatars/webpack/runtime/make namespace object","webpack://@kibibit/kb-talking-avatars/./src/index.js"],"sourcesContent":["// IMOPORTED!\nlet playSound = true;\nlet currentAudio = null;\nlet alreadyPlayed = false;\n\n\nconst synth = new Animalese('animalese/animalese.wav', function() {\n // document.getElementById('preview').disabled = false;\n // document.getElementById('download').disabled = false;\n});\n\ndocument.onfocus = function() {\n playSound = true;\n};\n\ndocument.onblur = function() {\n playSound = false;\n currentAudio.pause();\n currentAudio.currentTime = 0;\n};\n\nfunction toggleAudio() {\n playSound = !playSound;\n\n if (!playSound) {\n currentAudio.pause();\n currentAudio.currentTime = 0;\n }\n}\n\nexport function playAudioWav(wavUrl) {\n if (!playSound) { return; }\n const audio = new Audio(wavUrl);\n audio.volume = 1;\n currentAudio = audio;\n audio.play();\n}\n\nexport function playAudio(text) {\n if (!playSound) { return; }\n var audio = new Audio();\n audio.src = generateWav(text);\n audio.volume = 0.3;\n currentAudio = audio;\n audio.play();\n}\n\nfunction generateWav(text) {\n return synth.Animalese(`${ text }`,\n false,\n 0.7).dataURI;\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { playAudio, playAudioWav } from \"./sound-engine\";\n\nconst startButton = document.querySelector(\"#start-btn\");\n\nstartButton.addEventListener(\"click\", () => {\n startButton.classList.add(\"hide\");\n start();\n});\n\ncreateClouds();\n\nfunction start() {\n // hide address bar on mobile\n window.scrollTo(0, 1);\n\n let alreadyPlayed = false;\n const revealData = document.querySelector(\"#Avataaar\").getBBox();\n const pageBg = getParameterByName(\"background\");\n\n let currentQuote = randomQuote();\n document.querySelector(\"#textbox\").innerText = currentQuote.quote;\n\n pageBg && (document.body.style = `--page-background: ${pageBg}`);\n\n const mouthTimeline = createMouthAnimation();\n // coverAnimation();\n coverAnimation(() => displayRandomText());\n const blinkTimeline = blnkAnimation();\n\n // function relifAnimation(onComplete) {\n // blinkTimeline.pause(0);\n // $(\"#Eyes\\\\/Closed-😌\").show();\n // $(\"#Eyes\\\\/Default-😀\").hide();\n // $(\"#Mouth\\\\/Disbelief\").show();\n // $(\"#Mouth-Smile\").hide();\n // $(\"#Mouth-Serious\").hide();\n // }\n\n function shockedAnimation(onComplete) {\n blinkTimeline.pause(0);\n $(\"#Eyes\\\\/Surprised-😳\").show();\n $(\"#Eyes\\\\/Default-😀\").hide();\n $(\"#Mouth\\\\/Scream-Open\").show();\n $(\"#Mouth-Smile\").hide();\n $(\"#Mouth-Serious\").hide();\n $(\"#Face,#Top\").addClass(\"shake\");\n const shockTl = new TimelineMax({\n // paused: true,\n // repeat: 3,\n\n onComplete: () => {\n setTimeout(() => {\n console.log(\"finished shock\");\n $(\"#Eyes\\\\/Surprised-😳\").hide();\n $(\"#Eyes\\\\/Default-😀\").show();\n $(\"#Mouth\\\\/Scream-Open\").hide();\n $(\"#Mouth-Smile\").show();\n $(\"#Face,#Top\").removeClass(\"shake\");\n blinkTimeline.play();\n onComplete && onComplete();\n }, 1000);\n },\n });\n\n shockTl.add(\"shock\").to(\n \"#Eyes\\\\/Surprised-😳\",\n {\n duration: 2,\n ease: SteppedEase.config(1),\n css: {\n display: \"initial\",\n },\n },\n \"shock\"\n );\n }\n\n function laughAnimation(onComplete) {\n playAudio(\"ha.ha.ha\");\n blinkTimeline.pause(0);\n $(\"#Eyes\\\\/Happy-😁\").show();\n $(\"#Eyes\\\\/Default-😀\").hide();\n const laughTl = new TimelineMax({\n // paused: true,\n repeat: 3,\n\n onComplete: () => {\n setTimeout(() => {\n console.log(\"finished laugh\");\n $(\"#Eyes\\\\/Happy-😁\").hide();\n $(\"#Eyes\\\\/Default-😀\").show();\n blinkTimeline.play();\n onComplete && onComplete();\n }, 1000);\n },\n });\n\n $(\"#Face\").css({\n transform: \"matrix(1, 0, 0, 1, 76, 80)\",\n });\n\n laughTl\n .add(\"up\")\n .to(\n \"#Top\",\n {\n duration: 0.1,\n y: -3,\n ease: Bounce.easeOut,\n },\n \"up\"\n )\n .to(\n \"#Face\",\n {\n duration: 0.1,\n css: {\n transform: \"matrix(1, 0, 0, 1, 76, 77)\",\n },\n // ease: Bounce.easeOut\n },\n \"up\"\n )\n .add(\"down\")\n .to(\n \"#Top\",\n {\n duration: 0.1,\n y: 0,\n ease: Bounce.easeOut,\n },\n \"down\"\n )\n .to(\n \"#Face\",\n {\n duration: 0.1,\n css: {\n transform: \"matrix(1, 0, 0, 1, 76, 80)\",\n },\n // ease: Bounce.easeOut\n },\n \"down\"\n );\n }\n\n function displayRandomText() {\n currentQuote = randomQuote();\n mouthTimeline.play();\n // uncomment to replace with 'u' sounds\n playAudio(currentQuote.quote /*currentQuote.quote.replace(/./g, 'u')*/);\n createTextAnimation(\"#textbox\", currentQuote.quote, () => {\n mouthTimeline.pause();\n setTimeout(\n () =>\n currentQuote.animation\n ? currentQuote.animation(() => setTimeout(displayRandomText, 6000))\n : laughAnimation(() => setTimeout(displayRandomText, 6000)),\n 500\n );\n }).play();\n }\n\n function stopEyesFollow() {\n $(\"body\").off(\"mousemove\");\n // $(\"body\").off(\"touchmove\");\n }\n\n function eyesFollowMouse() {\n $(\"body\").mousemove(_.throttle(moveEyesToDirection, 1000 / 60));\n\n // $(\"body\").on(\n // \"touchmove\",\n // _.throttle((e) => {\n // // stop touch event\n // e.stopPropagation();\n // e.preventDefault();\n // moveEyesToDirection(e);\n // }, 1000 / 60)\n // );\n\n function moveEyesToDirection(event) {\n var eye = $(\"#Eyes\\\\/Default-😀\");\n var eyesX = eye.offset().left + eye.width() / 2;\n var eyesY = eye.offset().top + eye.height() / 2;\n const maxMovement = 8;\n const distanceX = event.pageX - eyesX;\n const distanceY = event.pageY - eyesY;\n const maxY = $(window).height();\n const maxX = $(window).width();\n // console.log(\"eyes\", { eyesX, eyesY });\n // console.log(\"mouse\", { x: event.pageX, y: event.pageY });\n // console.log(\"screen size:\", { maxX, maxY });\n // console.log(\"distance\", { distanceX, distanceY });\n let eyesNewX = 0;\n let eyesNewY = 8;\n\n if (Math.abs(distanceX) > 100) {\n eyesNewX = distanceX > 0 ? 8 : -8;\n } else {\n eyesNewX = (distanceX / 100) * 8;\n }\n\n if (Math.abs(distanceY) > 100) {\n eyesNewY = distanceY > 0 ? 13 : 3;\n } else {\n eyesNewY = (distanceY / 100) * 5 + 8;\n }\n\n eye.css({\n \"-webkit-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n \"-moz-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n \"-ms-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n transform: `translate(${eyesNewX}px, ${eyesNewY}px)`,\n });\n }\n }\n\n function createTextAnimation(id, text, onComplete) {\n if (!id) {\n return;\n }\n\n document.querySelector(id).innerText = text;\n\n var mySplitText = new SplitText(id, {\n type: \"words,chars\",\n });\n var chars = mySplitText.chars;\n\n var tl = new TimelineMax({\n paused: true,\n onComplete: () => mouthTimeline.pause(0) && onComplete && onComplete(),\n });\n tl.call(\n function () {\n $(\"#textbox\").addClass(\"visible\");\n },\n null,\n null,\n 0\n ).staggerFrom(\n chars,\n 0.8,\n {\n opacity: 0,\n ease: SteppedEase.config(1),\n },\n 0.08,\n \"+=0\"\n );\n\n return tl;\n }\n\n function figureRadius(w, h) {\n return Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 2;\n }\n\n function createMouthAnimation() {\n const mouthTimeline = gsap.timeline({\n repeat: -1,\n onRepeat: () => (alreadyPlayed = true),\n });\n\n mouthTimeline.pause();\n\n mouthTimeline.to(\"#Mouth-Smile\", {\n duration: 0.5,\n ease: SteppedEase.config(1),\n css: {\n display: \"none\",\n },\n });\n\n return mouthTimeline;\n }\n\n function coverAnimation(onComplete) {\n const revealData = document.querySelector(\"#Avataaar\").getBBox();\n\n TweenMax.set(\"#cover\", {\n attr: {\n cx: revealData.x + revealData.width / 2,\n cy: revealData.y + revealData.height / 2,\n r: figureRadius(revealData.width, revealData.height),\n },\n });\n\n const revealTl = new TimelineMax({\n onComplete,\n });\n\n revealTl.delay(1).from(\"#cover\", 1, {\n attr: { r: 0 },\n ease: Power4.easeInOut,\n });\n }\n\n function blnkAnimation() {\n const tl = gsap.timeline({\n repeat: -1,\n onRepeat: () => {\n // console.log(\"blinking\");\n // tl.play(\"blink\");\n // !alreadyPlayed && mouthTimeline.play();\n eyesFollowMouse();\n // textAnimation.play();\n },\n });\n\n tl.add(\"blink\")\n .to(\n \"#Eyes\\\\/Happy-😁\",\n {\n duration: 0.2,\n ease: SteppedEase.config(1),\n css: {\n display: \"initial\",\n },\n },\n 2\n )\n .to(\n \"#Eyes\\\\/Default-😀\",\n {\n duration: 0.2,\n ease: SteppedEase.config(1),\n css: {\n display: \"none\",\n },\n },\n 2\n );\n\n return tl;\n }\n\n function getParameterByName(name, url) {\n if (!url) {\n url = window.location.href;\n }\n name = name.replace(/[[]]/g, \"\\\\$&\");\n const regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\");\n const results = regex.exec(url);\n if (!results) {\n return null;\n }\n if (!results[2]) {\n return \"\";\n }\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n }\n\n function wizardAnimation(onComplete) {\n playAudioWav(\"http://noproblo.dayjo.org/ZeldaSounds/LOZ/LOZ_Fanfare.wav\");\n onComplete && onComplete();\n }\n\n function randomQuote() {\n const quotes = [];\n // quotes.push({ quote: \"hello! welcome to my GitHub Profile!\" });\n quotes.push({\n quote: \"IT'S DANGROUS TO GO ALONE!\\nTAKE THIS.\",\n animation: wizardAnimation,\n });\n quotes.push({\n quote: \"I'm speaking a language called Animalese from Animal Crossing.\",\n animation: shockedAnimation,\n });\n quotes.push({\n quote: \"Warning: Dates in Calendar are closer than they appear.\",\n });\n quotes.push({ quote: \"Give me ambiguity or give me something else.\" });\n quotes.push({\n quote: \"Make it idiot proof and someone will make a better idiot.\",\n });\n quotes.push({ quote: \"I'm not a complete idiot, some parts are missing!\" });\n quotes.push({ quote: \"He who laughs last thinks slowest!\" });\n quotes.push({\n quote: \"Always remember you're unique, just like everyone else.\",\n });\n quotes.push({ quote: \"Save the whales, collect the whole set\" });\n // quotes.push(\"A flashlight is a case for holding dead batteries.\");\n quotes.push({ quote: \"Lottery: A tax on people who are bad at math.\" });\n quotes.push({ quote: \"There's too much blood in my caffeine system.\" });\n quotes.push({\n quote: \"Artificial Intelligence usually beats real stupidity.\",\n });\n quotes.push({\n quote: \"Hard work has a future payoff. Laziness pays off now.\",\n });\n quotes.push({\n quote: \"Friends help you move. Real friends help you move bodies.\",\n });\n quotes.push({\n quote: \"I wont rise to the occasion, but I'll slide over to it.\",\n });\n quotes.push({ quote: \"What is a free gift ? Aren't all gifts free?\" });\n quotes.push({ quote: \"Very funny, Scotty. Now beam down my clothes.\" });\n quotes.push({ quote: \"Consciousness: that annoying time between naps.\" });\n quotes.push({ quote: \"Oops. My brain just hit a bad sector.\" });\n // quotes.push(\"I used to have a handle on life, then it broke.\");\n quotes.push({\n quote: \"Don't take life too seriously, you won't get out alive.\",\n });\n quotes.push({\n quote: \"I don't suffer from insanity. I enjoy every minute of it.\",\n });\n quotes.push({\n quote: \"Better to understand a little than to misunderstand a lot.\",\n });\n quotes.push({ quote: \"The gene pool could use a little chlorine.\" });\n quotes.push({ quote: \"When there's a will, I want to be in it.\" });\n quotes.push({\n quote: \"All generalizations are false, including this one.\",\n });\n quotes.push({\n quote: \"Change is inevitable, except from a vending machine.\",\n });\n quotes.push({\n quote: \"C program run. C program crash. C programmer quit.\",\n });\n quotes.push({ quote: \"Criminal Lawyer is a redundancy.\" });\n quotes.push({ quote: \"90% of all statistics are made up\" });\n // quotes.push(\"A man needs a good memory after he has lied.\");\n quotes.push({ quote: \"Beam me up, Scotty!\" });\n quotes.push({ quote: \"Oh Beulah, peel me a grape.\" });\n quotes.push({ quote: \"C++ should have been called B\" });\n quotes.push({ quote: \"Energizer Bunny Arrested! Charged with battery.\" });\n quotes.push({\n quote:\n \"ERROR: Uncaught TypeError: Cannot read property 'length' of undefined..... Haha! Just kidding!\",\n });\n quotes.push({\n quote:\n \"I'm Starting to wonder if there are more client-side JavaScript frameworks than there are apps that use them...\",\n });\n quotes.push({\n quote:\n 'Drinking game for web developers:\\n(1) Think of a noun\\n(2) Google \".js\"\\n(3) If a library with that name exists - drink!',\n });\n quotes.push({\n quote:\n 'JavaScript makes me want to flip the table and say \"Fuck this shit\"...\\nbut I can never be sure what \"this\" refers to......',\n });\n quotes.push({\n quote: \"TypeScript.....?\\nThat's one hell of an autocompletion plugin!\",\n });\n\n quotes.push({\n quote: \"How do you comfort a JavaScript bug?\\n...\\n...\\nYou console it\",\n });\n quotes.push({\n quote:\n \"How did the JavaScript developer learn TypeScript so quickly?\\n...\\n...\\nBecause they coded ANYtime, ANYplace, and ANYwhere\",\n });\n quotes.push({\n quote:\n \"Why was the JavaScript developer sad?\\n...\\n...\\nBecause they didn't Node how to Express themselves\",\n });\n quotes.push({\n quote:\n \"What tool do you use to switch versions of node?\\n...\\n...\\noh... nvm, I figured it out.\",\n });\n quotes.push({\n quote:\n \"TypeScript is easy! You just do exactly the opposite of what you did in java\",\n });\n\n return quotes[Math.floor(Math.random() * quotes.length)];\n }\n}\n\nfunction createClouds() {\n var cloudbox = document.getElementById(\"cloudbox\");\n var cloudbox1 = document.getElementById(\"cloudbox2\");\n\n function createCloud(cloudbox, color) {\n const vw = Math.max(\n document.documentElement.clientWidth || 0,\n window.innerWidth || 0\n );\n const vh = Math.max(\n document.documentElement.clientHeight || 0,\n window.innerHeight || 0\n );\n color = color || \"white\";\n cloudbox.style = `--cloud-color: ${color}`;\n // CREATE THE CLOUD SPAN\n var cloud = document.createElement(\"span\");\n cloud.style.width = Math.abs(Math.random() * (180 - 60) + 60) + \"px\";\n\n // ANIMATION VARIABLES\n var cloudTime = Math.abs(Math.random() * (240 - 120) + 120);\n var cloudTop = Math.abs(Math.random() * vh);\n\n // GSAP TIMELINES\n var tlAcross = new TimelineMax({ repeat: -1 });\n tlAcross\n .set(cloud, { left: 0 })\n .seek(cloudTime * Math.random())\n .to(cloud, cloudTime, { left: \"100%\", ease: Power0.easeNone });\n\n var tlDown = new TimelineMax({ repeat: -1 });\n tlDown\n .set(cloud, { top: cloudTop, ease: Power0.easeNone })\n .seek(cloudTime * Math.random())\n .to(cloud, cloudTime / 2, { top: cloudTop + 40, ease: Power0.easeNone })\n .to(cloud, cloudTime / 2, { top: cloudTop, ease: Power0.easeNone });\n\n // ADD IT TO THE CLOUDBOX\n cloudbox.appendChild(cloud);\n }\n\n for (var i = 0; i < 25; i++) {\n createCloud(cloudbox, \"white\");\n }\n\n for (var i = 0; i < 25; i++) {\n createCloud(cloudbox1, \"lightgrey\");\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,MAAM;AACnC;AACA;AACA;;;;;;UCnDA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;ACNyD;;AAEzD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;;AAEhE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA,IAAI,wDAAS;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI,wDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,cAAc;AAC7C,gCAAgC,gCAAgC;AAChE,uCAAuC,YAAY;AACnD,mCAAmC,sBAAsB;AACzD;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA,0CAA0C,SAAS,MAAM,SAAS;AAClE,uCAAuC,SAAS,MAAM,SAAS;AAC/D,sCAAsC,SAAS,MAAM,SAAS;AAC9D,gCAAgC,SAAS,MAAM,SAAS;AACxD,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA,cAAc,MAAM;AACpB;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,2DAAY;AAChB;AACA;;AAEA;AACA;AACA,qBAAqB,+CAA+C;AACpE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,qBAAqB,uDAAuD;AAC5E;AACA;AACA,KAAK;AACL,kBAAkB,4DAA4D;AAC9E,kBAAkB,6CAA6C;AAC/D;AACA;AACA,KAAK;AACL,qBAAqB,iDAAiD;AACtE;AACA,kBAAkB,wDAAwD;AAC1E,kBAAkB,wDAAwD;AAC1E;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,uDAAuD;AACzE,qBAAqB,wDAAwD;AAC7E,kBAAkB,0DAA0D;AAC5E,kBAAkB,gDAAgD;AAClE;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,kBAAkB,qDAAqD;AACvE,qBAAqB,mDAAmD;AACxE;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;AACA;AACA,QAAQ;AACR,qBAAqB,2CAA2C;AAChE,kBAAkB,4CAA4C;AAC9D;AACA,kBAAkB,8BAA8B;AAChD,qBAAqB,sCAAsC;AAC3D,kBAAkB,wCAAwC;AAC1D,kBAAkB,0DAA0D;AAC5E;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,yCAAyC;AACzC,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,MAAM;AAC7C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qCAAqC,YAAY;AACjD;AACA,oBAAoB,SAAS;AAC7B;AACA,8BAA8B,qCAAqC;;AAEnE,mCAAmC,YAAY;AAC/C;AACA,oBAAoB,sCAAsC;AAC1D;AACA,kCAAkC,2CAA2C;AAC7E,kCAAkC,sCAAsC;;AAExE;AACA;AACA;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;;AAEA,kBAAkB,QAAQ;AAC1B;AACA;AACA","sources":["webpack://@kibibit/kb-talking-avatars/./src/sound-engine.js","webpack://@kibibit/kb-talking-avatars/webpack/bootstrap","webpack://@kibibit/kb-talking-avatars/webpack/runtime/define property getters","webpack://@kibibit/kb-talking-avatars/webpack/runtime/hasOwnProperty shorthand","webpack://@kibibit/kb-talking-avatars/webpack/runtime/make namespace object","webpack://@kibibit/kb-talking-avatars/./src/index.js"],"sourcesContent":["// IMOPORTED!\nlet playSound = true;\nlet currentAudio = null;\nlet alreadyPlayed = false;\n\n\nconst synth = new Animalese('animalese/animalese.wav', function() {\n // document.getElementById('preview').disabled = false;\n // document.getElementById('download').disabled = false;\n});\n\ndocument.onfocus = function() {\n playSound = true;\n};\n\ndocument.onblur = function() {\n playSound = false;\n currentAudio.pause();\n currentAudio.currentTime = 0;\n};\n\nfunction toggleAudio() {\n playSound = !playSound;\n\n if (!playSound) {\n currentAudio.pause();\n currentAudio.currentTime = 0;\n }\n}\n\nexport function playAudioWav(wavUrl) {\n if (!playSound) { return; }\n const audio = new Audio(wavUrl);\n audio.volume = 1;\n currentAudio = audio;\n audio.play();\n}\n\nexport function playAudio(text) {\n if (!playSound) { return; }\n var audio = new Audio();\n audio.src = generateWav(text);\n audio.volume = 0.3;\n currentAudio = audio;\n audio.play();\n}\n\nfunction generateWav(text) {\n return synth.Animalese(`${ text }`,\n false,\n 0.7).dataURI;\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { playAudio, playAudioWav } from \"./sound-engine\";\n\nconst startButton = document.querySelector(\"#start-btn\");\n\nstartButton.addEventListener(\"click\", () => {\n startButton.classList.add(\"hide\");\n start();\n});\n\ncreateClouds();\n\nfunction start() {\n // hide address bar on mobile\n window.scrollTo(0, 1);\n\n let alreadyPlayed = false;\n const revealData = document.querySelector(\"#Avataaar\").getBBox();\n const pageBg = getParameterByName(\"background\");\n\n let currentQuote = randomQuote();\n document.querySelector(\"#textbox\").innerText = currentQuote.quote;\n\n pageBg && (document.body.style = `--page-background: ${pageBg}`);\n\n const mouthTimeline = createMouthAnimation();\n // coverAnimation();\n coverAnimation(() => displayRandomText());\n const blinkTimeline = blnkAnimation();\n\n // function relifAnimation(onComplete) {\n // blinkTimeline.pause(0);\n // $(\"#Eyes\\\\/Closed-😌\").show();\n // $(\"#Eyes\\\\/Default-😀\").hide();\n // $(\"#Mouth\\\\/Disbelief\").show();\n // $(\"#Mouth-Smile\").hide();\n // $(\"#Mouth-Serious\").hide();\n // }\n\n function shockedAnimation(onComplete) {\n blinkTimeline.pause(0);\n $(\"#Eyes\\\\/Surprised-😳\").show();\n $(\"#Eyes\\\\/Default-😀\").hide();\n $(\"#Mouth\\\\/Scream-Open\").show();\n $(\"#Mouth-Smile\").hide();\n $(\"#Mouth-Serious\").hide();\n $(\"#Face,#Top\").addClass(\"shake\");\n const shockTl = new TimelineMax({\n // paused: true,\n // repeat: 3,\n\n onComplete: () => {\n setTimeout(() => {\n console.log(\"finished shock\");\n $(\"#Eyes\\\\/Surprised-😳\").hide();\n $(\"#Eyes\\\\/Default-😀\").show();\n $(\"#Mouth\\\\/Scream-Open\").hide();\n $(\"#Mouth-Smile\").show();\n $(\"#Face,#Top\").removeClass(\"shake\");\n blinkTimeline.play();\n onComplete && onComplete();\n }, 1000);\n },\n });\n\n shockTl.add(\"shock\").to(\n \"#Eyes\\\\/Surprised-😳\",\n {\n duration: 2,\n ease: SteppedEase.config(1),\n css: {\n display: \"initial\",\n },\n },\n \"shock\"\n );\n }\n\n function laughAnimation(onComplete) {\n playAudio(\"ha.ha.ha\");\n blinkTimeline.pause(0);\n $(\"#Eyes\\\\/Happy-😁\").show();\n $(\"#Eyes\\\\/Default-😀\").hide();\n const laughTl = new TimelineMax({\n // paused: true,\n repeat: 3,\n\n onComplete: () => {\n setTimeout(() => {\n console.log(\"finished laugh\");\n $(\"#Eyes\\\\/Happy-😁\").hide();\n $(\"#Eyes\\\\/Default-😀\").show();\n blinkTimeline.play();\n onComplete && onComplete();\n }, 1000);\n },\n });\n\n $(\"#Face\").css({\n transform: \"matrix(1, 0, 0, 1, 76, 80)\",\n });\n\n laughTl\n .add(\"up\")\n .to(\n \"#Top\",\n {\n duration: 0.1,\n y: -3,\n ease: Bounce.easeOut,\n },\n \"up\"\n )\n .to(\n \"#Face\",\n {\n duration: 0.1,\n css: {\n transform: \"matrix(1, 0, 0, 1, 76, 77)\",\n },\n // ease: Bounce.easeOut\n },\n \"up\"\n )\n .add(\"down\")\n .to(\n \"#Top\",\n {\n duration: 0.1,\n y: 0,\n ease: Bounce.easeOut,\n },\n \"down\"\n )\n .to(\n \"#Face\",\n {\n duration: 0.1,\n css: {\n transform: \"matrix(1, 0, 0, 1, 76, 80)\",\n },\n // ease: Bounce.easeOut\n },\n \"down\"\n );\n }\n\n function displayRandomText() {\n currentQuote = randomQuote();\n mouthTimeline.play();\n // uncomment to replace with 'u' sounds\n playAudio(currentQuote.quote /*currentQuote.quote.replace(/./g, 'u')*/);\n createTextAnimation(\"#textbox\", currentQuote.quote, () => {\n mouthTimeline.pause();\n setTimeout(\n () =>\n currentQuote.animation\n ? currentQuote.animation(() => setTimeout(displayRandomText, 6000))\n : laughAnimation(() => setTimeout(displayRandomText, 6000)),\n 500\n );\n }).play();\n }\n\n function stopEyesFollow() {\n $(\"body\").off(\"mousemove\");\n // $(\"body\").off(\"touchmove\");\n }\n\n function eyesFollowMouse() {\n $(\"body\").mousemove(_.throttle(moveEyesToDirection, 1000 / 60));\n\n // $(\"body\").on(\n // \"touchmove\",\n // _.throttle((e) => {\n // // stop touch event\n // e.stopPropagation();\n // e.preventDefault();\n // moveEyesToDirection(e);\n // }, 1000 / 60)\n // );\n\n function moveEyesToDirection(event) {\n var eye = $(\"#Eyes\\\\/Default-😀\");\n var eyesX = eye.offset().left + eye.width() / 2;\n var eyesY = eye.offset().top + eye.height() / 2;\n const maxMovement = 8;\n const distanceX = event.pageX - eyesX;\n const distanceY = event.pageY - eyesY;\n const maxY = $(window).height();\n const maxX = $(window).width();\n // console.log(\"eyes\", { eyesX, eyesY });\n // console.log(\"mouse\", { x: event.pageX, y: event.pageY });\n // console.log(\"screen size:\", { maxX, maxY });\n // console.log(\"distance\", { distanceX, distanceY });\n let eyesNewX = 0;\n let eyesNewY = 8;\n\n if (Math.abs(distanceX) > 100) {\n eyesNewX = distanceX > 0 ? 8 : -8;\n } else {\n eyesNewX = (distanceX / 100) * 8;\n }\n\n if (Math.abs(distanceY) > 100) {\n eyesNewY = distanceY > 0 ? 13 : 3;\n } else {\n eyesNewY = (distanceY / 100) * 5 + 8;\n }\n\n eye.css({\n \"-webkit-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n \"-moz-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n \"-ms-transform\": `translate(${eyesNewX}px, ${eyesNewY}px)`,\n transform: `translate(${eyesNewX}px, ${eyesNewY}px)`,\n });\n }\n }\n\n function createTextAnimation(id, text, onComplete) {\n if (!id) {\n return;\n }\n\n document.querySelector(id).innerText = text;\n\n var mySplitText = new SplitText(id, {\n type: \"words,chars\",\n });\n var chars = mySplitText.chars;\n\n var tl = new TimelineMax({\n paused: true,\n onComplete: () => mouthTimeline.pause(0) && onComplete && onComplete(),\n });\n tl.call(\n function () {\n $(\"#textbox\").addClass(\"visible\");\n },\n null,\n null,\n 0\n ).staggerFrom(\n chars,\n 0.8,\n {\n opacity: 0,\n ease: SteppedEase.config(1),\n },\n 0.08,\n \"+=0\"\n );\n\n return tl;\n }\n\n function figureRadius(w, h) {\n return Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 2;\n }\n\n function createMouthAnimation() {\n const mouthTimeline = gsap.timeline({\n repeat: -1,\n onRepeat: () => (alreadyPlayed = true),\n });\n\n mouthTimeline.pause();\n\n mouthTimeline.to(\"#Mouth-Smile\", {\n duration: 0.5,\n ease: SteppedEase.config(1),\n css: {\n display: \"none\",\n },\n });\n\n return mouthTimeline;\n }\n\n function coverAnimation(onComplete) {\n const revealData = document.querySelector(\"#Avataaar\").getBBox();\n\n TweenMax.set(\"#cover\", {\n attr: {\n cx: revealData.x + revealData.width / 2,\n cy: revealData.y + revealData.height / 2,\n r: figureRadius(revealData.width, revealData.height),\n },\n });\n\n const revealTl = new TimelineMax({\n onComplete,\n });\n\n revealTl.delay(1).from(\"#cover\", 1, {\n attr: { r: 0 },\n ease: Power4.easeInOut,\n });\n }\n\n function blnkAnimation() {\n const tl = gsap.timeline({\n repeat: -1,\n onRepeat: () => {\n // console.log(\"blinking\");\n // tl.play(\"blink\");\n // !alreadyPlayed && mouthTimeline.play();\n eyesFollowMouse();\n // textAnimation.play();\n },\n });\n\n tl.add(\"blink\")\n .to(\n \"#Eyes\\\\/Happy-😁\",\n {\n duration: 0.2,\n ease: SteppedEase.config(1),\n css: {\n display: \"initial\",\n },\n },\n 2\n )\n .to(\n \"#Eyes\\\\/Default-😀\",\n {\n duration: 0.2,\n ease: SteppedEase.config(1),\n css: {\n display: \"none\",\n },\n },\n 2\n );\n\n return tl;\n }\n\n function getParameterByName(name, url) {\n if (!url) {\n url = window.location.href;\n }\n name = name.replace(/[[]]/g, \"\\\\$&\");\n const regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\");\n const results = regex.exec(url);\n if (!results) {\n return null;\n }\n if (!results[2]) {\n return \"\";\n }\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n }\n\n function wizardAnimation(onComplete) {\n playAudioWav(\"http://noproblo.dayjo.org/ZeldaSounds/LOZ/LOZ_Fanfare.wav\");\n onComplete && onComplete();\n }\n\n function randomQuote() {\n const quotes = [];\n // quotes.push({ quote: \"hello! welcome to my GitHub Profile!\" });\n quotes.push({\n quote: \"IT'S DANGROUS TO GO ALONE!\\nTAKE THIS.\",\n animation: wizardAnimation,\n });\n quotes.push({\n quote: \"I'm speaking a language called Animalese from Animal Crossing.\",\n animation: shockedAnimation,\n });\n quotes.push({\n quote: \"Warning: Dates in Calendar are closer than they appear.\",\n });\n // quotes.push({ quote: \"Give me ambiguity or give me something else.\" });\n quotes.push({\n quote: \"Make it idiot proof and someone will make a better idiot.\",\n });\n quotes.push({ quote: \"I'm not a complete idiot, some parts are missing!\" });\n quotes.push({ quote: \"He who laughs last thinks slowest!\" });\n quotes.push({\n quote: \"Always remember you're unique, just like everyone else.\",\n });\n // quotes.push({ quote: \"Save the whales, collect the whole set\" });\n // quotes.push(\"A flashlight is a case for holding dead batteries.\");\n quotes.push({ quote: \"Lottery: A tax on people who are bad at math.\" });\n quotes.push({ quote: \"There's too much blood in my caffeine system.\" });\n // quotes.push({\n // quote: \"Artificial Intelligence usually beats real stupidity.\",\n // });\n quotes.push({\n quote: \"Hard work has a future payoff. Laziness pays off now.\",\n });\n quotes.push({\n quote: \"Friends help you move. Real friends help you move bodies.\",\n });\n quotes.push({\n quote: \"I wont rise to the occasion, but I'll slide over to it.\",\n });\n quotes.push({ quote: \"What is a free gift ? Aren't all gifts free?\" });\n // quotes.push({ quote: \"Very funny, Scotty. Now beam down my clothes.\" });\n quotes.push({ quote: \"Consciousness: that annoying time between naps.\" });\n quotes.push({ quote: \"Oops. My brain just hit a bad sector.\" });\n // quotes.push(\"I used to have a handle on life, then it broke.\");\n quotes.push({\n quote: \"Don't take life too seriously, you won't get out alive.\",\n });\n quotes.push({\n quote: \"I don't suffer from insanity. I enjoy every minute of it.\",\n });\n quotes.push({\n quote: \"Better to understand a little than to misunderstand a lot.\",\n });\n quotes.push({ quote: \"The gene pool could use a little chlorine.\" });\n // quotes.push({ quote: \"When there's a will, I want to be in it.\" });\n // quotes.push({\n // quote: \"All generalizations are false, including this one.\",\n // });\n quotes.push({\n quote: \"Change is inevitable, except from a vending machine.\",\n });\n // quotes.push({\n // quote: \"C program run. C program crash. C programmer quit.\",\n // });\n // quotes.push({ quote: \"Criminal Lawyer is a redundancy.\" });\n quotes.push({ quote: \"90% of all statistics are made up\" });\n // quotes.push(\"A man needs a good memory after he has lied.\");\n quotes.push({ quote: \"Beam me up, Scotty!\" });\n // quotes.push({ quote: \"Oh Beulah, peel me a grape.\" });\n quotes.push({ quote: \"C++ should have been called B\" });\n quotes.push({ quote: \"Energizer Bunny Arrested! Charged with battery.\" });\n quotes.push({\n quote:\n \"ERROR: Uncaught TypeError: Cannot read property 'length' of undefined..... Haha! Just kidding!\",\n });\n quotes.push({\n quote:\n \"I'm Starting to wonder if there are more client-side JavaScript frameworks than there are apps that use them...\",\n });\n quotes.push({\n quote:\n 'Drinking game for web developers:\\n(1) Think of a noun\\n(2) Google \".js\"\\n(3) If a library with that name exists - drink!',\n });\n quotes.push({\n quote:\n 'JavaScript makes me want to flip the table and say \"Fuck this shit\"...\\nbut I can never be sure what \"this\" refers to......',\n });\n quotes.push({\n quote: \"TypeScript.....?\\nThat's one hell of an autocompletion plugin!\",\n });\n\n quotes.push({\n quote: \"How do you comfort a JavaScript bug?\\n...\\n...\\nYou console it\",\n });\n quotes.push({\n quote:\n \"How did the JavaScript developer learn TypeScript so quickly?\\n...\\n...\\nBecause they coded ANYtime, ANYplace, and ANYwhere\",\n });\n quotes.push({\n quote:\n \"Why was the JavaScript developer sad?\\n...\\n...\\nBecause they didn't Node how to Express themselves\",\n });\n quotes.push({\n quote:\n \"What tool do you use to switch versions of node?\\n...\\n...\\noh... nvm, I figured it out.\",\n });\n quotes.push({\n quote:\n \"TypeScript is easy! You just do exactly the opposite of what you did in java\",\n });\n quotes.push({\n quote:\n `Why did the JavaScript developer go broke?\\n...\\n...\\nBecause he used typeof on a penny and got a \"string\" instead of a \"number.\"`,\n });\n\n quotes.push({\n quote:\n `Why did the JavaScript array go out of bounds?\\n...\\n...\\nBecause it didn't know its own length.`,\n });\n\n quotes.push({\n quote:\n `Why was the JavaScript developer sad?\\n...\\n...\\nBecause they didn't Node how to Express himself.`,\n });\n\n quotes.push({\n quote:\n `Why did the child component have such great self-esteem?\\n...\\n...\\nBecause its parent kept giving it props!`,\n });\n\n quotes.push({\n quote:\n `Don't trust JavaScript programmers. All they do is promises but they never callback.`,\n });\n\n quotes.push({\n quote:\n `Why did the functional component feel lost?\\n...\\n...\\nBecause it didn't know what state it was in!`,\n });\n\n quotes.push({\n quote:\n `JavaScript is a lot like English; No one knows how to use semicolons properly.`,\n });\n\n quotes.push({\n quote:\n `You want to hear a javascript joke?\\n...\\n...\\nI'll callback later.`,\n });\n\n return quotes[Math.floor(Math.random() * quotes.length)];\n }\n}\n\nfunction createClouds() {\n var cloudbox = document.getElementById(\"cloudbox\");\n var cloudbox1 = document.getElementById(\"cloudbox2\");\n\n function createCloud(cloudbox, color) {\n const vw = Math.max(\n document.documentElement.clientWidth || 0,\n window.innerWidth || 0\n );\n const vh = Math.max(\n document.documentElement.clientHeight || 0,\n window.innerHeight || 0\n );\n color = color || \"white\";\n cloudbox.style = `--cloud-color: ${color}`;\n // CREATE THE CLOUD SPAN\n var cloud = document.createElement(\"span\");\n cloud.style.width = Math.abs(Math.random() * (180 - 60) + 60) + \"px\";\n\n // ANIMATION VARIABLES\n var cloudTime = Math.abs(Math.random() * (240 - 120) + 120);\n var cloudTop = Math.abs(Math.random() * vh);\n\n // GSAP TIMELINES\n var tlAcross = new TimelineMax({ repeat: -1 });\n tlAcross\n .set(cloud, { left: 0 })\n .seek(cloudTime * Math.random())\n .to(cloud, cloudTime, { left: \"100%\", ease: Power0.easeNone });\n\n var tlDown = new TimelineMax({ repeat: -1 });\n tlDown\n .set(cloud, { top: cloudTop, ease: Power0.easeNone })\n .seek(cloudTime * Math.random())\n .to(cloud, cloudTime / 2, { top: cloudTop + 40, ease: Power0.easeNone })\n .to(cloud, cloudTime / 2, { top: cloudTop, ease: Power0.easeNone });\n\n // ADD IT TO THE CLOUDBOX\n cloudbox.appendChild(cloud);\n }\n\n for (var i = 0; i < 25; i++) {\n createCloud(cloudbox, \"white\");\n }\n\n for (var i = 0; i < 25; i++) {\n createCloud(cloudbox1, \"lightgrey\");\n }\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file