Files
Fredrik Johansson 4eee44f675 Initial scaffold: blob store server, CLI scripts, and PWA share target
Clipboard/screenshot sync across own devices via a single DEVICE_TOKEN-gated
blob store, plus a small installable web app so a phone can push/pull
clips and share screenshots via the OS share sheet.
2026-08-20 15:28:42 +02:00

105 lines
3.7 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>scrot</title>
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/icon.svg">
<meta name="theme-color" content="#111318">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<style>
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
margin: 0; padding: 1.25rem; padding-bottom: 3rem;
background: #111318; color: #e6e8ec;
font: 16px/1.4 system-ui, sans-serif;
max-width: 32rem; margin-inline: auto;
}
h1 { font-size: 1.1rem; font-weight: 600; color: #9aa1ad; margin: 0 0 1.25rem; }
section {
background: #191c22; border: 1px solid #262b34; border-radius: 12px;
padding: 1rem; margin-bottom: 1rem;
}
section h2 { font-size: 0.95rem; margin: 0 0 0.75rem; }
textarea {
width: 100%; min-height: 6rem; resize: vertical;
background: #0d0f13; color: #e6e8ec; border: 1px solid #2c323d;
border-radius: 8px; padding: 0.6rem; font: inherit;
}
input[type="text"], input[type="password"] {
width: 100%; background: #0d0f13; color: #e6e8ec;
border: 1px solid #2c323d; border-radius: 8px; padding: 0.6rem; font: inherit;
}
button {
appearance: none; border: none; border-radius: 8px;
background: #2c7a5f; color: #eafff5; font: inherit; font-weight: 600;
padding: 0.6rem 1rem; margin-top: 0.6rem; margin-right: 0.5rem;
cursor: pointer;
}
button.secondary { background: #262b34; color: #cfd4dc; }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
#clipResult, #shotResult, #toast { font-size: 0.9rem; color: #9aa1ad; margin-top: 0.6rem; word-break: break-all; }
#shotResult a { color: #6ee7b7; }
#toast { display: none; padding: 0.6rem; background: #1c3a2c; border-radius: 8px; color: #b9f5da; margin-bottom: 1rem; }
#onboard { display: none; }
label { display: block; font-size: 0.85rem; color: #9aa1ad; margin-bottom: 0.3rem; }
</style>
</head>
<body>
<h1>scrot</h1>
<div id="toast"></div>
<section id="onboard">
<h2>Device token</h2>
<label for="tokenInput">Paste the token from <code>~/.config/scrot/env</code>, or open this page's link/QR from <code>cli/scrot-onboard</code>.</label>
<input id="tokenInput" type="password" autocomplete="off" placeholder="device token">
<div class="row">
<button id="saveToken">Save</button>
</div>
</section>
<section>
<h2>Push clipboard</h2>
<textarea id="clipText" placeholder="Paste or type text to sync to your other devices"></textarea>
<div class="row">
<button id="pasteFromClipboard" class="secondary">Paste from clipboard</button>
<button id="pushClip">Send</button>
</div>
<div id="clipResult"></div>
</section>
<section>
<h2>Pull latest clip</h2>
<div class="row">
<button id="pullClip">Fetch latest</button>
<button id="copyPulled" class="secondary" disabled>Copy to clipboard</button>
</div>
<div id="pullResult"></div>
</section>
<section>
<h2>Share screenshot</h2>
<input id="shotFile" type="file" accept="image/*" capture="environment">
<div class="row">
<button id="pushShot">Upload</button>
</div>
<div id="shotResult"></div>
</section>
<section>
<h2>Settings</h2>
<div class="row">
<button id="editToken" class="secondary">Change device token</button>
</div>
</section>
<script src="/app.js"></script>
</body>
</html>