├── README.md ├── img ├── 0.png ├── 1.png ├── 2.png └── 3.png └── trilium- auto-hide-info-bar.js /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiriusXT/trilium-auto-hide-info-bar/5444cc9e316f59838ddd61ed3c269735df74929c/README.md -------------------------------------------------------------------------------- /img/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiriusXT/trilium-auto-hide-info-bar/5444cc9e316f59838ddd61ed3c269735df74929c/img/0.png -------------------------------------------------------------------------------- /img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiriusXT/trilium-auto-hide-info-bar/5444cc9e316f59838ddd61ed3c269735df74929c/img/1.png -------------------------------------------------------------------------------- /img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiriusXT/trilium-auto-hide-info-bar/5444cc9e316f59838ddd61ed3c269735df74929c/img/2.png -------------------------------------------------------------------------------- /img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SiriusXT/trilium-auto-hide-info-bar/5444cc9e316f59838ddd61ed3c269735df74929c/img/3.png -------------------------------------------------------------------------------- /trilium- auto-hide-info-bar.js: -------------------------------------------------------------------------------- 1 | /* 2 | trilium-auto-hide-info-bar 3 | Version:0.6 4 | https://github.com/SiriusXT/trilium-auto-hide-info-bar 5 | */ 6 | const hidden_title = true; //true:hidden false:display 7 | const hidden_ribbon = true; //true:hidden false:display 8 | const pin_ribbon_title = false; //hidden by default 9 | const delay_execution_time = 300 //The event that the mouse needs to stay when the mouse moves in, default:300ms 10 | 11 | // --------------------------------------------------------------------------- 12 | if (!hidden_title && !hidden_ribbon) return; 13 | let timeoutChange; 14 | let justLeaveSCup = false; // justLeaveSCup 15 | let styles = ` 16 | body.tahib-pin .ribbon-tab-title.ribbon-tab-pin .bxs-pin{ 17 | font-size: 130%; 18 | top: 5px; 19 | } 20 | body:not(.tahib-pin) .ribbon-tab-title.ribbon-tab-pin .bxs-pin{ 21 | font-size: 130%; 22 | top: 5px; 23 | color: transparent; 24 | -webkit-text-stroke: 1.5px var(--left-pane-text-color); 25 | }` 26 | if (hidden_title) { 27 | styles += `body.tahib-hidden:not(.tahib-pin) .title-row { 28 | display: none !important; 29 | }` 30 | } 31 | if (hidden_ribbon) { 32 | styles += `body.tahib-hidden:not(.tahib-pin) .ribbon-container { 33 | display: none !important; 34 | }` 35 | } 36 | 37 | let style = document.createElement('style'); 38 | style.innerHTML = styles; 39 | document.head.appendChild(style); 40 | 41 | function show() { 42 | clearTimeout(timeoutChange); 43 | timeoutChange = setTimeout(() => { 44 | document.body.classList.remove('tahib-hidden'); 45 | }, delay_execution_time); 46 | } 47 | 48 | function hidden() { 49 | if (hidden_title || hidden_ribbon) { 50 | clearTimeout(timeoutChange); 51 | timeoutChange = setTimeout(() => { 52 | document.body.classList.add('tahib-hidden'); 53 | }, delay_execution_time); 54 | } 55 | } 56 | function togglePin() { 57 | document.body.classList.toggle('tahib-pin'); 58 | } 59 | 60 | // Monitor tab bar 61 | let retries = 0; 62 | let interval = setInterval(() => { 63 | let $tabRowWidget = $('.tab-row-widget'); 64 | let $launcherPane = $('#launcher-pane'); 65 | let $leftPane = $('#left-pane'); 66 | if ($tabRowWidget.length > 0 && $launcherPane.length > 0 && $leftPane.length > 0) { 67 | clearInterval(interval); 68 | $tabRowWidget.add($launcherPane).add($leftPane).mouseenter((event) => { 69 | show(); 70 | }); 71 | if (pin_ribbon_title) { 72 | document.body.classList.add('tahib-pin'); 73 | } 74 | } else if (retries >= 100) { 75 | console.log('Element not found. Stopping attempts.'); 76 | clearInterval(interval); 77 | } 78 | retries++; 79 | }, 100); 80 | 81 | /*No action is taken when moving out of window*/ 82 | document.addEventListener('mouseleave', (event) => { 83 | if (!event.relatedTarget && !justLeaveSCup) { 84 | clearTimeout(timeoutChange); 85 | } 86 | }); 87 | 88 | const button = `