This commit is contained in:
lda committed 2025-12-17 21:48:28 +07:00
1 parent f746eaa220
commit 83731d9a83
4 files changed
+134 -28

No files matched your search

+55 -2
View File
@@ -17,7 +17,8 @@ body {
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
min-height: 100dvh;
box-sizing: border-box; /* Ensure padding is included in width/height */
}
a {
@@ -135,15 +136,19 @@ li a {
align-items: center;
text-align: center;
border: 1px solid #333;
/* max-height: 90dvh; Prevent card from exceeding viewport height */
overflow-y: auto; /* Scroll if content is too tall */
}
.card h2 {
color: var(--secondary-color);
margin-top: 0;
/* margin-bottom: 10px; Reduced margin */
/* font-size: 1.2rem; Slightly smaller title */
}
.card p {
margin-bottom: 20px;
margin-bottom: 15px; /* Reduced margin */
color: #aaa;
}
@@ -168,4 +173,52 @@ li a {
display: flex;
justify-content: space-between;
align-items: center;
font-family: monospace;
}
/* Queue Grid */
.queue-grid {
display: flex;
flex-wrap: wrap;
gap: 20px;
justify-content: center;
width: 100%;
}
.queue-grid li {
flex: 1 1 300px; /* Grow, shrink, basis */
max-width: 400px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.queue-grid li a {
align-items: center;
word-break: break-word;
}
/* Trail Page */
.trail-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 80dvh;
width: 100%;
cursor: pointer;
text-align: center;
}
.trail-count {
font-size: 5rem;
font-weight: bold;
color: var(--secondary-color);
}
.trail-hint {
color: #666;
margin-top: 20px;
}
+1 -9
View File
@@ -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>
+36 -5
View File
@@ -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 %}
<div class="card">
<h2>Current Link</h2>
<p>{{ magic_link(current_link, current_link, "a") }}</p>
<button id="b">skip/fw</button> {{ queue_length }}
<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>
+42 -12
View File
@@ -4,11 +4,26 @@
<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>
<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"
@@ -16,22 +31,37 @@
>{{ current_link }}</a
>
</p>
<p>{{ queue_length }} left: click the screen to do magic</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>