helpful
This commit is contained in:
1 parent
f746eaa220
commit
83731d9a83
4 files changed
+141
-35
No files matched your search
+55
-2
@@ -17,7 +17,8 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 100vh;
|
min-height: 100dvh;
|
||||||
|
box-sizing: border-box; /* Ensure padding is included in width/height */
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@@ -135,15 +136,19 @@ li a {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
|
/* max-height: 90dvh; Prevent card from exceeding viewport height */
|
||||||
|
overflow-y: auto; /* Scroll if content is too tall */
|
||||||
}
|
}
|
||||||
|
|
||||||
.card h2 {
|
.card h2 {
|
||||||
color: var(--secondary-color);
|
color: var(--secondary-color);
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
/* margin-bottom: 10px; Reduced margin */
|
||||||
|
/* font-size: 1.2rem; Slightly smaller title */
|
||||||
}
|
}
|
||||||
|
|
||||||
.card p {
|
.card p {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 15px; /* Reduced margin */
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,4 +173,52 @@ li a {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% endmacro %} {% macro qrcode_queue(queue_items) %} {% if queue_items %}
|
{% endmacro %} {% macro qrcode_queue(queue_items) %} {% if queue_items %}
|
||||||
<ol>
|
<ol class="queue-grid">
|
||||||
{% for item in queue_items %}
|
{% for item in queue_items %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ item }}" target="_blank" rel="noreferrer noopener">
|
<a href="{{ item }}" target="_blank" rel="noreferrer noopener">
|
||||||
@@ -33,14 +33,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<style>
|
|
||||||
/* it works ig */
|
|
||||||
& {
|
|
||||||
li:has(.qrcode) {
|
|
||||||
width: min-content;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</ol>
|
</ol>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/[email protected]/qrcode.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
+37
-6
@@ -4,23 +4,54 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Queue Reader</title>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% from 'macros.html' import magic_link %} {% if current_link %}
|
{% from 'macros.html' import magic_link %} {% if current_link %}
|
||||||
<p>{{ magic_link(current_link, current_link, "a") }}</p>
|
<div class="card">
|
||||||
<button id="b">skip/fw</button> {{ queue_length }}
|
<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>
|
<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 () => {
|
document.getElementById("b").addEventListener("click", async () => {
|
||||||
await fetch("/r", { method: "GET", redirect: "manual" });
|
await fetch("/r", { redirect: "manual" });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>no. go add some to <a href="/queuein">queuein</a></p>
|
<div class="card">
|
||||||
<button onclick="location.reload();">reload</button>
|
<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 %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+48
-18
@@ -4,34 +4,64 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Trail</title>
|
<title>Trail</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="{{ url_for('static', path='style.css') }}"
|
||||||
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% if queue_length > 0 %}
|
{% if queue_length > 0 %}
|
||||||
<p>
|
<div class="trail-container">
|
||||||
<a
|
<div class="trail-count">{{ queue_length }}</div>
|
||||||
href="{{ current_link }}"
|
<p>Items Left</p>
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer noopener"
|
<p
|
||||||
>{{ current_link }}</a
|
style="
|
||||||
|
max-width: 80%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
"
|
||||||
>
|
>
|
||||||
</p>
|
Next:
|
||||||
<p>{{ queue_length }} left: click the screen to do magic</p>
|
<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>
|
<script>
|
||||||
|
if (window.opener) {
|
||||||
|
console.log(/** @type {Window} */ (window.opener)); // hi hello hi
|
||||||
|
}
|
||||||
window.addEventListener("load", () => {
|
window.addEventListener("load", () => {
|
||||||
window.addEventListener("click", () => {
|
document.body.addEventListener("click", async (e) => {
|
||||||
window.open(window.location.href, "_blank");
|
if (e.target.tagName === "A") return;
|
||||||
history.replaceState(
|
|
||||||
null,
|
// do trix
|
||||||
"lol. lmao, even.",
|
await fetch("/r", { redirect: "manual" });
|
||||||
new URL("/r", window.location.href).href
|
|
||||||
);
|
// now this is the new updated
|
||||||
window.location.reload();
|
const newTab = window.open(window.location.href, "_blank");
|
||||||
|
|
||||||
|
// yo this is good no security error
|
||||||
|
window.location.replace("{{ current_link }}");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in new issue
Block a user