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

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

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

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

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

No notes defined.