<section id="transform-rotate" class="animate-things-wrapper">
    <button id="trigger">Trigger</button>

    <div id="box" class="box">
        Hi there
    </div>
</section>

<script src="../../js/components/transform-rotate.js"></script>
<section id="transform-rotate" class="animate-things-wrapper">
    <button id="trigger">Trigger</button>

    <div id="box" class="box">
        Hi there
    </div>
</section>

<script src="{{ path '/js/components/transform-rotate.js' }}"></script>
/* No context defined. */
  • Content:
    (function () {
      document.addEventListener('DOMContentLoaded', function () {
        console.log("transform-rotate active");
    
        const button = document.querySelector('#trigger');
        const box = document.querySelector('#box');
    
        button.addEventListener('click', function() {
          box.classList.toggle('active');
        })
      });
    })();
    
  • URL: /components/raw/transform-rotate/transform-rotate.js
  • Filesystem Path: components/01-basic/06-transform-rotate/transform-rotate.js
  • Size: 333 Bytes
  • Content:
    #transform-rotate {
      .box {
        transform: rotate(0);
        transition: transform 2s ease-in-out;
    
        &.active {
          transform: rotate(360deg);
        }
      }
    }
    
  • URL: /components/raw/transform-rotate/transform-rotate.scss
  • Filesystem Path: components/01-basic/06-transform-rotate/transform-rotate.scss
  • Size: 158 Bytes
  • Handle: @transform-rotate
  • Preview:
  • Filesystem Path: components/01-basic/06-transform-rotate/transform-rotate.hbs

No notes defined.