@hortonstudio/main 1.6.1 → 1.6.2

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.
@@ -1,15 +1,11 @@
1
1
  // Page Transition Module
2
2
  const API_NAME = "hsmain";
3
- let initialized = false;
4
3
 
5
4
  export async function init() {
6
- console.log('[Transition] Module init called');
7
5
 
8
6
  // Wait for Webflow to be ready before initializing transitions
9
7
  window[API_NAME].afterWebflowReady(() => {
10
- console.log('[Transition] afterWebflowReady callback fired');
11
8
  setTimeout(() => {
12
- console.log('[Transition] Attempting to initialize transitions');
13
9
  initTransitions();
14
10
  initialized = true;
15
11
  }, 50);
@@ -19,11 +15,8 @@ export async function init() {
19
15
  }
20
16
 
21
17
  function initTransitions() {
22
- console.log('[Transition] initTransitions called');
23
18
  const transitionTrigger = document.querySelector(".transition-trigger");
24
19
  const transitionElement = document.querySelector(".transition");
25
- console.log('[Transition] transitionTrigger found:', transitionTrigger);
26
- console.log('[Transition] transitionElement found:', transitionElement);
27
20
 
28
21
  let excludedClass = "no-transition";
29
22
 
@@ -34,19 +27,14 @@ function initTransitions() {
34
27
  const delayAttr = transitionElement?.getAttribute('data-hs-delay');
35
28
  const delaySeconds = delayAttr ? parseFloat(delayAttr) : 0;
36
29
 
37
- console.log('[Transition] First load:', isFirstLoad);
38
- console.log('[Transition] Delay attribute:', delayAttr);
39
- console.log('[Transition] Delay seconds:', delaySeconds);
40
30
 
41
31
  const triggerAnimation = () => {
42
- console.log('[Transition] Triggering page load transition');
43
32
  Webflow.push(function () {
44
33
  transitionTrigger.click();
45
34
  });
46
35
  };
47
36
 
48
37
  if (isFirstLoad && delaySeconds > 0) {
49
- console.log(`[Transition] Delaying first load by ${delaySeconds} seconds`);
50
38
  setTimeout(triggerAnimation, delaySeconds * 1000);
51
39
  sessionStorage.setItem('transition-loaded', 'true');
52
40
  } else {
@@ -63,7 +51,6 @@ function initTransitions() {
63
51
 
64
52
  const checkComplete = () => {
65
53
  if (transitionElement.classList.contains('transition-done')) {
66
- console.log('[Transition] Animation complete detected');
67
54
  callback();
68
55
  } else {
69
56
  setTimeout(checkComplete, 50);
@@ -73,7 +60,6 @@ function initTransitions() {
73
60
  }
74
61
 
75
62
  // On Link Click
76
- console.log('[Transition] Setting up click handler');
77
63
  document.addEventListener("click", function (e) {
78
64
  const link = e.target.closest("a");
79
65
 
@@ -86,7 +72,6 @@ function initTransitions() {
86
72
  link.getAttribute("target") !== "_blank" &&
87
73
  transitionTrigger
88
74
  ) {
89
- console.log('[Transition] Triggering exit transition to:', link.getAttribute("href"));
90
75
  e.preventDefault();
91
76
 
92
77
  let transitionURL = link.getAttribute("href");
@@ -96,7 +81,6 @@ function initTransitions() {
96
81
 
97
82
  // Wait for animation to complete before navigating
98
83
  waitForTransitionComplete(() => {
99
- console.log('[Transition] Navigating to:', transitionURL);
100
84
  window.location = transitionURL;
101
85
  });
102
86
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version:1.6.1
1
+ // Version:1.6.2
2
2
 
3
3
  const API_NAME = "hsmain";
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",