• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / 8737b902-28b0-43db-bccc-d31d123e8d89

pending completion
8737b902-28b0-43db-bccc-d31d123e8d89

Pull #2996

circleci

Florian Zia
chore: Add lib to .eslintignore
Pull Request #2996: MNTOR-1130: Animations preview

282 of 6859 branches covered (4.11%)

Branch coverage included in aggregate %.

28 of 28 new or added lines in 5 files covered. (100.0%)

959 of 4539 relevant lines covered (21.13%)

3.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/client/js/partials/animationPreview.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import '../../lib/lottie.min.js'
6

7
const animationPartial = document.querySelector("[data-partial='animationPreview']")
×
8
let animation
9

10
function handleOnComplete (loopEvent) {
11
  const { type } = loopEvent
×
12
  console.log(type, animation.isPaused)
×
13
}
14

15
function loadAnimation (filename) {
16
  const container = animationPartial.querySelector('.animation-canvas')
×
17
  if (!container) {
×
18
    return
×
19
  }
20

21
  if (animation) {
×
22
    animation.destroy()
×
23
  }
24

25
  animation = window.lottie.loadAnimation({
×
26
    autoplay: false,
27
    container,
28
    loop: true,
29
    path: `../../animations/${filename}`,
30
    renderer: 'svg'
31
  })
32
  animation.onComplete = handleOnComplete
×
33
}
34

35
function init () {
36
  const animationSelect = animationPartial.querySelector('custom-select')
×
37
  animationSelect.addEventListener('change', (event) => {
×
38
    loadAnimation(event.target.value)
×
39
  })
40
  loadAnimation(animationSelect.value)
×
41

42
  const button = animationPartial.querySelector('.animation-button')
×
43
  button.addEventListener('click', () => {
×
44
    if (animation.isPaused) {
×
45
      animation.play()
×
46
    } else {
47
      animation.pause()
×
48
    }
49
  })
50
}
51

52
const lottieIsAvailable = window && window.lottie
×
53
if (animationPartial && lottieIsAvailable) {
×
54
  init()
×
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc