helpful
This commit is contained in:
1 parent
f746eaa220
commit
83731d9a83
4 files changed
+141
-35
No files matched your search
@@ -24,7 +24,7 @@
|
||||
})();
|
||||
</script>
|
||||
{% endmacro %} {% macro qrcode_queue(queue_items) %} {% if queue_items %}
|
||||
<ol>
|
||||
<ol class="queue-grid">
|
||||
{% for item in queue_items %}
|
||||
<li>
|
||||
<a href="{{ item }}" target="_blank" rel="noreferrer noopener">
|
||||
@@ -33,14 +33,6 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<style>
|
||||
/* it works ig */
|
||||
& {
|
||||
li:has(.qrcode) {
|
||||
width: min-content;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</ol>
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
||||
<script>
|
||||
|
||||
+37
-6
@@ -4,23 +4,54 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Queue Reader</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', path='style.css') }}"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
{% from 'macros.html' import magic_link %} {% if current_link %}
|
||||
<p>{{ magic_link(current_link, current_link, "a") }}</p>
|
||||
<button id="b">skip/fw</button> {{ queue_length }}
|
||||
<div class="card">
|
||||
<h2>Current Link</h2>
|
||||
<p>{{ magic_link(current_link, current_link, "a") }}</p>
|
||||
|
||||
<div class="qrcode" id="current-qr"></div>
|
||||
|
||||
<div class="actions" style="margin-top: 20px">
|
||||
<button id="b" class="btn">Skip / Next</button>
|
||||
</div>
|
||||
<p style="margin-top: 10px; font-size: 0.8rem; color: #666">
|
||||
{{ queue_length }} items remaining
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
||||
<script>
|
||||
// QR Code generation
|
||||
new QRCode(document.getElementById("current-qr"), {
|
||||
text: "{{ current_link }}",
|
||||
correctLevel: QRCode.CorrectLevel.L,
|
||||
width: 256,
|
||||
height: 256,
|
||||
});
|
||||
|
||||
// Skip button logic
|
||||
document.getElementById("b").addEventListener("click", async () => {
|
||||
await fetch("/r", { method: "GET", redirect: "manual" });
|
||||
await fetch("/r", { redirect: "manual" });
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% else %}
|
||||
<p>no. go add some to <a href="/queuein">queuein</a></p>
|
||||
<button onclick="location.reload();">reload</button>
|
||||
<div class="card">
|
||||
<h2>Queue Empty</h2>
|
||||
<p>No links in the queue. Go add some!</p>
|
||||
<div class="actions">
|
||||
<a href="/queuein" class="btn">Add Links</a>
|
||||
<button onclick="location.reload();" class="btn">Reload</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
+48
-18
@@ -4,34 +4,64 @@
|
||||
<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') }}">
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ url_for('static', path='style.css') }}"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
{% if queue_length > 0 %}
|
||||
<p>
|
||||
<a
|
||||
href="{{ current_link }}"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>{{ current_link }}</a
|
||||
<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;
|
||||
"
|
||||
>
|
||||
</p>
|
||||
<p>{{ queue_length }} left: click the screen to do magic</p>
|
||||
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) {
|
||||
console.log(/** @type {Window} */ (window.opener)); // hi hello hi
|
||||
}
|
||||
window.addEventListener("load", () => {
|
||||
window.addEventListener("click", () => {
|
||||
window.open(window.location.href, "_blank");
|
||||
history.replaceState(
|
||||
null,
|
||||
"lol. lmao, even.",
|
||||
new URL("/r", window.location.href).href
|
||||
);
|
||||
window.location.reload();
|
||||
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 %}
|
||||
<a href="/queuein">add some to queuein lil guy</a>
|
||||
<div class="card">
|
||||
<h2>All Done!</h2>
|
||||
<p>The queue is empty.</p>
|
||||
<div class="actions">
|
||||
<a href="/queuein" class="btn">Add More</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user