<section id="css-transitions-directional" class="animate-things-wrapper">
    <button id="trigger">Trigger</button>

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

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

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

<script src="{{ path '/js/components/css-transitions-directional.js' }}"></script>
/* No context defined. */
  • Content:
    (function () {
      document.addEventListener('DOMContentLoaded', function () {
        console.log("css-transitions-directional active");
    
        const button = document.querySelector('#trigger');
        const box = document.querySelector('#box');
    
        button.addEventListener('click', function() {
          box.classList.toggle('active');
        })
      });
    })();
    
  • URL: /components/raw/css-transitions-directional/css-transitions-directional.js
  • Filesystem Path: components/01-basic/09-css-transitions-directional/css-transitions-directional.js
  • Size: 344 Bytes
  • Content:
    #css-transitions-directional {
      // The transition is on the target state: transition quickly to active, slowly back to the start
    
      .box {
        transform: scale(1, 1) translate(0, 0) rotate(0);
        transition: transform 3s ease-out;
    
        &.active {
          transform: scale(2, 2) translate(0, 50%) rotate(45deg);
          transition: transform 0.05s ease-in;
        }
      }
    }
    
  • URL: /components/raw/css-transitions-directional/css-transitions-directional.scss
  • Filesystem Path: components/01-basic/09-css-transitions-directional/css-transitions-directional.scss
  • Size: 366 Bytes
  • Handle: @css-transitions-directional
  • Preview:
  • Filesystem Path: components/01-basic/09-css-transitions-directional/css-transitions-directional.hbs

No notes defined.