Files
qrcode-from-onetab/templates/trail.html
T
2025-12-17 22:09:07 +07:00

70 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Trail</title>
<link
rel="stylesheet"
href="{{ url_for('static', path='style.css') }}"
/>
</head>
<body>
{% if queue_length > 0 %}
<div class="trail-container">
<div class="trail-count">{{ queue_length }}</div>
<p>Items Left</p>
<p
style="
max-width: 80%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
Next:
<a
href="{{ current_link }}"
target="_blank"
rel="noreferrer noopener"
>{{ current_link }}</a
>
</p>
<div class="trail-hint">Tap anywhere to open & next</div>
</div>
<script>
if (window.opener) {
// new tab = window open no "noopener". this probs does exist
console.log(/** @type {Window} */ (window.opener)); // hi hello hi
}
window.addEventListener("load", () => {
document.body.addEventListener("click", async (e) => {
if (e.target.tagName === "A") return;
// do trix
await fetch("/r", { redirect: "manual" });
// now this is the new updated
const newTab = window.open(window.location.href, "_blank");
// yo this is good no security error
window.location.replace("{{ current_link }}");
});
});
</script>
{% else %}
<div class="card">
<h2>All Done!</h2>
<p>The queue is empty.</p>
<div class="actions">
<a href="/" class="btn">Home</a>
<a href="/queuein" class="btn">Add More</a>
</div>
</div>
{% endif %}
</body>
</html>