19 lines
936 B
Bash
19 lines
936 B
Bash
#!/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"
|