Skip to content

Commit a6d4028

Browse files
committed
removed webflow dependencies
1 parent ea58173 commit a6d4028

4 files changed

Lines changed: 166 additions & 3 deletions

File tree

footer-template.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,8 @@
232232
</div>
233233
</div>
234234
<script crossorigin="anonymous" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" src="https://d3e54v103j8qbb.cloudfront.net/js/jquery-3.5.1.min.dc5e7f18c8.js?site=63eb258eae57fdd13c41eaff" type="text/javascript"></script>
235-
<script src="https://cdn.prod.website-files.com/63eb258eae57fdd13c41eaff/js/webflow.schunk.a6a60ac13672b1dc.js" type="text/javascript"></script>
236-
<script src="https://cdn.prod.website-files.com/63eb258eae57fdd13c41eaff/js/webflow.schunk.1bc4bbd4a129fb4e.js" type="text/javascript"></script>
237-
<script src="https://cdn.prod.website-files.com/63eb258eae57fdd13c41eaff/js/webflow.5279aa03.369237e3b9f7c4c5.js" type="text/javascript"></script>
235+
<!-- Webflow JS replaced with lightweight custom script -->
236+
<script src="scripts/webflow-replacement.js" type="text/javascript"></script>
238237
<!-- Google Tag Manager (noscript) -->
239238
<noscript>
240239
<iframe height="0" src="https://www.googletagmanager.com/ns.html?id=GTM-T2VR79F" style="display:none;visibility:hidden" width="0"></iframe>

scripts/load-footer.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,41 @@
184184

185185
// Trigger a custom event when footer is loaded
186186
document.dispatchEvent(new CustomEvent('footerLoaded'));
187+
188+
// Load Webflow replacement script
189+
loadWebflowReplacement();
190+
}
191+
192+
// Load the Webflow replacement script dynamically
193+
function loadWebflowReplacement() {
194+
// Check if script already loaded
195+
if (document.querySelector('script[src*="webflow-replacement"]')) {
196+
return;
197+
}
198+
199+
// Calculate path to scripts directory
200+
const scripts = document.getElementsByTagName('script');
201+
let scriptPath = 'scripts/';
202+
203+
for (let script of scripts) {
204+
const src = script.getAttribute('src');
205+
if (src && src.includes('load-footer.js')) {
206+
scriptPath = src.replace('load-footer.js', '');
207+
break;
208+
}
209+
}
210+
211+
// Load the replacement script
212+
const script = document.createElement('script');
213+
script.src = scriptPath + 'webflow-replacement.js';
214+
script.type = 'text/javascript';
215+
script.onload = function() {
216+
console.log('[Footer] Webflow replacement script loaded');
217+
};
218+
script.onerror = function() {
219+
console.error('[Footer] Failed to load webflow-replacement.js');
220+
};
221+
document.body.appendChild(script);
187222
}
188223

189224
// Load footer when DOM is ready

