{"version":3,"sources":["webpack:///./src/js/modules/InsightCardsGridV2.js","webpack:///./src/js/components/CardV2PatternAnimator.js","webpack:///./src/js/components/CardV2.js"],"names":["Module","this","dom","insightCards","el","querySelectorAll","cards","forEach","card","push","CardV2","initMasonry","Masonry","itemSelector","gutter","columnWidth","percentPosition","Component","chevronWithAccent","querySelector","chevron","panels","sequence","variation","dataset","parseInt","duration","parseFloat","delay","classList","add","setupVariation","defineSequence","grid","outAnimation","opacity","style","fill","animate","color","accent","timeline","defineAnimations","animEl1","animEl2","animEl3","anim1","transform","at","anim2","anim3","svgPattern","overlay","image","animator","CardPatternAnimator","saveInitialMarkup","initSplitting","handleResize","addCardListeners","window","addEventListener","bind","handleCardHoverIn","handleCardHoverOut","e","isMobile","currentTarget","hasImage","contains","lineSplit","lines","line","index","inAnimation","finished","then","slice","reverse","matchMedia","matches","initialMarkup","outerHTML","target","by"],"mappings":"qYAAA,Q,IACA,Q,IACA,Q,wTAEMA,E,ieAEFC,KAAKC,IAAM,CAAEC,aAAcF,KAAKG,GAAGC,iBAAiB,qBACpD,IAAMC,EAAQ,GACdL,KAAKC,IAAIC,aAAaI,SAAQ,SAAAC,GAAA,OAAQF,EAAMG,KAAK,IAAIC,UAAOF,OAC5DP,KAAKU,gB,4EAML,IAAIC,UAAQX,KAAKG,GAAI,CACnBS,aAAc,mBACdC,OAAQ,gBACRC,YAAa,cACbC,iBAAiB,Q,GAfFC,a,UAoBNjB,G,2UCxBf,QACA,S,qQAEMA,E,ieAEFC,KAAKC,IAAM,CACTgB,kBAAmBjB,KAAKG,GAAGe,cACzB,oCAEFC,QAASnB,KAAKG,GAAGe,cAAc,0BAC/BE,OAAQpB,KAAKG,GAAGe,cAAc,0BAEhClB,KAAKqB,SAAW,GAChBrB,KAAKsB,UAAYtB,KAAKG,GAAGoB,QAAQD,UAC7BE,SAASxB,KAAKG,GAAGoB,QAAQD,WACzB,EACJtB,KAAKyB,SAAWzB,KAAKG,GAAGoB,QAAQE,SAC5BC,WA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1D,KAAKG,GAAG6E,cAAgBhF,KAAKG,GAAG8E,Y,sCAIhCjF,KAAKuD,oBACLvD,KAAKG,GAAGkE,WAAY,aAAU,CAC5Ba,OAAQlF,KAAKG,GACbgF,GAAI,c,GArJWnE,a,UA0JNjB","file":"24.eb4ec75bfa0d0d8b57c9.js","sourcesContent":["import { Component } from '@verndale/core';\nimport Masonry from 'masonry-layout';\nimport CardV2 from '../components/CardV2';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = { insightCards: this.el.querySelectorAll('.insight-card-v2') };\n const cards = [];\n this.dom.insightCards.forEach(card => cards.push(new CardV2(card)));\n this.initMasonry();\n }\n\n addListeners() {}\n\n initMasonry() {\n new Masonry(this.el, {\n itemSelector: '.insight-card-v2',\n gutter: '.gutter-sizer',\n columnWidth: '.grid-sizer',\n percentPosition: true\n });\n }\n}\n\nexport default Module;\n","import { Component } from '@verndale/core';\nimport { timeline } from 'motion';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n chevronWithAccent: this.el.querySelector(\n '.card-pattern__chevron--w-accent'\n ),\n chevron: this.el.querySelector('.card-pattern__chevron'),\n panels: this.el.querySelector('.card-pattern__panels')\n };\n this.sequence = [];\n this.variation = this.el.dataset.variation\n ? parseInt(this.el.dataset.variation)\n : 0;\n this.duration = this.el.dataset.duration\n ? parseFloat(this.el.dataset.duration)\n : 1;\n this.delay = this.el.dataset.delay ? parseFloat(this.el.dataset.delay) : 0;\n this.el.classList.add(`card-pattern__variation--${this.variation}`);\n this.setupVariation(this.variation);\n this.defineSequence();\n\n if (!this.el.dataset.grid) {\n this.outAnimation();\n }\n }\n\n setOpacity(opacity) {\n this.dom.chevronWithAccent.style.opacity = opacity;\n this.dom.chevron.style.opacity = opacity;\n this.dom.panels.style.opacity = opacity;\n }\n\n inAnimation() {\n this.dom.chevronWithAccent.querySelector('.chevron').style.fill = '#ffffff';\n this.dom.chevron.querySelector('.chevron').style.fill = '#ffffff';\n this.dom.panels.querySelector('.panels').style.fill = '#ffffff';\n this.animate();\n }\n\n outAnimation() {\n this.dom.chevronWithAccent.querySelector('.chevron').style.fill = '#6a2ff3';\n this.dom.chevron.querySelector('.chevron').style.fill = '#6a2ff3';\n this.dom.panels.querySelector('.panels').style.fill = '#6a2ff3';\n this.animate();\n }\n\n outGridAnimation(delay, color, accent) {\n this.dom.chevronWithAccent.querySelector('.chevron').style.fill = color;\n this.dom.chevronWithAccent.querySelector('.accent').style.fill = accent;\n this.dom.chevron.querySelector('.chevron').style.fill = color;\n this.dom.panels.querySelector('.panels').style.fill = color;\n return timeline(this.sequence, {\n duration: this.duration,\n delay\n });\n }\n\n setupVariation(variation) {\n // chevron with accent, chevron, panels\n switch (variation) {\n case 1:\n this.defineAnimations(\n this.dom.chevronWithAccent,\n this.dom.chevron,\n this.dom.panels\n );\n break;\n case 2:\n this.defineAnimations(\n this.dom.panels,\n this.dom.chevron,\n this.dom.chevronWithAccent\n );\n break;\n case 3:\n this.defineAnimations(\n this.dom.chevron,\n this.dom.panels,\n this.dom.chevronWithAccent\n );\n break;\n case 4:\n this.defineAnimations(\n this.dom.panels,\n this.dom.chevronWithAccent,\n this.dom.chevron\n );\n break;\n case 5:\n this.defineAnimations(\n this.dom.chevron,\n this.dom.chevronWithAccent,\n this.dom.panels\n );\n break;\n case 6:\n this.defineAnimations(\n this.dom.chevron,\n this.dom.panels,\n this.dom.chevronWithAccent\n );\n break;\n\n default:\n this.defineAnimations(\n this.dom.chevronWithAccent,\n this.dom.chevron,\n this.dom.panels\n );\n }\n }\n\n defineAnimations(animEl1, animEl2, animEl3) {\n this.anim1 = [\n animEl1,\n {\n opacity: [0, 1],\n transform: [\n `translate(0, ${this.el.dataset.grid ? -50 : -30}px)`,\n 'translate(0, 0px)'\n ]\n },\n { at: '0' }\n ];\n this.anim2 = [\n animEl2,\n {\n opacity: [0, 1],\n transform: [\n `translate(0, ${this.el.dataset.grid ? -50 : -30}px)`,\n 'translate(0, 0px)'\n ]\n },\n { at: '-0.27' }\n ];\n this.anim3 = [\n animEl3,\n {\n opacity: [0, 1],\n transform: [\n `translate(0, ${this.el.dataset.grid ? -50 : -30}px)`,\n 'translate(0, 0px)'\n ]\n },\n { at: '-0.26' }\n ];\n }\n\n defineSequence() {\n this.sequence.push(this.anim1);\n this.sequence.push(this.anim2);\n this.sequence.push(this.anim3);\n }\n\n animate() {\n timeline(this.sequence, { duration: this.duration, delay: this.delay });\n }\n}\n\nexport default Module;\n","import { animate, timeline } from 'motion';\n\nimport CardPatternAnimator from './CardV2PatternAnimator';\nimport { Component } from '@verndale/core';\nimport Splitting from 'splitting';\nimport debounce from 'lodash/debounce';\n\nclass Module extends Component {\n setupDefaults() {\n this.dom = {\n svgPattern: this.el.querySelector('.card-pattern'),\n overlay: this.el.querySelector('.insight-cards-item-v2__overlay'),\n image: this.el.querySelector('img')\n };\n if (this.dom.svgPattern)\n this.animator = new CardPatternAnimator(this.dom.svgPattern);\n this.saveInitialMarkup();\n this.initSplitting();\n this.handleResize();\n }\n\n addListeners() {\n this.addCardListeners();\n window.addEventListener(\n 'resize',\n debounce(this.handleResize.bind(this), 300)\n );\n }\n\n addCardListeners() {\n this.el.addEventListener('mouseenter', this.handleCardHoverIn.bind(this));\n this.el.addEventListener('mouseleave', this.handleCardHoverOut.bind(this));\n }\n\n handleCardHoverIn(e) {\n if (!this.isMobile) {\n const card = e.currentTarget;\n const hasImage =\n !card.classList.contains('insight-cards-v2__item--no-bg-image') ||\n card.classList.contains('insight-card-person-item-v2__item');\n card.lineSplit[0].lines.forEach((line, index) => {\n const sequence = [\n [\n line,\n {\n opacity: [1, 0],\n transform: ['translate(0, 0)', 'translate(100px, 0)']\n },\n { duration: 0.15, delay: 0.05 * index }\n ],\n [\n line,\n {\n color: !hasImage && '#fff'\n },\n { at: 0.15 + 0.05 * index },\n {\n duration: 0\n }\n ],\n [\n line,\n {\n opacity: [0, 1],\n transform: ['translate(-100px, 0)', 'translate(0, 0)']\n },\n { at: 0.17 + 0.05 * index },\n { duration: 0.15, delay: 0.05 * index }\n ]\n ];\n timeline(sequence);\n });\n if (this.animator) this.animator.inAnimation();\n animate(\n this.dom.overlay,\n { transform: 'skew(-30deg) scale(2, 1)' },\n { duration: 0.45 }\n ).finished.then(() => {});\n\n if (this.dom.image)\n animate(\n this.dom.image,\n { transform: 'scale(1.25)' },\n { duration: 0.5 }\n );\n }\n }\n\n handleCardHoverOut(e) {\n if (!this.isMobile) {\n const card = e.currentTarget;\n const hasImage =\n !card.classList.contains('insight-cards-v2__item--no-bg-image') ||\n card.classList.contains('insight-card-person-item-v2__item');\n const linesReversed = card.lineSplit[0].lines.slice().reverse();\n linesReversed.forEach((line, index) => {\n const sequence = [\n [\n line,\n {\n opacity: [1, 0],\n transform: ['translate(0, 0)', 'translate(-100px, 0)']\n },\n { duration: 0.15, delay: 0.05 * index }\n ],\n [\n line,\n { color: !hasImage && '#1c1c1c' },\n { at: 0.17 + 0.05 * index },\n {\n duration: 0\n }\n ],\n [\n line,\n {\n opacity: [0, 1],\n transform: ['translate(100px, 0)', 'translate(0, 0)']\n },\n { at: 0.17 + 0.075 * index },\n { duration: 0.15, delay: 0.05 * index }\n ]\n ];\n timeline(sequence);\n });\n if (this.animator) this.animator.outAnimation();\n animate(\n this.dom.overlay,\n { transform: 'skew(-30deg) scale(0, 1)' },\n { duration: 0.45 }\n );\n if (this.dom.image)\n animate(\n this.dom.image,\n { transform: 'scale(1)' },\n { duration: 1, delay: 0.2 }\n );\n }\n }\n\n handleResize() {\n this.isMobile = window.matchMedia('(max-width: 1025px)').matches;\n if (!this.isMobile) {\n this.initSplitting();\n this.addCardListeners();\n }\n }\n\n saveInitialMarkup() {\n this.el.initialMarkup = this.el.outerHTML;\n }\n\n initSplitting() {\n this.saveInitialMarkup();\n this.el.lineSplit = Splitting({\n target: this.el,\n by: 'lines'\n });\n }\n}\n\nexport default Module;\n"],"sourceRoot":""}