Changes for page Tidy-Lab Cloud Platform
Last modified by Humphrey AI on 2026/03/22 10:27
From version 16.1
edited by Christian Wawrzinek
on 2026/03/18 15:44
on 2026/03/18 15:44
Change comment:
There is no comment for this version
To version 17.1
edited by Christian Wawrzinek
on 2026/03/18 15:49
on 2026/03/18 15:49
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- XWiki.JavaScriptExtension[0]
-
- code
-
... ... @@ -1,1 +1,81 @@ 1 -// Tidy-Lab Hero: full-page hero with chrome fadedocument.body.classList.add('tl-hero-page');(function() { var hero = document.querySelector('.tl-hero'); if (!hero) return; var chromeSelectors = [ '#menuview', '#headerglobal', '#hierarchy_breadcrumb', '.document-header', '#xdocFooter', '#xwikidata', '#footerglobal', '.skip-nav' ]; var chromeElements = []; chromeSelectors.forEach(function(sel) { var el = document.querySelector(sel); if (el) chromeElements.push(el); }); var wasFading = false; function onScroll() { var heroHeight = hero.offsetHeight; var scrollY = window.pageYOffset || document.documentElement.scrollTop; var fadeStart = heroHeight * 0.3; var fadeEnd = heroHeight * 0.7; var progress = 0; if (scrollY <= fadeStart) { progress = 0; } else if (scrollY >= fadeEnd) { progress = 1; } else { progress = (scrollY - fadeStart) / (fadeEnd - fadeStart); } if (progress > 0 && progress < 1) { if (!wasFading) { document.body.classList.add('tl-fading'); document.body.classList.remove('tl-scrolled'); wasFading = true; } chromeElements.forEach(function(el) { el.style.opacity = progress; }); } else if (progress >= 1) { document.body.classList.remove('tl-fading'); document.body.classList.add('tl-scrolled'); chromeElements.forEach(function(el) { el.style.opacity = ''; }); wasFading = false; } else { document.body.classList.remove('tl-fading'); document.body.classList.remove('tl-scrolled'); chromeElements.forEach(function(el) { el.style.opacity = ''; }); wasFading = false; } } window.addEventListener('scroll', onScroll, { passive: true }); onScroll(); var scrollLink = document.querySelector('.tl-hero-scroll'); var tlContent = document.getElementById('tl-content'); if (scrollLink) { scrollLink.addEventListener('click', function(e) { e.preventDefault(); if (tlContent) { tlContent.scrollIntoView({ behavior: 'smooth' }); } }); }})(); 1 + document.body.classList.add('tl-hero-page'); 2 + 3 + (function() { 4 + var hero = document.querySelector('.tl-hero'); 5 + if (!hero) return; 6 + 7 + // Collect all chrome elements to fade 8 + var chromeSelectors = [ 9 + '#menuview', '#headerglobal', '#hierarchy_breadcrumb', 10 + '.document-header', '#xdocFooter', '#xwikidata', 11 + '#footerglobal', '.skip-nav' 12 + ]; 13 + var chromeElements = []; 14 + chromeSelectors.forEach(function(sel) { 15 + var el = document.querySelector(sel); 16 + if (el) chromeElements.push(el); 17 + }); 18 + 19 + var wasFading = false; 20 + 21 + function onScroll() { 22 + var heroHeight = hero.offsetHeight; 23 + var scrollY = window.pageYOffset || document.documentElement.scrollTop; 24 + 25 + // Start fading at 30% scroll, fully visible at 70% 26 + var fadeStart = heroHeight * 0.3; 27 + var fadeEnd = heroHeight * 0.7; 28 + var progress = 0; 29 + 30 + if (scrollY <= fadeStart) { 31 + progress = 0; 32 + } else if (scrollY >= fadeEnd) { 33 + progress = 1; 34 + } else { 35 + progress = (scrollY - fadeStart) / (fadeEnd - fadeStart); 36 + } 37 + 38 + if (progress > 0 && progress < 1) { 39 + // Fading: switch from display:none to opacity-based 40 + if (!wasFading) { 41 + document.body.classList.add('tl-fading'); 42 + document.body.classList.remove('tl-scrolled'); 43 + wasFading = true; 44 + } 45 + chromeElements.forEach(function(el) { 46 + el.style.opacity = progress; 47 + }); 48 + } else if (progress >= 1) { 49 + // Fully scrolled: restore normal layout 50 + document.body.classList.remove('tl-fading'); 51 + document.body.classList.add('tl-scrolled'); 52 + chromeElements.forEach(function(el) { 53 + el.style.opacity = ''; 54 + }); 55 + wasFading = false; 56 + } else { 57 + // At top: hide everything 58 + document.body.classList.remove('tl-fading'); 59 + document.body.classList.remove('tl-scrolled'); 60 + chromeElements.forEach(function(el) { 61 + el.style.opacity = ''; 62 + }); 63 + wasFading = false; 64 + } 65 + } 66 + 67 + window.addEventListener('scroll', onScroll, { passive: true }); 68 + onScroll(); // run once on load 69 + 70 + // Smooth scroll for the arrow 71 + var scrollLink = document.querySelector('.tl-hero-scroll'); 72 + var tlContent = document.getElementById('tl-content'); 73 + if (scrollLink) { 74 + scrollLink.addEventListener('click', function(e) { 75 + e.preventDefault(); 76 + if (tlContent) { 77 + tlContent.scrollIntoView({ behavior: 'smooth' }); 78 + } 79 + }); 80 + } 81 + })();