tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

clip-path-animation-set-effect.html (1049B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <link rel="help" href="https://drafts.csswg.org/css-shapes-1/#basic-shape-interpolation">
      4 <link rel="match" href="clip-path-animation-ref.html">
      5 <style>
      6  .container {
      7    width: 100px;
      8    height: 100px;
      9    background-color: green;
     10    animation: clippath 10s steps(2, jump-end);
     11  }
     12 
     13  @keyframes clippath {
     14    0% {
     15      clip-path: inset(10% 10%);
     16    }
     17 
     18    100% {
     19      clip-path: inset(40% 40%);
     20    }
     21  }
     22 </style>
     23 <script src="/common/reftest-wait.js"></script>
     24 <script src="/web-animations/resources/timing-utils.js"></script>
     25 
     26 <body>
     27  <div class="container">
     28  </div>
     29 
     30  <script>
     31    let animation = document.getAnimations()[0];
     32    animation.ready.then(() => {
     33      animation.effect = new KeyframeEffect(animation.effect.target, [
     34        { clipPath: 'circle(35% at 35% 35%)' },
     35        { clipPath: 'circle(50% at 50% 50%)' }
     36      ], {
     37        duration: 10000,
     38        easing: 'steps(2, jump-end)'
     39      });
     40      requestAnimationFrame(takeScreenshot);
     41    });
     42  </script>
     43 </body>
     44 
     45 </html>