scripts/webflow-replacement.js

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/**
2+
* Lightweight Webflow Replacement Script
3+
* Replaces Webflow animations and interactions with vanilla JS
4+
* Total size: ~2KB unminified
5+
*/
6+
7+
(function() {
8+
'use strict';
9+
10+
// ===== FADE-IN ANIMATIONS =====
11+
// Replaces Webflow's data-w-id fade-in effects
12+
13+
const fadeInElements = document.querySelectorAll('[data-w-id][style*="opacity:0"], [data-w-id][style*="opacity: 0"]');
14+
15+
if (fadeInElements.length > 0 && 'IntersectionObserver' in window) {
16+
const fadeInObserver = new IntersectionObserver((entries) => {
17+
entries.forEach(entry => {
18+
if (entry.isIntersecting) {
19+
const element = entry.target;
20+
21+
// Add fade-in animation
22+
element.style.transition = 'opacity 0.6s ease-out, transform 0.6s ease-out';
23+
element.style.opacity = '1';
24+
element.style.transform = 'translateY(0)';
25+
26+
// Unobserve after animation
27+
fadeInObserver.unobserve(element);
28+
}
29+
});
30+
}, {
31+
threshold: 0.1,
32+
rootMargin: '0px 0px -50px 0px'
33+
});
34+
35+
fadeInElements.forEach(element => {
36+
// Set initial state
37+
element.style.opacity = '0';
38+
element.style.transform = 'translateY(20px)';
39+
fadeInObserver.observe(element);
40+
});
41+
} else if (fadeInElements.length > 0) {
42+
// Fallback for browsers without IntersectionObserver
43+
fadeInElements.forEach(element => {
44+
element.style.opacity = '1';
45+
});
46+
}
47+
48+
// ===== MODAL/POPUP CLOSE HANDLERS =====
49+
// Replaces Webflow's close button functionality
50+
51+
document.addEventListener('click', (e) => {
52+
const closeButton = e.target.closest('.close-pop-up, [data-w-id*="close"]');
53+
if (closeButton) {
54+
e.preventDefault();
55+
56+
// Find the closest modal/popup container
57+
const modal = closeButton.closest('.modal, .popup, [class*="pop-up"]');
58+
if (modal) {
59+
modal.style.transition = 'opacity 0.3s ease-out';
60+
modal.style.opacity = '0';
61+
62+
setTimeout(() => {
63+
modal.style.display = 'none';
64+
}, 300);
65+
}
66+
}
67+
});
68+
69+
// ===== SCROLL-TRIGGERED ANIMATIONS =====
70+
// Additional animations for elements that should animate on scroll
71+
72+
const scrollElements = document.querySelectorAll('.section[data-w-id]');
73+
74+
if (scrollElements.length > 0 && 'IntersectionObserver' in window) {
75+
const scrollObserver = new IntersectionObserver((entries) => {
76+
entries.forEach(entry => {
77+
if (entry.isIntersecting) {
78+
entry.target.classList.add('is-visible');
79+
scrollObserver.unobserve(entry.target);
80+
}
81+
});
82+
}, {
83+
threshold: 0.1,
84+
rootMargin: '0px 0px -100px 0px'
85+
});
86+
87+
scrollElements.forEach(element => {
88+
scrollObserver.observe(element);
89+
});
90+
}
91+
92+
// ===== UTILITY: Remove unused Webflow attributes =====
93+
// Clean up data-wf-* attributes that were used by Webflow CMS
94+
95+
function cleanupWebflowAttributes() {
96+
const webflowAttrs = ['data-wf-page', 'data-wf-site', 'data-wf-domain', 'data-wf-collection', 'data-wf-item-slug'];
97+
98+
webflowAttrs.forEach(attr => {
99+
const elements = document.querySelectorAll(`[${attr}]`);
100+
elements.forEach(el => {
101+
// Keep for reference but these don't affect functionality
102+
// Uncomment to remove: el.removeAttribute(attr);
103+
});
104+
});
105+
}
106+
107+
// Run cleanup on load
108+
if (document.readyState === 'loading') {
109+
document.addEventListener('DOMContentLoaded', cleanupWebflowAttributes);
110+
} else {
111+
cleanupWebflowAttributes();
112+
}
113+
114+
// ===== DEBUG INFO =====
115+
console.log('[Webflow Replacement] Initialized');
116+
console.log(` - Fade-in elements: ${fadeInElements.length}`);
117+
console.log(` - Scroll elements: ${scrollElements.length}`);
118+
console.log(' - Modal close handlers: active');
119+
120+
})();

styles/custom-nav.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,12 @@
4343

4444
/* Hide stray navigation elements */
4545
.nav-icon-line { display: block !important; }
46+
47+
/* Webflow replacement animations */
48+
.section[data-w-id].is-visible {
49+
opacity: 1 !important;
50+
transform: translateY(0) !important;
51+
}
52+
[data-w-id] {
53+
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
54+
}

0 commit comments

Comments
 (0)