![]() |
Add non intrusive refresh button - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Support (https://forum.jellyfin.org/f-support) +--- Forum: Guides, Walkthroughs & Tutorials (https://forum.jellyfin.org/f-guides-walkthroughs-tutorials) +--- Thread: Add non intrusive refresh button (/t-add-non-intrusive-refresh-button) |
Add non intrusive refresh button - jakamy - 2025-07-28 my solution for truenas jellyfin app of a non intrusive refresh button. copy the files of jellyfin-web to the media folder subfolder temp (trunas permisison issues)
in index.html add this before the </style>: #custom-refresh-btn { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 99999; background: transparent; border: none; cursor: pointer; padding: 4px; opacity: 0.3; transition: opacity 0.3s ease; } #custom-refresh-btn:hover { opacity: 0.6; } and this before </body>: <script> document.addEventListener("DOMContentLoaded", function () { const refreshBtn = document.createElement("button"); refreshBtn.id = "custom-refresh-btn"; //refreshBtn.innerHTML = "🔄"; // replace with an image if preferred like bellow refreshBtn.innerHTML = '<img src="assets/img/refresh-transparent.png" alt="Refresh" style="width:32px;height:32px;">'; refreshBtn.title = "Refresh"; refreshBtn.onclick = function () { const baseUrl = location.origin + location.pathname; const uniqueParam = "?refresh=" + new Date().getTime(); location.href = baseUrl + uniqueParam; }; document.body.appendChild(refreshBtn); // Scroll detection logic let scrollTimeout; const showBtn = () => { refreshBtn.style.opacity = "0.5"; refreshBtn.style.pointerEvents = "auto"; }; const hideBtn = () => { refreshBtn.style.opacity = "0"; refreshBtn.style.pointerEvents = "none"; }; window.addEventListener("scroll", () => { showBtn(); clearTimeout(scrollTimeout); scrollTimeout = setTimeout(hideBtn, 2000); // stays visible for 2 seconds after scroll stops }); // Initially hidden hideBtn(); }); </script>
now it loads not showing, only when scrolling is done it shows for 2 seconds and fade off and on click refresh page its now clickable on lg tv and android app Cheers |