This commit is contained in:
Waylon Walker 2025-11-22 21:53:03 -06:00
parent 8631733274
commit bba62e3527
18 changed files with 916 additions and 11 deletions

0
uuid/favicon.ico → b64/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

213
b64/index.html Normal file
View file

@ -0,0 +1,213 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Base64</title>
<meta property="og:title" content="Base64" />
<meta property="og:image" content="http://shots.wayl.one/shot/?url=https://b64.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=630&selectors=" />
<meta property="og:description" content="It's just a Base64, thats it, thats all it needs to do, it generates, displays and copies the Base64" />
<meta property="og:url" content="https://b64.wayl.one/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Base64" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Base64" />
<meta name="twitter:description" content="It's just a Base64, thats it, thats all it needs to do, it generates, displays and copies the Base64" />
<meta name="twitter:image" content="http://shots.wayl.one/shot/?url=https://b64.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=640&selectors=" />
<style>
body {
background: black;
color: lime;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
font-size: 4rem;
line-height: 1.2;
}
#b64 {
min-width: 100vw;
min-height: 5rem;
max-width: 100vw;
list-style: none;
padding: 0;
margin: 0;
font-size: 6rem;
margin-top: 1rem;
color: lime;
word-break: break-all;
}
/* Modal styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
box-shadow: 0 0 3rem 1rem #00ff0017;
background: black;
border: 2px solid lime;
border-radius: 0.5rem;
padding: 2rem;
max-width: 90%;
color: lime;
text-align: left;
font-size: 1.5rem;
}
.modal h2 {
margin-top: 0;
color: #008e00;
}
.modal ul {
color: #00ae00;
}
</style>
</head>
<body>
<div class="container">
<div id="b64" contenteditable="true"></div>
</div>
<!-- Modal -->
<div id="modal-overlay" class="modal-overlay">
<div class="modal">
<h2>Help</h2>
<p>
It's just a Base64, thats it, thats all it needs to do, it generates,
displays and copies the Base64. Start typing or paste your input, escape
and press <code>e</code> to encode, or <code>d</code> to decode.
</p>
<ul>
<li>
Paste values in with <kbd>Ctrl</kbd> + <kbd>v</kbd>
</li>
<li>
Copy with <kbd>Ctrl</kbd> + <kbd>c</kbd>
</li>
<li>
Decode with <kbd>d</kbd>
</li>
<li>
Encode with <kbd>e</kbd>
</li>
<li>
Escape with <kbd>Esc</kbd>
</li>
<li>
<kbd>?</kbd> for help
</li>
</ul>
</div>
</div>
<script>
// Display
b64_el = document.getElementById('b64');
// on control c put uuid on clipboard
// ---- Modal logic ----
const overlay = document.getElementById('modal-overlay');
function toggleModal() {
if (overlay.style.display === 'none') {
overlay.style.display = 'flex';
document.activeElement.blur();
overlay.focus();
} else {
overlay.style.display = 'none';
}
}
function hideModal() {
overlay.style.display = 'none';
}
overlay.addEventListener('click', e => {
if (e.target === overlay) hideModal();
});
document.addEventListener('keydown', e => {
if (e.key === '?') {
toggleModal();
}
});
async function getClipboardContents() {
try {
return await navigator.clipboard.readText();
} catch (err) {
console.error('Failed to read clipboard contents: ', err);
}
}
document.addEventListener('keydown', e => {
if (overlay.style.display === 'flex' && e.key === 'Escape') {
hideModal();
}
else if (overlay.style.display === 'flex') {
}
else if (e.key === 'Escape' && document.activeElement === b64_el) {
b64_el.blur();
}
else if (document.activeElement === b64_el) {
}
else if (e.key === 'c' && e.ctrlKey) {
navigator.clipboard.writeText(b64_el.textContent);
}
else if (e.key === 'v' && e.ctrlKey) {
clipboardContents = getClipboardContents();
clipboardContents.then(contents => {
b64_el.textContent = contents;
});
}
else if (e.key === 'd') {
content = b64_el.textContent;
decoded = atob(content);
b64_el.textContent = decoded;
}
else if (e.key === 'e') {
content = b64_el.textContent;
encoded = btoa(content);
b64_el.textContent = encoded;
}
else if (e.key === '?') {
toggleModal();
}
else if (e.key === 'Escape' && overlay.style.display === 'flex') {
hideModal();
}
else if (e.key === 'Enter') {
b64_el.blur();
}
else if (e.key === 'Escape') {
b64_el.blur();
}
else if (e.ctrlKey) {
}
else if (e.shiftKey) {
}
else {
b64_el.focus();
}
}
)
</script>
</body>
</html>

0
clock/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

0
color/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

0
dice/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

View file

@ -1,5 +1,5 @@
serve: serve:
python -m http.server -d site 8000 python -m http.server 8000
deploy name: deploy name:
uvx --with awscli aws s3 sync {name} s3://k8s-pages/{name} uvx --with awscli aws s3 sync {{name}}/ s3://k8s-pages/{{name}} --endpoint-url https://minio.wayl.one --profile minio

24
popup/index.html Normal file
View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en" class='bg-black text-white'>
<head>
<meta charset="UTF-8">
<title>Glossary Tooltip</title>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
</head>
<body class='container mx-auto my-8 text-xl'>
<h1 class='text-3xl'>Glossary</h1>
<p class='my-4'>
This paragraph contains a
<span class="glossary-term group relative cursor-help border-b border-dotted border-gray-500 hover:tooltip">
<strong>container</strong>
<span class="tooltip absolute bottom-[120%] left-1 bg-[#333] w-md text-center text-white py-1 px-2 rounded z-10 hidden group-hover:block">
A unit that packages software and its dependencies.
</span>
</span>
which is important in DevOps.
</p>
</body>
</html>

2
qr-codes-in-python.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 45 45" class="pyqrcode"><path fill="#2b034c" d="M0 0h45v45h-45z"/><path stroke="#ff69b4" class="pyqrline" d="M4 4.5h7m2 0h1m1 0h3m3 0h3m5 0h2m3 0h7m-37 1h1m5 0h1m1 0h2m3 0h1m3 0h1m2 0h2m2 0h2m2 0h1m1 0h1m5 0h1m-37 1h1m1 0h3m1 0h1m1 0h1m2 0h2m1 0h2m1 0h1m1 0h1m1 0h1m2 0h2m2 0h1m1 0h1m1 0h3m1 0h1m-37 1h1m1 0h3m1 0h1m1 0h1m1 0h1m2 0h1m1 0h2m1 0h1m3 0h6m2 0h1m1 0h3m1 0h1m-37 1h1m1 0h3m1 0h1m1 0h1m1 0h1m1 0h2m1 0h1m2 0h1m1 0h2m1 0h1m2 0h1m1 0h1m1 0h1m1 0h3m1 0h1m-37 1h1m5 0h1m1 0h5m2 0h1m2 0h1m3 0h1m1 0h1m3 0h1m1 0h1m5 0h1m-37 1h7m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h7m-27 1h2m1 0h1m1 0h1m4 0h3m4 0h2m-27 1h1m2 0h5m2 0h2m1 0h4m1 0h5m3 0h2m1 0h5m-36 1h1m7 0h2m2 0h1m1 0h5m4 0h3m1 0h5m1 0h2m1 0h1m-37 1h2m1 0h1m2 0h6m1 0h7m1 0h1m1 0h2m2 0h4m1 0h1m1 0h1m1 0h1m-37 1h1m1 0h1m2 0h1m1 0h1m2 0h3m1 0h1m2 0h2m1 0h1m1 0h2m2 0h1m1 0h1m2 0h3m1 0h2m-34 1h1m2 0h1m2 0h1m1 0h1m3 0h1m1 0h1m1 0h2m3 0h1m2 0h2m1 0h1m2 0h1m1 0h2m-33 1h1m3 0h2m1 0h2m1 0h4m2 0h3m1 0h1m1 0h6m2 0h1m1 0h1m-37 1h1m1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 0h1m1 0h3m1 0h1m-37 1h1m5 0h1m1 0h2m1 0h1m1 0h1m1 0h2m2 0h2m3 0h1m3 0h1m3 0h2m1 0h1m-36 1h1m1 0h3m1 0h1m3 0h1m2 0h1m2 0h2m1 0h3m1 0h2m1 0h7m2 0h2m-37 1h1m1 0h3m1 0h1m4 0h1m2 0h2m1 0h1m1 0h1m1 0h1m6 0h1m3 0h3m1 0h1m-37 1h1m1 0h3m1 0h1m1 0h1m1 0h1m1 0h4m1 0h1m1 0h7m1 0h2m2 0h2m2 0h2m-37 1h1m5 0h1m3 0h4m1 0h2m2 0h2m1 0h3m3 0h1m2 0h1m1 0h1m-34 1h7m4 0h2m1 0h1m3 0h2m4 0h1m3 0h1m1 0h1m2 0h1m2 0h1"/></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

1
qr.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>QR Code</title>
<style>
body {
background: black;
color: lime;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
font-size: 4rem;
}
#input {
min-width: 90vw;
min-height: 5rem;
font-size: 2rem;
padding: 1rem;
margin-bottom: 1rem;
color: lime;
background: black;
border: 2px solid lime;
word-break: break-word;
}
#qrcode {
margin-top: 1rem;
}
.modal-overlay {
position: fixed;
top: 0; left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
background: black;
border: 2px solid lime;
border-radius: 0.5rem;
padding: 2rem;
color: lime;
font-size: 1.5rem;
max-width: 90%;
}
.modal h2 {
color: #00ff00;
}
</style>
</head>
<body>
<div class="container">
<div id="input" contenteditable="true"></div>
<div id="qrcode"></div>
</div>
<div id="modal-overlay" class="modal-overlay">
<div class="modal">
<h2>Help</h2>
<p>Type or paste your text and press <code>g</code> to generate a QR code.</p>
<ul>
<li><kbd>Ctrl</kbd> + <kbd>v</kbd> = Paste</li>
<li><kbd>Ctrl</kbd> + <kbd>c</kbd> = Copy</li>
<li><kbd>g</kbd> = Generate</li>
<li><kbd>?</kbd> = Help</li>
<li><kbd>Esc</kbd> = Exit input or close modal</li>
</ul>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/qrcode/build/qrcode.min.js"></script>
<script>
const inputEl = document.getElementById('input');
const qrContainer = document.getElementById('qrcode');
const overlay = document.getElementById('modal-overlay');
function toggleModal() {
overlay.style.display = overlay.style.display === 'flex' ? 'none' : 'flex';
}
function hideModal() {
overlay.style.display = 'none';
}
function generateQR(text) {
qrContainer.innerHTML = '';
QRCode.toCanvas(text, { color: { dark: '#00FF00', light: '#000000' } }, (err, canvas) => {
if (err) return console.error(err);
qrContainer.appendChild(canvas);
});
}
async function getClipboardContents() {
try {
return await navigator.clipboard.readText();
} catch (err) {
console.error('Clipboard error:', err);
}
}
document.addEventListener('keydown', async (e) => {
if (overlay.style.display === 'flex' && e.key === 'Escape') return hideModal();
if (e.key === '?') return toggleModal();
if (e.ctrlKey && e.key === 'c') {
navigator.clipboard.writeText(inputEl.textContent);
} else if (e.ctrlKey && e.key === 'v') {
const contents = await getClipboardContents();
inputEl.textContent = contents;
} else if (e.key === 'g') {
generateQR(inputEl.textContent);
} else if (e.key === 'Escape') {
inputEl.blur();
} else if (!e.ctrlKey && !e.metaKey && !e.altKey) {
inputEl.focus();
}
});
overlay.addEventListener('click', e => {
if (e.target === overlay) hideModal();
});
</script>
</body>
</html>

BIN
qrcode/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

187
qrcode/index.html Normal file
View file

@ -0,0 +1,187 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>QR Code</title>
<style>
body {
background: black;
color: lime;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
font-size: 4rem;
}
#input {
text-align: center;
min-width: 90vw;
min-height: 5rem;
font-size: 2rem;
padding: 1rem;
margin-bottom: 1rem;
color: lime;
background: transparent;
word-break: break-word;
border: none;
}
#qrcode {
width: min(90vw, 90vh);
height: min(90vw, 90vh);
margin-top: 1rem;
margin: auto;
}
.modal-overlay {
position: fixed;
top: 0; left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
background: black;
border: 2px solid lime;
border-radius: 0.5rem;
padding: 2rem;
color: lime;
font-size: 1.5rem;
max-width: 90%;
}
.modal h2 {
color: #00ff00;
}
</style>
</head>
<body>
<div class="container">
<div id="qrcode"></div>
<textarea id="input" placeholder="Paste or type your text here..."></textarea>
</div>
<div id="modal-overlay" class="modal-overlay">
<div class="modal">
<h2>Help</h2>
<p>Type or paste your text and press <code>g</code> to generate a QR code.</p>
<ul>
<li><kbd>Ctrl</kbd> + <kbd>v</kbd> = Paste</li>
<li><kbd>Ctrl</kbd> + <kbd>c</kbd> = Copy</li>
<li><kbd>g</kbd> = Generate</li>
<li><kbd>?</kbd> = Help</li>
<li><kbd>Esc</kbd> = Exit input or close modal</li>
</ul>
<p>
Using query parameters:
</p>
<ul>
<li><code>https://qrcode.wayl.one?text=https://qrcode.wayl.one</code> - Text to generate QR code for</li>
</ul>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/qrcode/build/qrcode.min.js"></script>
<script>
const inputEl = document.getElementById('input');
const qrContainer = document.getElementById('qrcode');
const overlay = document.getElementById('modal-overlay');
const params = new URLSearchParams(window.location.search);
if (params.has('text')) {
inputEl.value = params.get('text');
generateQR(inputEl.value);
}
if (params.has('color')) {
inputEl.style.color = `#${params.get('color')}`;
}
if (params.has('bg')) {
document.body.style.background = `#${params.get('bg')}`;
}
function toggleModal() {
overlay.style.display = overlay.style.display === 'flex' ? 'none' : 'flex';
}
function hideModal() {
overlay.style.display = 'none';
}
function generateQR(text) {
if (params.has('color')) {
color = `#${params.get('color')}`;
} else {
color = '#00FF00';
}
if (params.has('bg')) {
bg = `#${params.get('bg')}`;
} else {
bg = '#000000';
}
console.log(color, bg);
qrContainer.innerHTML = '';
if (text === '') return;
QRCode.toCanvas(text, {
width: Math.floor(Math.min(window.innerWidth, window.innerHeight) * 0.9),
color: { dark: color, light: bg }
}, (err, canvas) => {
if (err) return console.error(err);
qrContainer.appendChild(canvas);
});
}
async function getClipboardContents() {
try {
return await navigator.clipboard.readText();
} catch (err) {
console.error('Clipboard error:', err);
}
}
document.addEventListener('keydown', async (e) => {
if (overlay.style.display === 'flex' && e.key === 'Escape') return hideModal();
if (e.key === '?') return toggleModal();
if (e.ctrlKey && e.key === 'c') {
navigator.clipboard.writeText(inputEl.value);
} else if (e.ctrlKey && e.key === 'v') {
const contents = await getClipboardContents();
inputEl.value = contents;
} else if (e.key === 'Escape') {
inputEl.blur();
} else {
inputEl.focus();
}
});
document.addEventListener('keyup', async (e) => {
generateQR(inputEl.value);
const url = new URL(window.location.href);
url.searchParams.set('text', inputEl.value);
window.history.replaceState({}, '', url);
});
// generate on resize
window.addEventListener('resize', () => {
generateQR(inputEl.value);
});
overlay.addEventListener('click', e => {
if (e.target === overlay) hideModal();
});
</script>
</body>
</html>

BIN
stopwatch/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

232
stopwatch/index.html Normal file
View file

@ -0,0 +1,232 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stopwatch</title>
<meta property="og:title" content="Stopwatch" />
<meta property="og:image" content="http://shots.wayl.one/shot/?url=https://stopwatch.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=630&selectors=" />
<meta property="og:description" content="A large display stopwatch, it just counts up." />
<meta property="og:url" content="https://stopwatch.wayl.one/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Stopwatch" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Stopwatch" />
<meta name="twitter:description" content="A large display stopwatch, it just counts up." />
<meta name="twitter:image" content="http://shots.wayl.one/shot/?url=https://stopwatch.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=640&selectors=" />
<style>
body {
margin: 0;
height: 100vh;
background: black;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-family: monospace;
color: lime;
user-select: none;
}
#title {
min-width: 100vw;
min-height: 5rem;
font-size: 3vw;
margin-bottom: 1em;
outline: none;
text-align: center;
}
#timer {
font-size: 10vw;
cursor: pointer;
}
/* Modal styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
box-shadow: 0 0 3rem 1rem #00ff0017;
background: black;
border: 2px solid lime;
border-radius: 0.5rem;
padding: 2rem;
max-width: 90%;
color: lime;
text-align: left;
font-size: 1.5rem;
}
.modal h2 {
margin-top: 0;
color: #008e00;
}
.modal ul {
color: #00ae00;
}
</style>
</head>
<body>
<div id="title" contenteditable="true"></div>
<div id="timer">00:00.000</div>
<!-- Modal -->
<div id="modal-overlay" class="modal-overlay">
<div class="modal">
<h2>Help</h2>
<p>
It's just a stopwatch, it counts up, press enter, space or click to start/stop.
</p>
<p>
Start typing to give it a title.
</p>
<p>
Copy with <kbd>Ctrl</kbd> + <kbd>c</kbd>
</p>
</div>
</div>
<script>
const timerElement = document.getElementById('timer');
const copyButton = document.getElementById('copyButton');
let startTime = null;
let elapsedTime = 0;
let running = true;
let animationFrameId = null;
function formatTime(ms) {
const totalMilliseconds = Math.floor(ms);
const totalSeconds = Math.floor(totalMilliseconds / 1000);
const minutes = Math.floor(totalSeconds / 60);
const seconds = totalSeconds % 60;
const milliseconds = totalMilliseconds % 1000;
return (
String(minutes).padStart(2, '0') + ':' +
String(seconds).padStart(2, '0') + '.' +
String(milliseconds).padStart(3, '0')
);
}
function updateTimer() {
const now = performance.now();
const elapsed = now - startTime + elapsedTime;
timerElement.textContent = formatTime(elapsed);
animationFrameId = requestAnimationFrame(updateTimer);
}
function toggleTimer() {
if (running) {
cancelAnimationFrame(animationFrameId);
elapsedTime += performance.now() - startTime;
running = false;
} else {
startTime = performance.now();
running = true;
updateTimer();
}
}
const params = new URLSearchParams(window.location.search);
const title = params.get('title');
const title_el = document.getElementById('title')
if (title) {
title_el.textContent = title;
}
// ---- Modal logic ----
const overlay = document.getElementById('modal-overlay');
function toggleModal() {
if (overlay.style.display === 'none') {
overlay.style.display = 'flex';
} else {
overlay.style.display = 'none';
}
}
function hideModal() {
overlay.style.display = 'none';
}
document.addEventListener('keydown', e => {
if (e.key === 'c' && e.ctrlKey) {
const time = timerElement.textContent;
navigator.clipboard.writeText(time);
} else if (e.key === 'Enter' && !(document.activeElement === title_el)) {
toggleTimer();
} else if (e.key === 'Escape' && document.activeElement === title_el) {
console.log('Escape');
title_el.blur();
} else if (e.key === 'Escape') {
console.log('Escape');
hideModal();
} else if (e.code === 'Space' && !(document.activeElement === title_el)) {
toggleTimer();
} else if (e.key === '?' && !title_el.isFocused) {
toggleModal();
} else if (e.key === '?') {
} else if (e.keyCode === 191) {
} else if (e.ctrlKey && e.key === 'a'){
title_el.focus();
} else if (e.ctrlKey){
} else if (e.shiftKey){
} else {
title_el.focus();
}
})
timerElement.addEventListener('click', toggleTimer);
// on change of title update query params
title_el.addEventListener('input', () => {
const new_title = title_el.textContent;
const url = new URL(window.location);
url.searchParams.set('title', new_title);
window.history.replaceState({}, '', url);
});
// Start timer on page load
window.addEventListener('load', () => {
startTime = performance.now();
updateTimer();
});
// Wake Lock support
let wakeLock = null;
async function requestWakeLock() {
try {
if ('wakeLock' in navigator) {
wakeLock = await navigator.wakeLock.request('screen');
console.log("Wake lock acquired");
}
} catch (err) {
console.error("Wake lock error:", err);
}
}
document.addEventListener("visibilitychange", () => {
if (wakeLock !== null && document.visibilityState === "visible") {
requestWakeLock();
}
});
requestWakeLock();
overlay.addEventListener('click', e => {
if (e.target === overlay) hideModal();
});
</script>
</body>
</html>

5
stopwatch/justfile Normal file
View file

@ -0,0 +1,5 @@
serve:
python -m http.server -d site
deploy:
uvx --with awscli aws s3 sync site/ s3://k8s-pages/stopwatch

0
timer/favicon.ico Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

View file

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Countdown Timer</title> <title>Countdown Timer</title>
<description>A simple large display countdown timer, its just counts down</description>
<meta property="og:title" content="Countdown Timer" /> <meta property="og:title" content="Countdown Timer" />
<meta property="og:image" content="http://shots.wayl.one/shot/?url=https://timer.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=630&selectors=" /> <meta property="og:image" content="http://shots.wayl.one/shot/?url=https://timer.wayl.one/&height=630&width=1200&scaled_width=1200&scaled_height=630&selectors=" />
<meta property="og:description" content="A simple large display countdown timer, its just counts down" /> <meta property="og:description" content="A simple large display countdown timer, its just counts down" />
@ -33,8 +33,11 @@
#title { #title {
font-size: 4vw; font-size: 4vw;
margin-bottom: 2vh; margin-bottom: 2vh;
padding: 2rem 0;
outline: none; outline: none;
text-align: center; text-align: center;
min-height: 4vw;
width: 100%;
} }
#countdown { #countdown {
@ -44,13 +47,68 @@
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
} }
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
display: none;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal {
box-shadow: 0 0 3rem 1rem #00ff0017;
background: black;
border: 2px solid lime;
border-radius: 0.5rem;
padding: 2rem;
max-width: 90%;
color: lime;
text-align: left;
font-size: 1.5rem;
}
.modal h2 {
margin-top: 0;
color: #008e00;
}
.modal ul {
color: #00ae00;
}
</style> </style>
</head> </head>
<body> <body>
<div id="title" contenteditable="true">Click to Edit Title</div> <div id="title" contenteditable="true"></div>
<div id="countdown" contenteditable="true">00:05:00</div> <div id="countdown" contenteditable="true">00:05:00</div>
<!-- Modal -->
<dialog id="modal-overlay" class="modal-overlay">
<div class="modal">
<h2>Help</h2>
<p>
It's just a countdown timer, it counts down.
</p>
<p>
Use query parameters to change the time ex. ?hr=5&min=30&sec=0
</p>
<p>
Start typing to give it a title.
</p>
<p>
Copy with <kbd>Ctrl</kbd> + <kbd>c</kbd>
</p>
</div>
</dialog>
<script> <script>
const urlParams = new URLSearchParams(window.location.search);
const title = urlParams.get('title');
const title_el = document.getElementById('title')
if (title) {
title_el.textContent = title;
}
const countdownEl = document.getElementById("countdown"); const countdownEl = document.getElementById("countdown");
let endTime = null; let endTime = null;
@ -120,6 +178,58 @@
} }
}); });
// ---- Modal logic ----
const overlay = document.getElementById('modal-overlay');
function toggleModal() {
if (overlay.style.display === 'none') {
overlay.style.display = 'flex';
} else {
overlay.style.display = 'none';
}
}
function hideModal() {
overlay.style.display = 'none';
}
document.addEventListener('keydown', e => {
if (e.key === 'c' && e.ctrlKey) {
const time = countdownEl.textContent;
navigator.clipboard.writeText(time);
} else if (e.key === 'Enter' && !(document.activeElement === title_el)) {
// toggleTimer();
} else if (e.key === 'Escape' && document.activeElement === title_el) {
title_el.blur();
} else if (e.key === 'Escape') {
hideModal();
} else if (e.code === 'Space' && !(document.activeElement === title_el)) {
// toggleTimer();
} else if (e.key === '?' && !title_el.isFocused) {
toggleModal();
} else if (e.key === '?') {
} else if (e.keyCode === 191) {
} else if (e.ctrlKey && e.key === 'a'){
title_el.focus();
} else if (e.ctrlKey){
} else if (e.shiftKey){
} else if (overlay.style.display === 'flex') {
} else {
title_el.focus();
}
})
// on change of title update query params
title_el.addEventListener('input', () => {
const new_title = title_el.textContent;
const url = new URL(window.location);
url.searchParams.set('title', new_title);
window.history.replaceState({}, '', url);
});
// Support query params (e.g. ?min=3&sec=30) // Support query params (e.g. ?min=3&sec=30)
function getInitialTimeFromQuery(urlParams) { function getInitialTimeFromQuery(urlParams) {
const hr = parseInt(urlParams.get("hr") || "0", 10); const hr = parseInt(urlParams.get("hr") || "0", 10);
@ -147,14 +257,8 @@
} }
}); });
// Start
const urlParams = new URLSearchParams(window.location.search);
const initialMs = getInitialTimeFromQuery(urlParams); const initialMs = getInitialTimeFromQuery(urlParams);
countdownEl.textContent = formatTime(initialMs); countdownEl.textContent = formatTime(initialMs);
const title = urlParams.get("title");
if (title) {
document.getElementById("title").textContent = title;
}
startCountdown(initialMs); startCountdown(initialMs);
requestWakeLock(); requestWakeLock();
</script> </script>

2
uca-url.svg Normal file
View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 37" class="pyqrcode"><path fill="#2b034c" d="M0 0h37v37h-37z"/><path stroke="#ff69b4" class="pyqrline" d="M4 4.5h7m1 0h3m2 0h1m2 0h4m2 0h7m-29 1h1m5 0h1m2 0h3m2 0h1m2 0h1m1 0h2m1 0h1m5 0h1m-29 1h1m1 0h3m1 0h1m2 0h6m1 0h1m2 0h1m2 0h1m1 0h3m1 0h1m-29 1h1m1 0h3m1 0h1m1 0h5m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h3m1 0h1m-29 1h1m1 0h3m1 0h1m3 0h1m3 0h1m1 0h4m2 0h1m1 0h3m1 0h1m-29 1h1m5 0h1m2 0h1m2 0h1m1 0h1m1 0h5m1 0h1m5 0h1m-29 1h7m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m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