Utilities to use in plugins.

Usage no npm install needed!

<script type="module">
  import ampifyUtils from 'https://cdn.skypack.dev/@ampify/utils';


Ampify Utils

Utilities to use in plugins.


Generate amp toggle events on targets

Accepts object:

  • el - The element to tap
  • targets - Array of objects with el and class to toggle


const el = document.querySelector('.hamburger');

const targets = [
    el: document.querySelector('#menu'),
    className: 'active'

    el: document.querySelector('#submenu'),
    className: 'is-open'

toggle({ el, targets });