Compare commits

..

No commits in common. "94fed6db51a60b72ec4baebd953a2fe0b24109b2" and "4c786fbce9072670f6a68204e0b35075b05286d5" have entirely different histories.

2 changed files with 3 additions and 25 deletions

View File

@ -38,18 +38,6 @@
.chevron:hover { color: rgba(255, 255, 255, 0.9); }
.chevron.left { left: 10px; }
.chevron.right { right: 10px; }
.play-btn {
position: fixed;
bottom: 20px;
right: 20px;
font-size: 48px;
color: rgba(255, 255, 255, 0.7);
cursor: pointer;
text-decoration: none;
transition: color 0.2s, transform 0.2s;
padding: 10px;
}
.play-btn:hover { color: rgba(255, 255, 255, 1); transform: scale(1.1); }
</style>
</head>
<body>
@ -57,7 +45,6 @@
<a href="$image_click_url"><img id="img" src="$img_url" title="$filename"></a>
<a href="$prev_url" class="chevron left" id="prev-btn">&#8249;</a>
<a href="$next_url" class="chevron right" id="next-btn">&#8250;</a>
$play_button
</div>
<script>
function getRefreshParams() {

15
main.py
View File

@ -187,7 +187,7 @@ def _get_navigation_data(file_hash: str):
def _render_page(
navigation_data: dict, extra_meta: str = "", image_click_url: str = "", play_button: str = ""
navigation_data: dict, extra_meta: str = "", image_click_url: str = ""
) -> HTMLResponse:
"""Render the frontend page with navigation data"""
with open("frontend.html", "r") as f:
@ -202,7 +202,6 @@ def _render_page(
prev_url="/{prev_hash}".format(prev_hash=navigation_data["prev_hash"]),
filename=navigation_data["filename"],
extra_meta=extra_meta,
play_button=play_button,
)
return HTMLResponse(content=content)
@ -215,10 +214,7 @@ async def hash_page(file_hash: str):
raise HTTPException(status_code=404, detail="File not found")
navigation_data = _get_navigation_data(file_hash)
play_button = '<a href="/next/5/{file_hash}" class="play-btn" title="Play next 5">⏵</a>'.format(
file_hash=file_hash
)
return _render_page(navigation_data, play_button=play_button)
return _render_page(navigation_data)
@app.get("/{order}/{delay}/{file_hash}")
@ -244,12 +240,7 @@ async def hash_page_with_refresh(order: str, delay: int, file_hash: str):
refresh_meta = f'<meta http-equiv="refresh" content="{delay};url={refresh_url}">'
image_click_url = "/{file_hash}".format(file_hash=file_hash)
# Create pause button to stop auto-refresh
pause_button = '<a href="/{file_hash}" class="play-btn" title="Pause">⏸</a>'.format(
file_hash=file_hash
)
return _render_page(navigation_data, refresh_meta, image_click_url, play_button=pause_button)
return _render_page(navigation_data, refresh_meta, image_click_url)
def _find_indexer_for_hash(file_hash: str):