;
});
}
function getBadge(page) {
var tier = page.tier || "";
if (tier.indexOf("Homepage") !== -1) return 'Home';
if (tier.indexOf("Revenue") !== -1) return 'Revenue';
if (tier.indexOf("New") !== -1) return 'New page';
if (tier.indexOf("Utility") !== -1) return 'Utility';
if (page.legacy) return 'Existing';
return 'New page';
}
// ─── SNAPSHOT CARD INTERACTION ────────────────────────────────
var snapButtons = document.querySelectorAll('.fn-snap');
var drawer = document.getElementById('fn-drawer');
var drawerTitle = document.getElementById('fn-drawer-title');
var drawerDesc = document.getElementById('fn-drawer-desc');
var drawerBody = document.getElementById('fn-drawer-body');
var activeSnap = null;
function openSnap(key) {
var snap = snapshots[key];
if (!snap) return;
if (activeSnap === key) {
window.fnCloseDrawer();
return;
}
activeSnap = key;
snapButtons.forEach(function(b) {
b.classList.toggle('active', b.getAttribute('data-snap') === key);
});
drawerTitle.textContent = snap.title;
drawerDesc.textContent = snap.desc;
var html = '';
snap.groups.forEach(function(group) {
html += '
';
html += '
' + escapeHTML(group.title) + '
';
group.pages.forEach(function(pageKey) {
var p = pages[pageKey];
if (!p) return;
html += '';
html += '
';
html += '
' + escapeHTML(p.h1) + '
';
html += '
' + escapeHTML(p.path) + '
';
html += '
';
html += getBadge(p);
html += '';
});
html += '
';
});
drawerBody.innerHTML = html;
drawer.classList.add('show');
// Wire up page-row clicks within the drawer
drawerBody.querySelectorAll('.fn-page-row').forEach(function(row) {
row.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation();
openPage(row.getAttribute('data-page'));
});
});
// Smooth scroll the drawer into view
setTimeout(function() {
drawer.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}, 50);
}
window.fnCloseDrawer = function() {
drawer.classList.remove('show');
snapButtons.forEach(function(b) { b.classList.remove('active'); });
activeSnap = null;
};
snapButtons.forEach(function(btn) {
btn.addEventListener('click', function() {
openSnap(btn.getAttribute('data-snap'));
});
});
// ─── MEGA MENU SWAP ───────────────────────────────────────────
var items = document.querySelectorAll('.fn-nav-item');
var menus = document.querySelectorAll('.fn-mega');
items.forEach(function(item) {
item.addEventListener('mouseenter', function() {
var key = item.getAttribute('data-menu');
items.forEach(function(i) { i.classList.remove('active'); });
item.classList.add('active');
menus.forEach(function(m) { m.classList.remove('show'); });
var target = document.getElementById('fn-mega-' + key);
if (target) target.classList.add('show');
});
});
// ─── PAGE DETAIL MODAL ────────────────────────────────────────
var backdrop = document.getElementById('fn-modal-bg');
var modalContent = document.getElementById('fn-modal-content');
function openPage(key) {
var p = pages[key];
if (!p) return;
var titleLen = p.title.length;
var h1Len = p.h1.length;
var titleCls = titleLen > 60 ? 'warn' : (titleLen >= 40 ? 'ok' : '');
var legacyHTML;
if (p.legacy) {
legacyHTML = '' + escapeHTML(p.legacy) + ' ';
} else {
legacyHTML = 'No legacy page — new content required';
}
modalContent.innerHTML =
'
' +
'
' +
'
' + escapeHTML(p.tier) + '
' +
'
' + escapeHTML(p.h1) + '
' +
'
' +
'' +
'
' +
'
' +
'
New URL path Copy
' +
'
' + escapeHTML(p.path) + '
' +
'
' +
'
' +
'
Legacy page reference
' +
'
' + legacyHTML + '
' +
'
' +
'
' +
'
Meta title ' + titleLen + ' chars
' +
'
' + escapeHTML(p.title) + '
' +
'
' +
'
' +
'
H1 heading ' + h1Len + ' chars
' +
'
' + escapeHTML(p.h1) + '
' +
'
';
backdrop.classList.add('show');
document.body.style.overflow = 'hidden';
}
window.fnCloseModal = function() {
backdrop.classList.remove('show');
document.body.style.overflow = '';
};
window.fnCopy = function(val, btn) {
if (navigator.clipboard) navigator.clipboard.writeText(val);
var orig = btn.innerText;
btn.innerText = 'Copied';
setTimeout(function() { btn.innerText = orig; }, 1200);
};
backdrop.addEventListener('click', function(e) { if (e.target === backdrop) window.fnCloseModal(); });
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
window.fnCloseModal();
window.fnCloseDrawer();
}
});
document.querySelectorAll('[data-page]').forEach(function(el) {
el.addEventListener('click', function(e) {
// Skip page-row buttons inside the drawer (they have their own handler)
if (el.classList.contains('fn-page-row')) return;
e.preventDefault();
e.stopPropagation();
openPage(el.getAttribute('data-page'));
});
});
})();
👋 Hello! I'm the Naples Airport AI Assistant, an automated service—not a live employee. I answer questions using approved Naples Airport information. How can I help you today?
Powered by Microsoft
AI responses may not always be accurate. Verify important information using the cited source.