Add create-bookmarklet-url.sh

This commit is contained in:
2025-12-31 04:26:28 -08:00
parent 86ed1cf6d3
commit 1575e6db87

18
create-bookmarklet-url.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
# Create a bookmarklet URL that can be used to enable auto-scroll
JS_CODE='(function(){const c=Array.from(document.querySelectorAll("ha-card"));c.forEach(card=>{card.style.minHeight=window.innerHeight+"px";card.style.fontSize="2.5em";const content=card.querySelector(".card-content");if(content)content.style.fontSize="2em"});let i=0;setInterval(()=>{i=(i+1)%c.length;c[i].scrollIntoView({behavior:"smooth",block:"start"})},5000);window.scrollTo({top:0,behavior:"smooth"});console.log("Auto-scroll enabled: "+c.length+" cards")})();'
BOOKMARKLET_URL="javascript:$JS_CODE"
echo "Bookmarklet URL (copy this entire line):"
echo ""
echo "$BOOKMARKLET_URL"
echo ""
echo "To use:"
echo "1. Copy the URL above"
echo "2. In Firefox, create a new bookmark"
echo "3. Paste this as the URL"
echo "4. Click the bookmark when on the dashboard page"
echo ""
echo "Or, you can navigate directly to this URL while on the dashboard page"