autoanimate.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. import { queryAll, extend, createStyleSheet, matches, closest } from '../utils/util.js'
  2. import { FRAGMENT_STYLE_REGEX } from '../utils/constants.js'
  3. // Counter used to generate unique IDs for auto-animated elements
  4. let autoAnimateCounter = 0;
  5. /**
  6. * Automatically animates matching elements across
  7. * slides with the [data-auto-animate] attribute.
  8. */
  9. export default class AutoAnimate {
  10. constructor( Reveal ) {
  11. this.Reveal = Reveal;
  12. }
  13. /**
  14. * Runs an auto-animation between the given slides.
  15. *
  16. * @param {HTMLElement} fromSlide
  17. * @param {HTMLElement} toSlide
  18. */
  19. run( fromSlide, toSlide ) {
  20. // Clean up after prior animations
  21. this.reset();
  22. let allSlides = this.Reveal.getSlides();
  23. let toSlideIndex = allSlides.indexOf( toSlide );
  24. let fromSlideIndex = allSlides.indexOf( fromSlide );
  25. // Ensure that;
  26. // 1. Both slides exist.
  27. // 2. Both slides are auto-animate targets with the same
  28. // data-auto-animate-id value (including null if absent on both).
  29. // 3. data-auto-animate-restart isn't set on the physically latter
  30. // slide (independent of slide direction).
  31. if( fromSlide && toSlide && fromSlide.hasAttribute( 'data-auto-animate' ) && toSlide.hasAttribute( 'data-auto-animate' )
  32. && fromSlide.getAttribute( 'data-auto-animate-id' ) === toSlide.getAttribute( 'data-auto-animate-id' )
  33. && !( toSlideIndex > fromSlideIndex ? toSlide : fromSlide ).hasAttribute( 'data-auto-animate-restart' ) ) {
  34. // Create a new auto-animate sheet
  35. this.autoAnimateStyleSheet = this.autoAnimateStyleSheet || createStyleSheet();
  36. let animationOptions = this.getAutoAnimateOptions( toSlide );
  37. // Set our starting state
  38. fromSlide.dataset.autoAnimate = 'pending';
  39. toSlide.dataset.autoAnimate = 'pending';
  40. // Flag the navigation direction, needed for fragment buildup
  41. animationOptions.slideDirection = toSlideIndex > fromSlideIndex ? 'forward' : 'backward';
  42. // If the from-slide is hidden because it has moved outside
  43. // the view distance, we need to temporarily show it while
  44. // measuring
  45. let fromSlideIsHidden = fromSlide.style.display === 'none';
  46. if( fromSlideIsHidden ) fromSlide.style.display = this.Reveal.getConfig().display;
  47. // Inject our auto-animate styles for this transition
  48. let css = this.getAutoAnimatableElements( fromSlide, toSlide ).map( elements => {
  49. return this.autoAnimateElements( elements.from, elements.to, elements.options || {}, animationOptions, autoAnimateCounter++ );
  50. } );
  51. if( fromSlideIsHidden ) fromSlide.style.display = 'none';
  52. // Animate unmatched elements, if enabled
  53. if( toSlide.dataset.autoAnimateUnmatched !== 'false' && this.Reveal.getConfig().autoAnimateUnmatched === true ) {
  54. // Our default timings for unmatched elements
  55. let defaultUnmatchedDuration = animationOptions.duration * 0.8,
  56. defaultUnmatchedDelay = animationOptions.duration * 0.2;
  57. this.getUnmatchedAutoAnimateElements( toSlide ).forEach( unmatchedElement => {
  58. let unmatchedOptions = this.getAutoAnimateOptions( unmatchedElement, animationOptions );
  59. let id = 'unmatched';
  60. // If there is a duration or delay set specifically for this
  61. // element our unmatched elements should adhere to those
  62. if( unmatchedOptions.duration !== animationOptions.duration || unmatchedOptions.delay !== animationOptions.delay ) {
  63. id = 'unmatched-' + autoAnimateCounter++;
  64. css.push( `[data-auto-animate="running"] [data-auto-animate-target="${id}"] { transition: opacity ${unmatchedOptions.duration}s ease ${unmatchedOptions.delay}s; }` );
  65. }
  66. unmatchedElement.dataset.autoAnimateTarget = id;
  67. }, this );
  68. // Our default transition for unmatched elements
  69. css.push( `[data-auto-animate="running"] [data-auto-animate-target="unmatched"] { transition: opacity ${defaultUnmatchedDuration}s ease ${defaultUnmatchedDelay}s; }` );
  70. }
  71. // Setting the whole chunk of CSS at once is the most
  72. // efficient way to do this. Using sheet.insertRule
  73. // is multiple factors slower.
  74. this.autoAnimateStyleSheet.innerHTML = css.join( '' );
  75. // Start the animation next cycle
  76. requestAnimationFrame( () => {
  77. if( this.autoAnimateStyleSheet ) {
  78. // This forces our newly injected styles to be applied in Firefox
  79. getComputedStyle( this.autoAnimateStyleSheet ).fontWeight;
  80. toSlide.dataset.autoAnimate = 'running';
  81. }
  82. } );
  83. this.Reveal.dispatchEvent({
  84. type: 'autoanimate',
  85. data: {
  86. fromSlide,
  87. toSlide,
  88. sheet: this.autoAnimateStyleSheet
  89. }
  90. });
  91. }
  92. }
  93. /**
  94. * Rolls back all changes that we've made to the DOM so
  95. * that as part of animating.
  96. */
  97. reset() {
  98. // Reset slides
  99. queryAll( this.Reveal.getRevealElement(), '[data-auto-animate]:not([data-auto-animate=""])' ).forEach( element => {
  100. element.dataset.autoAnimate = '';
  101. } );
  102. // Reset elements
  103. queryAll( this.Reveal.getRevealElement(), '[data-auto-animate-target]' ).forEach( element => {
  104. delete element.dataset.autoAnimateTarget;
  105. } );
  106. // Remove the animation sheet
  107. if( this.autoAnimateStyleSheet && this.autoAnimateStyleSheet.parentNode ) {
  108. this.autoAnimateStyleSheet.parentNode.removeChild( this.autoAnimateStyleSheet );
  109. this.autoAnimateStyleSheet = null;
  110. }
  111. }
  112. /**
  113. * Creates a FLIP animation where the `to` element starts out
  114. * in the `from` element position and animates to its original
  115. * state.
  116. *
  117. * @param {HTMLElement} from
  118. * @param {HTMLElement} to
  119. * @param {Object} elementOptions Options for this element pair
  120. * @param {Object} animationOptions Options set at the slide level
  121. * @param {String} id Unique ID that we can use to identify this
  122. * auto-animate element in the DOM
  123. */
  124. autoAnimateElements( from, to, elementOptions, animationOptions, id ) {
  125. // 'from' elements are given a data-auto-animate-target with no value,
  126. // 'to' elements are are given a data-auto-animate-target with an ID
  127. from.dataset.autoAnimateTarget = '';
  128. to.dataset.autoAnimateTarget = id;
  129. // Each element may override any of the auto-animate options
  130. // like transition easing, duration and delay via data-attributes
  131. let options = this.getAutoAnimateOptions( to, animationOptions );
  132. // If we're using a custom element matcher the element options
  133. // may contain additional transition overrides
  134. if( typeof elementOptions.delay !== 'undefined' ) options.delay = elementOptions.delay;
  135. if( typeof elementOptions.duration !== 'undefined' ) options.duration = elementOptions.duration;
  136. if( typeof elementOptions.easing !== 'undefined' ) options.easing = elementOptions.easing;
  137. let fromProps = this.getAutoAnimatableProperties( 'from', from, elementOptions ),
  138. toProps = this.getAutoAnimatableProperties( 'to', to, elementOptions );
  139. // Maintain fragment visibility for matching elements when
  140. // we're navigating forwards, this way the viewer won't need
  141. // to step through the same fragments twice
  142. if( to.classList.contains( 'fragment' ) ) {
  143. // Don't auto-animate the opacity of fragments to avoid
  144. // conflicts with fragment animations
  145. delete toProps.styles['opacity'];
  146. if( from.classList.contains( 'fragment' ) ) {
  147. let fromFragmentStyle = ( from.className.match( FRAGMENT_STYLE_REGEX ) || [''] )[0];
  148. let toFragmentStyle = ( to.className.match( FRAGMENT_STYLE_REGEX ) || [''] )[0];
  149. // Only skip the fragment if the fragment animation style
  150. // remains unchanged
  151. if( fromFragmentStyle === toFragmentStyle && animationOptions.slideDirection === 'forward' ) {
  152. to.classList.add( 'visible', 'disabled' );
  153. }
  154. }
  155. }
  156. // If translation and/or scaling are enabled, css transform
  157. // the 'to' element so that it matches the position and size
  158. // of the 'from' element
  159. if( elementOptions.translate !== false || elementOptions.scale !== false ) {
  160. let presentationScale = this.Reveal.getScale();
  161. let delta = {
  162. x: ( fromProps.x - toProps.x ) / presentationScale,
  163. y: ( fromProps.y - toProps.y ) / presentationScale,
  164. scaleX: fromProps.width / toProps.width,
  165. scaleY: fromProps.height / toProps.height
  166. };
  167. // Limit decimal points to avoid 0.0001px blur and stutter
  168. delta.x = Math.round( delta.x * 1000 ) / 1000;
  169. delta.y = Math.round( delta.y * 1000 ) / 1000;
  170. delta.scaleX = Math.round( delta.scaleX * 1000 ) / 1000;
  171. delta.scaleX = Math.round( delta.scaleX * 1000 ) / 1000;
  172. let translate = elementOptions.translate !== false && ( delta.x !== 0 || delta.y !== 0 ),
  173. scale = elementOptions.scale !== false && ( delta.scaleX !== 0 || delta.scaleY !== 0 );
  174. // No need to transform if nothing's changed
  175. if( translate || scale ) {
  176. let transform = [];
  177. if( translate ) transform.push( `translate(${delta.x}px, ${delta.y}px)` );
  178. if( scale ) transform.push( `scale(${delta.scaleX}, ${delta.scaleY})` );
  179. fromProps.styles['transform'] = transform.join( ' ' );
  180. fromProps.styles['transform-origin'] = 'top left';
  181. toProps.styles['transform'] = 'none';
  182. }
  183. }
  184. // Delete all unchanged 'to' styles
  185. for( let propertyName in toProps.styles ) {
  186. const toValue = toProps.styles[propertyName];
  187. const fromValue = fromProps.styles[propertyName];
  188. if( toValue === fromValue ) {
  189. delete toProps.styles[propertyName];
  190. }
  191. else {
  192. // If these property values were set via a custom matcher providing
  193. // an explicit 'from' and/or 'to' value, we always inject those values.
  194. if( toValue.explicitValue === true ) {
  195. toProps.styles[propertyName] = toValue.value;
  196. }
  197. if( fromValue.explicitValue === true ) {
  198. fromProps.styles[propertyName] = fromValue.value;
  199. }
  200. }
  201. }
  202. let css = '';
  203. let toStyleProperties = Object.keys( toProps.styles );
  204. // Only create animate this element IF at least one style
  205. // property has changed
  206. if( toStyleProperties.length > 0 ) {
  207. // Instantly move to the 'from' state
  208. fromProps.styles['transition'] = 'none';
  209. // Animate towards the 'to' state
  210. toProps.styles['transition'] = `all ${options.duration}s ${options.easing} ${options.delay}s`;
  211. toProps.styles['transition-property'] = toStyleProperties.join( ', ' );
  212. toProps.styles['will-change'] = toStyleProperties.join( ', ' );
  213. // Build up our custom CSS. We need to override inline styles
  214. // so we need to make our styles vErY IMPORTANT!1!!
  215. let fromCSS = Object.keys( fromProps.styles ).map( propertyName => {
  216. return propertyName + ': ' + fromProps.styles[propertyName] + ' !important;';
  217. } ).join( '' );
  218. let toCSS = Object.keys( toProps.styles ).map( propertyName => {
  219. return propertyName + ': ' + toProps.styles[propertyName] + ' !important;';
  220. } ).join( '' );
  221. css = '[data-auto-animate-target="'+ id +'"] {'+ fromCSS +'}' +
  222. '[data-auto-animate="running"] [data-auto-animate-target="'+ id +'"] {'+ toCSS +'}';
  223. }
  224. return css;
  225. }
  226. /**
  227. * Returns the auto-animate options for the given element.
  228. *
  229. * @param {HTMLElement} element Element to pick up options
  230. * from, either a slide or an animation target
  231. * @param {Object} [inheritedOptions] Optional set of existing
  232. * options
  233. */
  234. getAutoAnimateOptions( element, inheritedOptions ) {
  235. let options = {
  236. easing: this.Reveal.getConfig().autoAnimateEasing,
  237. duration: this.Reveal.getConfig().autoAnimateDuration,
  238. delay: 0
  239. };
  240. options = extend( options, inheritedOptions );
  241. // Inherit options from parent elements
  242. if( element.parentNode ) {
  243. let autoAnimatedParent = closest( element.parentNode, '[data-auto-animate-target]' );
  244. if( autoAnimatedParent ) {
  245. options = this.getAutoAnimateOptions( autoAnimatedParent, options );
  246. }
  247. }
  248. if( element.dataset.autoAnimateEasing ) {
  249. options.easing = element.dataset.autoAnimateEasing;
  250. }
  251. if( element.dataset.autoAnimateDuration ) {
  252. options.duration = parseFloat( element.dataset.autoAnimateDuration );
  253. }
  254. if( element.dataset.autoAnimateDelay ) {
  255. options.delay = parseFloat( element.dataset.autoAnimateDelay );
  256. }
  257. return options;
  258. }
  259. /**
  260. * Returns an object containing all of the properties
  261. * that can be auto-animated for the given element and
  262. * their current computed values.
  263. *
  264. * @param {String} direction 'from' or 'to'
  265. */
  266. getAutoAnimatableProperties( direction, element, elementOptions ) {
  267. let config = this.Reveal.getConfig();
  268. let properties = { styles: [] };
  269. // Position and size
  270. if( elementOptions.translate !== false || elementOptions.scale !== false ) {
  271. let bounds;
  272. // Custom auto-animate may optionally return a custom tailored
  273. // measurement function
  274. if( typeof elementOptions.measure === 'function' ) {
  275. bounds = elementOptions.measure( element );
  276. }
  277. else {
  278. if( config.center ) {
  279. // More precise, but breaks when used in combination
  280. // with zoom for scaling the deck ¯\_(ツ)_/¯
  281. bounds = element.getBoundingClientRect();
  282. }
  283. else {
  284. let scale = this.Reveal.getScale();
  285. bounds = {
  286. x: element.offsetLeft * scale,
  287. y: element.offsetTop * scale,
  288. width: element.offsetWidth * scale,
  289. height: element.offsetHeight * scale
  290. };
  291. }
  292. }
  293. properties.x = bounds.x;
  294. properties.y = bounds.y;
  295. properties.width = bounds.width;
  296. properties.height = bounds.height;
  297. }
  298. const computedStyles = getComputedStyle( element );
  299. // CSS styles
  300. ( elementOptions.styles || config.autoAnimateStyles ).forEach( style => {
  301. let value;
  302. // `style` is either the property name directly, or an object
  303. // definition of a style property
  304. if( typeof style === 'string' ) style = { property: style };
  305. if( typeof style.from !== 'undefined' && direction === 'from' ) {
  306. value = { value: style.from, explicitValue: true };
  307. }
  308. else if( typeof style.to !== 'undefined' && direction === 'to' ) {
  309. value = { value: style.to, explicitValue: true };
  310. }
  311. else {
  312. // Use a unitless value for line-height so that it inherits properly
  313. if( style.property === 'line-height' ) {
  314. value = parseFloat( computedStyles['line-height'] ) / parseFloat( computedStyles['font-size'] );
  315. }
  316. if( isNaN(value) ) {
  317. value = computedStyles[style.property];
  318. }
  319. }
  320. if( value !== '' ) {
  321. properties.styles[style.property] = value;
  322. }
  323. } );
  324. return properties;
  325. }
  326. /**
  327. * Get a list of all element pairs that we can animate
  328. * between the given slides.
  329. *
  330. * @param {HTMLElement} fromSlide
  331. * @param {HTMLElement} toSlide
  332. *
  333. * @return {Array} Each value is an array where [0] is
  334. * the element we're animating from and [1] is the
  335. * element we're animating to
  336. */
  337. getAutoAnimatableElements( fromSlide, toSlide ) {
  338. let matcher = typeof this.Reveal.getConfig().autoAnimateMatcher === 'function' ? this.Reveal.getConfig().autoAnimateMatcher : this.getAutoAnimatePairs;
  339. let pairs = matcher.call( this, fromSlide, toSlide );
  340. let reserved = [];
  341. // Remove duplicate pairs
  342. return pairs.filter( ( pair, index ) => {
  343. if( reserved.indexOf( pair.to ) === -1 ) {
  344. reserved.push( pair.to );
  345. return true;
  346. }
  347. } );
  348. }
  349. /**
  350. * Identifies matching elements between slides.
  351. *
  352. * You can specify a custom matcher function by using
  353. * the `autoAnimateMatcher` config option.
  354. */
  355. getAutoAnimatePairs( fromSlide, toSlide ) {
  356. let pairs = [];
  357. const codeNodes = 'pre';
  358. const textNodes = 'h1, h2, h3, h4, h5, h6, p, li';
  359. const mediaNodes = 'img, video, iframe';
  360. // Explicit matches via data-id
  361. this.findAutoAnimateMatches( pairs, fromSlide, toSlide, '[data-id]', node => {
  362. return node.nodeName + ':::' + node.getAttribute( 'data-id' );
  363. } );
  364. // Text
  365. this.findAutoAnimateMatches( pairs, fromSlide, toSlide, textNodes, node => {
  366. return node.nodeName + ':::' + node.innerText;
  367. } );
  368. // Media
  369. this.findAutoAnimateMatches( pairs, fromSlide, toSlide, mediaNodes, node => {
  370. return node.nodeName + ':::' + ( node.getAttribute( 'src' ) || node.getAttribute( 'data-src' ) );
  371. } );
  372. // Code
  373. this.findAutoAnimateMatches( pairs, fromSlide, toSlide, codeNodes, node => {
  374. return node.nodeName + ':::' + node.innerText;
  375. } );
  376. pairs.forEach( pair => {
  377. // Disable scale transformations on text nodes, we transition
  378. // each individual text property instead
  379. if( matches( pair.from, textNodes ) ) {
  380. pair.options = { scale: false };
  381. }
  382. // Animate individual lines of code
  383. else if( matches( pair.from, codeNodes ) ) {
  384. // Transition the code block's width and height instead of scaling
  385. // to prevent its content from being squished
  386. pair.options = { scale: false, styles: [ 'width', 'height' ] };
  387. // Lines of code
  388. this.findAutoAnimateMatches( pairs, pair.from, pair.to, '.hljs .hljs-ln-code', node => {
  389. return node.textContent;
  390. }, {
  391. scale: false,
  392. styles: [],
  393. measure: this.getLocalBoundingBox.bind( this )
  394. } );
  395. // Line numbers
  396. this.findAutoAnimateMatches( pairs, pair.from, pair.to, '.hljs .hljs-ln-numbers[data-line-number]', node => {
  397. return node.getAttribute( 'data-line-number' );
  398. }, {
  399. scale: false,
  400. styles: [ 'width' ],
  401. measure: this.getLocalBoundingBox.bind( this )
  402. } );
  403. }
  404. }, this );
  405. return pairs;
  406. }
  407. /**
  408. * Helper method which returns a bounding box based on
  409. * the given elements offset coordinates.
  410. *
  411. * @param {HTMLElement} element
  412. * @return {Object} x, y, width, height
  413. */
  414. getLocalBoundingBox( element ) {
  415. const presentationScale = this.Reveal.getScale();
  416. return {
  417. x: Math.round( ( element.offsetLeft * presentationScale ) * 100 ) / 100,
  418. y: Math.round( ( element.offsetTop * presentationScale ) * 100 ) / 100,
  419. width: Math.round( ( element.offsetWidth * presentationScale ) * 100 ) / 100,
  420. height: Math.round( ( element.offsetHeight * presentationScale ) * 100 ) / 100
  421. };
  422. }
  423. /**
  424. * Finds matching elements between two slides.
  425. *
  426. * @param {Array} pairs List of pairs to push matches to
  427. * @param {HTMLElement} fromScope Scope within the from element exists
  428. * @param {HTMLElement} toScope Scope within the to element exists
  429. * @param {String} selector CSS selector of the element to match
  430. * @param {Function} serializer A function that accepts an element and returns
  431. * a stringified ID based on its contents
  432. * @param {Object} animationOptions Optional config options for this pair
  433. */
  434. findAutoAnimateMatches( pairs, fromScope, toScope, selector, serializer, animationOptions ) {
  435. let fromMatches = {};
  436. let toMatches = {};
  437. [].slice.call( fromScope.querySelectorAll( selector ) ).forEach( ( element, i ) => {
  438. const key = serializer( element );
  439. if( typeof key === 'string' && key.length ) {
  440. fromMatches[key] = fromMatches[key] || [];
  441. fromMatches[key].push( element );
  442. }
  443. } );
  444. [].slice.call( toScope.querySelectorAll( selector ) ).forEach( ( element, i ) => {
  445. const key = serializer( element );
  446. toMatches[key] = toMatches[key] || [];
  447. toMatches[key].push( element );
  448. let fromElement;
  449. // Retrieve the 'from' element
  450. if( fromMatches[key] ) {
  451. const primaryIndex = toMatches[key].length - 1;
  452. const secondaryIndex = fromMatches[key].length - 1;
  453. // If there are multiple identical from elements, retrieve
  454. // the one at the same index as our to-element.
  455. if( fromMatches[key][ primaryIndex ] ) {
  456. fromElement = fromMatches[key][ primaryIndex ];
  457. fromMatches[key][ primaryIndex ] = null;
  458. }
  459. // If there are no matching from-elements at the same index,
  460. // use the last one.
  461. else if( fromMatches[key][ secondaryIndex ] ) {
  462. fromElement = fromMatches[key][ secondaryIndex ];
  463. fromMatches[key][ secondaryIndex ] = null;
  464. }
  465. }
  466. // If we've got a matching pair, push it to the list of pairs
  467. if( fromElement ) {
  468. pairs.push({
  469. from: fromElement,
  470. to: element,
  471. options: animationOptions
  472. });
  473. }
  474. } );
  475. }
  476. /**
  477. * Returns a all elements within the given scope that should
  478. * be considered unmatched in an auto-animate transition. If
  479. * fading of unmatched elements is turned on, these elements
  480. * will fade when going between auto-animate slides.
  481. *
  482. * Note that parents of auto-animate targets are NOT considered
  483. * unmatched since fading them would break the auto-animation.
  484. *
  485. * @param {HTMLElement} rootElement
  486. * @return {Array}
  487. */
  488. getUnmatchedAutoAnimateElements( rootElement ) {
  489. return [].slice.call( rootElement.children ).reduce( ( result, element ) => {
  490. const containsAnimatedElements = element.querySelector( '[data-auto-animate-target]' );
  491. // The element is unmatched if
  492. // - It is not an auto-animate target
  493. // - It does not contain any auto-animate targets
  494. if( !element.hasAttribute( 'data-auto-animate-target' ) && !containsAnimatedElements ) {
  495. result.push( element );
  496. }
  497. if( element.querySelector( '[data-auto-animate-target]' ) ) {
  498. result = result.concat( this.getUnmatchedAutoAnimateElements( element ) );
  499. }
  500. return result;
  501. }, [] );
  502. }
  503. }