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

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

<script src="../../js/components/css-transitions.js"></script>
<section id="css-transitions" 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.js' }}"></script>
/* No context defined. */
  • Content:
    (function () {
      document.addEventListener('DOMContentLoaded', function () {
        console.log("css-transitions active");
    
        const button = document.querySelector('#trigger');
        const box = document.querySelector('#box');
    
        button.addEventListener('click', function() {
          box.classList.toggle('active');
        })
      });
    })();
    
  • URL: /components/raw/css-transitions/css-transitions.js
  • Filesystem Path: components/01-basic/03-css-transitions/css-transitions.js
  • Size: 332 Bytes
  • Content:
    #css-transitions {
      .box {
        transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
    
        &.active {
          background-color: #ff00ff;
          color: #ffffff;
        }
      }
    }
    
  • URL: /components/raw/css-transitions/css-transitions.scss
  • Filesystem Path: components/01-basic/03-css-transitions/css-transitions.scss
  • Size: 186 Bytes
  • Handle: @css-transitions
  • Preview:
  • Filesystem Path: components/01-basic/03-css-transitions/css-transitions.hbs

No notes defined.