26 lines
957 B
JavaScript
26 lines
957 B
JavaScript
window.blazorIosHeader = {
|
|
init: function () {
|
|
const largeTitleSection = document.querySelector('.large-title-section');
|
|
const largeTitle = document.querySelector('.large-title');
|
|
const centerTitle = document.querySelector('.center-title');
|
|
|
|
if (!largeTitleSection || !largeTitle || !centerTitle) return;
|
|
|
|
window.addEventListener('scroll', function () {
|
|
// Soglia simile a iOS: metà della sezione large title
|
|
const threshold = largeTitleSection.offsetHeight / 2;
|
|
if (window.scrollY > threshold) {
|
|
largeTitle.classList.add('hide');
|
|
centerTitle.classList.add('visible');
|
|
} else {
|
|
largeTitle.classList.remove('hide');
|
|
centerTitle.classList.remove('visible');
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
// Per compatibilità con il tuo GoBack Blazor
|
|
window.goBack = function () {
|
|
window.history.back();
|
|
} |