Files
Lakehouse/config/homepage/custom.js
T
2026-05-19 23:02:31 +02:00

56 lines
1.8 KiB
JavaScript

/* ATC Lakehouse — scanlines + noise + architecture link */
(function () {
var ARCH_URL = 'http://atc-docker01.dell-atc.lan:8080/docs/architecture.html';
function injectOverlays() {
if (!document.querySelector('.palantir-scanline')) {
var scan = document.createElement('div');
scan.className = 'palantir-scanline';
document.body.appendChild(scan);
}
if (!document.querySelector('.palantir-noise')) {
var noise = document.createElement('div');
noise.className = 'palantir-noise';
document.body.appendChild(noise);
}
}
function linkLakehouseTitle() {
document.querySelectorAll('header h1, header p, .greeting, [class*="greeting"]').forEach(function (el) {
if (el.dataset.atcLinked) return;
if (/lakehouse/i.test(el.textContent || '')) {
el.style.cursor = 'pointer';
el.title = 'Open architecture diagram';
el.addEventListener('click', function () {
window.open(ARCH_URL, '_blank');
});
el.dataset.atcLinked = '1';
}
});
}
function applyServiceColors() {
document.querySelectorAll('li.service').forEach(function (card) {
var desc = card.querySelector('.service-description');
var text = desc ? desc.textContent : '';
var link = card.querySelector('a[href^="http"]');
if (text.indexOf('Host:') >= 0 || text.indexOf('Port:') >= 0 || !link) {
card.classList.add('atc-db-tile');
}
});
}
function init() {
injectOverlays();
applyServiceColors();
linkLakehouseTitle();
new MutationObserver(linkLakehouseTitle).observe(document.body, { childList: true, subtree: true });
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();