summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/animation/test/doc_custom_playback_rate.html
blob: 9adee9988476c01623d33da61a7fe982145e2137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <style>
    div {
      background-color: lime;
      height: 100px;
    }
    </style>
  </head>
  <body>
    <script>
    "use strict";

    const duration = 100000;

    function createAnimation(cls) {
      const div = document.createElement("div");
      div.classList.add(cls);
      document.body.appendChild(div);
      const animation = div.animate([{ opacity: 0 }], duration);
      animation.playbackRate = 1.5;
    }

    createAnimation("div1");
    createAnimation("div2");
    </script>
  </body>
</html>