init
This commit is contained in:
218
ext/options.html
Normal file
218
ext/options.html
Normal file
@@ -0,0 +1,218 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ofsaver settings</title>
|
||||
<style>
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
--bg: #fafafa;
|
||||
--surface: #ffffff;
|
||||
--sunken: #f4f4f5;
|
||||
--text: #18181b;
|
||||
--text-2: #52525b;
|
||||
--text-3: #71717a;
|
||||
--line: rgba(24, 24, 27, .09);
|
||||
--line-strong: rgba(24, 24, 27, .16);
|
||||
--accent: #d63a3f;
|
||||
--accent-hover: #c2333a;
|
||||
--accent-ink: #c2333a;
|
||||
--ok: #2f7d52;
|
||||
--ring: rgba(214, 58, 63, .35);
|
||||
--mono: ui-monospace, "SF Mono", Menlo, monospace;
|
||||
--ease: cubic-bezier(.2, 0, 0, 1);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #141416;
|
||||
--surface: #1c1c1f;
|
||||
--sunken: #19191c;
|
||||
--text: #ededef;
|
||||
--text-2: #a1a1aa;
|
||||
--text-3: #7c7c85;
|
||||
--line: rgba(237, 237, 239, .08);
|
||||
--line-strong: rgba(237, 237, 239, .16);
|
||||
--accent-ink: #f0686c;
|
||||
--ok: #5fb585;
|
||||
}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 48px 24px 96px;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font: 14px/1.5 -apple-system, system-ui, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
.wrap { max-width: 760px; margin: 0 auto; }
|
||||
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
||||
|
||||
header { margin-bottom: 40px; }
|
||||
.brand { font: 500 13px var(--mono); color: var(--text-3); margin-bottom: 8px; }
|
||||
h1 { font-size: 24px; line-height: 32px; font-weight: 500; margin: 0 0 4px; letter-spacing: -.01em; }
|
||||
.sub { color: var(--text-2); margin: 0; }
|
||||
|
||||
section { padding: 32px 0; border-top: 1px solid var(--line); }
|
||||
h2 { font-size: 15px; font-weight: 500; margin: 0; }
|
||||
.section-sub { color: var(--text-2); font-size: 13px; margin: 4px 0 16px; }
|
||||
|
||||
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
||||
.card {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: 16px 1fr;
|
||||
column-gap: 12px;
|
||||
padding: 16px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
font: inherit;
|
||||
color: inherit;
|
||||
transition: border-color .15s var(--ease), background-color .15s var(--ease);
|
||||
}
|
||||
.card:hover { border-color: var(--line-strong); }
|
||||
.card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
||||
.card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
|
||||
.radio {
|
||||
width: 16px; height: 16px; margin-top: 2px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--line-strong);
|
||||
transition: border-color .15s var(--ease), border-width .15s var(--ease);
|
||||
}
|
||||
.card.selected .radio { border: 5px solid var(--accent); }
|
||||
.card .t { font-size: 14px; font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
|
||||
.card .rec { font-size: 12px; font-weight: 400; color: var(--text-3); }
|
||||
.card .d { grid-column: 2; font-size: 13px; color: var(--text-2); margin-top: 2px; }
|
||||
.card .path {
|
||||
grid-column: 2;
|
||||
margin-top: 12px;
|
||||
font: 12px/16px var(--mono);
|
||||
color: var(--text-3);
|
||||
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.card .path .sep { opacity: .5; padding: 0 2px; }
|
||||
|
||||
.preview {
|
||||
margin-top: 12px;
|
||||
padding: 12px 16px;
|
||||
background: var(--sunken);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
}
|
||||
.preview .label { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
|
||||
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; font: 12px/20px var(--mono); color: var(--text-2); }
|
||||
.crumb { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
|
||||
.crumb svg.i { width: 14px; height: 14px; color: var(--text-3); }
|
||||
.crumb.file { color: var(--text); word-break: break-all; }
|
||||
.crumbs .sep { color: var(--text-3); opacity: .6; padding: 0 4px; }
|
||||
|
||||
input[type="text"] {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 0 12px;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--line-strong);
|
||||
border-radius: 8px;
|
||||
font: 13px var(--mono);
|
||||
transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
|
||||
}
|
||||
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
|
||||
|
||||
.tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; }
|
||||
.tokens .label { font-size: 12px; color: var(--text-3); margin-right: 4px; }
|
||||
.tokens button {
|
||||
height: 24px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
background: var(--surface);
|
||||
color: var(--text-2);
|
||||
font: 12px var(--mono);
|
||||
cursor: pointer;
|
||||
transition: border-color .15s var(--ease), color .15s var(--ease);
|
||||
}
|
||||
.tokens button:hover { border-color: var(--line-strong); color: var(--text); }
|
||||
.tokens button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
|
||||
|
||||
.actions { display: flex; align-items: center; gap: 12px; padding-top: 32px; border-top: 1px solid var(--line); }
|
||||
button.save {
|
||||
height: 36px;
|
||||
padding: 0 16px;
|
||||
background: var(--accent);
|
||||
color: #fff;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
font: 500 14px -apple-system, system-ui, sans-serif;
|
||||
cursor: pointer;
|
||||
transition: background-color .15s var(--ease), transform .1s var(--ease);
|
||||
}
|
||||
button.save:hover { background: var(--accent-hover); }
|
||||
button.save:active { transform: scale(.98); }
|
||||
button.save:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
|
||||
.toast {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
font-size: 13px; color: var(--ok);
|
||||
opacity: 0;
|
||||
transition: opacity .2s var(--ease);
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
body { padding: 32px 16px 64px; }
|
||||
.cards { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<header>
|
||||
<div class="brand">ofsaver</div>
|
||||
<h1>Settings</h1>
|
||||
<p class="sub">Choose the folders and names for what you save. Changes apply to the next download.</p>
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<h2>Single downloads</h2>
|
||||
<p class="section-sub">The Download button on posts and messages</p>
|
||||
<div class="cards" id="singleCards" role="radiogroup" aria-label="Single download folders"></div>
|
||||
<div class="preview" id="singlePreview"></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Bulk downloads</h2>
|
||||
<p class="section-sub">Whole profile downloads</p>
|
||||
<div class="cards" id="bulkCards" role="radiogroup" aria-label="Bulk download folders"></div>
|
||||
<div class="preview" id="bulkPreview"></div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>File name</h2>
|
||||
<p class="section-sub">Build the name from tokens. Click one to insert it.</p>
|
||||
<input type="text" id="nameTemplate" spellcheck="false" aria-label="File name pattern">
|
||||
<div class="tokens" id="tokens">
|
||||
<span class="label">Tokens</span>
|
||||
<button type="button" data-t="{creator}">creator</button>
|
||||
<button type="button" data-t="{type}">type</button>
|
||||
<button type="button" data-t="{date}">date</button>
|
||||
<button type="button" data-t="{timestamp}">timestamp</button>
|
||||
<button type="button" data-t="{mediaId}">mediaId</button>
|
||||
<button type="button" data-t="{postId}">postId</button>
|
||||
<button type="button" data-t="{quality}">quality</button>
|
||||
<button type="button" data-t="{ext}">ext</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="actions">
|
||||
<button class="save" id="save">Save settings</button>
|
||||
<span class="toast" id="toast" role="status">
|
||||
<svg class="i" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>Saved
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="options.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user