redisgn
This commit is contained in:
@@ -41,6 +41,38 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
initSmoothScrolling();
|
||||
|
||||
// ==========================================
|
||||
// 1.5. BUTTON NAVIGATION TO DEMO SECTION
|
||||
// ==========================================
|
||||
|
||||
function initButtonNavigation() {
|
||||
const kiPhoneBtn = document.getElementById('kiPhoneBtn');
|
||||
const chatBtn = document.getElementById('chatBtn');
|
||||
const demoSection = document.getElementById('demo-section');
|
||||
|
||||
if (demoSection) {
|
||||
const scrollToDemo = () => {
|
||||
const header = document.querySelector('.top-banner');
|
||||
const headerHeight = header ? header.offsetHeight : 90;
|
||||
|
||||
window.scrollTo({
|
||||
top: demoSection.offsetTop - headerHeight - 20,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
};
|
||||
|
||||
if (kiPhoneBtn) {
|
||||
kiPhoneBtn.addEventListener('click', scrollToDemo);
|
||||
}
|
||||
|
||||
if (chatBtn) {
|
||||
chatBtn.addEventListener('click', scrollToDemo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
initButtonNavigation();
|
||||
|
||||
// ==========================================
|
||||
// 2. MENU TOGGLE
|
||||
// ==========================================
|
||||
|
||||
Reference in New Issue
Block a user