fix(v3): Replay-Button links neben Streamlit-Menue statt darueber
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
c2b2589dd0
commit
d217893dcb
|
|
@ -58,7 +58,7 @@ def render_intro_overlay(fallback_ms: int = INTRO_FALLBACK_MS,
|
|||
}}
|
||||
#eir-skip:hover {{ background: rgba(0,0,0,0.7); }}
|
||||
#eir-replay {{
|
||||
position: fixed; top: 12px; right: 14px; z-index: 2147483647;
|
||||
position: fixed; top: 12px; right: 72px; z-index: 2147483647;
|
||||
width: 40px; height: 40px; border-radius: 50%;
|
||||
display: flex; align-items: center; justify-content: center; cursor: pointer;
|
||||
background: #17171a; border: 1px solid rgba(245,126,26,0.55);
|
||||
|
|
@ -75,6 +75,22 @@ def render_intro_overlay(fallback_ms: int = INTRO_FALLBACK_MS,
|
|||
replay.innerHTML = '<svg viewBox="0 0 24 24" fill="#F57E1A"><path d="M8 5v14l11-7z"/></svg>';
|
||||
doc.body.appendChild(replay);
|
||||
|
||||
// Den ▶-Button links NEBEN Streamlits Menue-Leiste (oben rechts) platzieren, statt darueber.
|
||||
// Die Toolbar (Deploy + ⋮-Menue) rendert asynchron -> mehrfach nachjustieren + bei Resize.
|
||||
function positionReplay() {{
|
||||
var win = window.parent, gap = 12, fallback = 72;
|
||||
var tb = doc.querySelector('[data-testid="stToolbar"]');
|
||||
var rightPx = fallback;
|
||||
if (tb) {{
|
||||
var cluster = win.innerWidth - tb.getBoundingClientRect().left; // Breite des Menue-Clusters
|
||||
if (cluster > 8 && cluster < win.innerWidth * 0.6) rightPx = Math.round(cluster) + gap;
|
||||
}}
|
||||
replay.style.right = rightPx + 'px';
|
||||
}}
|
||||
positionReplay();
|
||||
[150, 500, 1200].forEach(function(t) {{ setTimeout(positionReplay, t); }});
|
||||
window.parent.addEventListener('resize', positionReplay);
|
||||
|
||||
var backdrop = doc.createElement('div');
|
||||
backdrop.id = 'eir-backdrop';
|
||||
backdrop.innerHTML =
|
||||
|
|
|
|||
Loading…
Reference in New Issue