Get started with csshake CDN

MIT licensed

CSShake: Library for caching CSS animations/transitions in React.

Tags:
  • css
  • transitions
  • animations

Stable version

Copied!

How to start using csshake CDN


<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.cdnhub.io/csshake/1.7.0/csshake.min.css">
  <style>
    .box {
      width: 100px;
      height: 100px;
      background-color: #4caf50;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  </style>
</head>
<body>
  <button id="animate">Animate box</button>
  <div class="box" id="box"></div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      const box = document.getElementById('box');
      const button = document.getElementById('animate');

      button.addEventListener('click', () => {
        csshake.init(box, {
          class: 'cs-shake',
          duration: 1000,
          delay: 500,
          iterations: 3
        });
      });
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions