@aw-webflow/workflow-automation 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/script.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aw-webflow/workflow-automation",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "start": "parcel script.js",
package/script.js CHANGED
@@ -662,7 +662,7 @@
662
662
  var st = document.createElement('style'); st.textContent = HERO_CSS; document.head.appendChild(st);
663
663
  el.innerHTML = HERO_SVG;
664
664
  /* shortcut: phones get a side-scrolling graphic (text stays readable), decided once at load, no resize handling */
665
- if (window.innerWidth <= 700) { el.style.overflowX = 'auto'; el.firstChild.style.minWidth = '760px'; }
665
+ if (window.innerWidth <= 700) { el.style.overflowX = 'auto'; el.querySelector('svg').style.minWidth = '760px'; }
666
666
  var nodes = $$(el, '[data-step]'), run = false, timers = [];
667
667
  function set(n) { for (var i = 0; i < nodes.length; i++) if (+nodes[i].getAttribute('data-step') <= n) nodes[i].classList.add('on'); }
668
668
  function clear() { for (var i = 0; i < nodes.length; i++) nodes[i].classList.remove('on'); }
@@ -679,8 +679,14 @@
679
679
  function initActBar() {
680
680
  var starts = document.querySelectorAll('[data-actstart]'), links = document.querySelectorAll('[data-act]');
681
681
  if (!starts.length || !links.length) return;
682
- var cur = 0;
682
+ var cur = 0, bar = document.querySelector('[data-actbar]');
683
+ /* stick right under whichever site nav is showing (desktop 61-109px, mobile 74px) */
684
+ function pos() {
685
+ var n = document.querySelector('.nav_latest'), m = document.querySelector('.mob_nav_latest');
686
+ if (bar) bar.style.top = ((n && n.offsetHeight) || (m && m.offsetHeight) || 61) + 'px';
687
+ }
683
688
  function upd() {
689
+ pos();
684
690
  var y = window.innerHeight * 0.4, a = 1, i;
685
691
  for (i = 0; i < starts.length; i++) if (starts[i].getBoundingClientRect().top <= y) a = +starts[i].getAttribute('data-actstart');
686
692
  if (a === cur) return;