@cliptude/cli 0.1.21 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/cliptude_mcp/apps.py +311 -0
- package/cliptude_mcp/cli.py +103 -21
- package/cliptude_mcp/client.py +288 -66
- package/cliptude_mcp/creation.py +207 -0
- package/cliptude_mcp/credentials.py +31 -5
- package/cliptude_mcp/server.py +284 -76
- package/cliptude_mcp/widgets/avatars.html +287 -0
- package/cliptude_mcp/widgets/base.css +123 -0
- package/cliptude_mcp/widgets/bridge.js +314 -0
- package/cliptude_mcp/widgets/characters.html +108 -0
- package/cliptude_mcp/widgets/choices.html +230 -0
- package/cliptude_mcp/widgets/player.html +126 -0
- package/cliptude_mcp/widgets/publish-kit.html +170 -0
- package/cliptude_mcp/widgets/voices.html +436 -0
- package/package.json +1 -1
- package/pyproject.toml +4 -4
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Choose an avatar</title>
|
|
7
|
+
<style>
|
|
8
|
+
/*@BASE_CSS@*/
|
|
9
|
+
.badge-photo { position: absolute; left: 6px; top: 6px; }
|
|
10
|
+
.create-card .thumb { font-size: 40px; color: var(--accent); }
|
|
11
|
+
.panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--border-radius-md);
|
|
12
|
+
background: var(--color-background-secondary); border: 1px solid var(--color-border-primary); }
|
|
13
|
+
.panel h2 { font-size: var(--font-text-md-size); margin: 0; }
|
|
14
|
+
.panel label { display: flex; flex-direction: column; gap: 4px; font-size: var(--font-text-sm-size); color: var(--color-text-secondary); }
|
|
15
|
+
.panel textarea, .panel input[type="text"] {
|
|
16
|
+
font: inherit; font-size: var(--font-text-sm-size); color: var(--color-text-primary);
|
|
17
|
+
background: var(--color-background-primary); border: 1px solid var(--color-border-primary);
|
|
18
|
+
border-radius: var(--border-radius-sm); padding: 8px 10px; }
|
|
19
|
+
.panel textarea { min-height: 60px; resize: vertical; }
|
|
20
|
+
.review dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: var(--font-text-sm-size); }
|
|
21
|
+
.review dt { color: var(--color-text-secondary); }
|
|
22
|
+
.review dd { margin: 0; }
|
|
23
|
+
.photo-preview { max-width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--border-radius-sm); }
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<main class="app" aria-labelledby="title">
|
|
28
|
+
<div class="head">
|
|
29
|
+
<h1 id="title">Choose a presenter</h1>
|
|
30
|
+
<span class="sub" id="count"></span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="toolbar">
|
|
33
|
+
<label class="sr-only" for="filter">Filter avatars by name</label>
|
|
34
|
+
<input type="search" id="filter" placeholder="Filter by name" autocomplete="off">
|
|
35
|
+
</div>
|
|
36
|
+
<div id="create-panel" class="panel" hidden></div>
|
|
37
|
+
<div id="content" class="list"><div class="status" role="status">Loading avatars…</div></div>
|
|
38
|
+
<div id="more"></div>
|
|
39
|
+
<div class="selection" id="selection" hidden>
|
|
40
|
+
<span class="what" id="selected-text"></span>
|
|
41
|
+
<button class="primary" id="use" type="button">Use this avatar</button>
|
|
42
|
+
</div>
|
|
43
|
+
</main>
|
|
44
|
+
<div id="toast" role="status" aria-live="polite"></div>
|
|
45
|
+
<script>
|
|
46
|
+
/*@BRIDGE_JS@*/
|
|
47
|
+
(function () {
|
|
48
|
+
"use strict";
|
|
49
|
+
var h = UI.h;
|
|
50
|
+
var CREATE_PAGE = "https://cliptude.com/videos/avatars/create/";
|
|
51
|
+
var GROUPS = [["mine", "Yours"], ["builtin", "Built-in"], ["public", "Public"]];
|
|
52
|
+
var SECTION_LABEL = { mine: "Yours", builtin: "Built-in", public: "Public" };
|
|
53
|
+
var avatars = [];
|
|
54
|
+
var total = 0;
|
|
55
|
+
var input = {};
|
|
56
|
+
var selected = null;
|
|
57
|
+
var content = document.getElementById("content");
|
|
58
|
+
|
|
59
|
+
function isPhoto(a) { return a.section === "mine" || a.section === "builtin"; }
|
|
60
|
+
|
|
61
|
+
function visible(section) {
|
|
62
|
+
var q = document.getElementById("filter").value.trim().toLowerCase();
|
|
63
|
+
return avatars.filter(function (a) {
|
|
64
|
+
if (a.section !== section) return false;
|
|
65
|
+
return !q || String(a.name || "").toLowerCase().indexOf(q) >= 0 || String(a.id) === q;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function select(a) {
|
|
70
|
+
if (a.status && a.status !== "ready") { UI.toast("This avatar is still being made. It can be picked once it is ready."); return; }
|
|
71
|
+
selected = a;
|
|
72
|
+
render();
|
|
73
|
+
document.getElementById("selection").hidden = false;
|
|
74
|
+
document.getElementById("selected-text").textContent =
|
|
75
|
+
"“" + a.name + "” · id " + a.id + (a.gender && a.gender !== "unknown" ? " · " + a.gender : "");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function card(a) {
|
|
79
|
+
var thumb = UI.img(a.preview_url || a.thumbnail_url || "", "", UI.initials(a.name));
|
|
80
|
+
if (isPhoto(a)) thumb.appendChild(h("span", { class: "chip info badge-photo" }, ["Photo avatar"]));
|
|
81
|
+
var meta = [SECTION_LABEL[a.section] || a.section];
|
|
82
|
+
if (a.gender && a.gender !== "unknown") meta.push(a.gender);
|
|
83
|
+
if (a.status && a.status !== "ready") meta.push(a.status === "pending" ? "Being made" : a.status);
|
|
84
|
+
return h("button", {
|
|
85
|
+
type: "button", class: "card", role: "listitem", "aria-pressed": String(!!selected && selected.id === a.id),
|
|
86
|
+
"aria-label": a.name + ", " + meta.join(", ") + ", id " + a.id,
|
|
87
|
+
onclick: function () { select(a); }
|
|
88
|
+
}, [
|
|
89
|
+
thumb,
|
|
90
|
+
h("span", { class: "body" }, [
|
|
91
|
+
h("span", { class: "name" }, [a.name || "Unnamed"]),
|
|
92
|
+
h("span", { class: "chips" }, meta.map(function (m) { return h("span", { class: "chip" }, [m]); })
|
|
93
|
+
.concat(a.favorite ? [h("span", { class: "chip", "aria-label": "favorite" }, ["★"])] : [])),
|
|
94
|
+
h("span", { class: "muted" }, ["id " + a.id])
|
|
95
|
+
])
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function createCard() {
|
|
100
|
+
return h("button", { type: "button", class: "card create-card", role: "listitem", onclick: openCreate,
|
|
101
|
+
"aria-label": "Create a new avatar" }, [
|
|
102
|
+
h("span", { class: "thumb" }, [h("span", { "aria-hidden": "true" }, ["+"])]),
|
|
103
|
+
h("span", { class: "body" }, [h("span", { class: "name" }, ["Create a new avatar"]),
|
|
104
|
+
h("span", { class: "muted" }, ["From a 16:9 photo or a description · 55 credits"])])
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function render() {
|
|
109
|
+
document.getElementById("count").textContent = total ? avatars.length + " of " + total + " shown" : "";
|
|
110
|
+
UI.clear(content);
|
|
111
|
+
var any = false;
|
|
112
|
+
GROUPS.forEach(function (g) {
|
|
113
|
+
var rows = visible(g[0]);
|
|
114
|
+
if (!rows.length && g[0] !== "mine") return;
|
|
115
|
+
any = any || rows.length > 0;
|
|
116
|
+
var grid = h("div", { class: "grid", role: "list", "aria-label": g[1] });
|
|
117
|
+
if (g[0] === "mine") grid.appendChild(createCard());
|
|
118
|
+
rows.forEach(function (a) { grid.appendChild(card(a)); });
|
|
119
|
+
content.appendChild(h("section", { class: "list" }, [h("h2", { class: "section-title" }, [g[1]]), grid]));
|
|
120
|
+
});
|
|
121
|
+
if (!any && document.getElementById("filter").value) content.appendChild(h("div", { class: "status" }, ["No avatar matches that filter."]));
|
|
122
|
+
renderMore();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function renderMore() {
|
|
126
|
+
var box = UI.clear(document.getElementById("more"));
|
|
127
|
+
if (avatars.length >= total || !Cliptude.canCallTools()) return;
|
|
128
|
+
box.appendChild(h("button", { type: "button", onclick: loadMore }, ["Show more avatars"]));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function merge(rows) {
|
|
132
|
+
var seen = {};
|
|
133
|
+
avatars.forEach(function (a) { seen[a.id] = true; });
|
|
134
|
+
(rows || []).forEach(function (a) { if (!seen[a.id]) { avatars.push(a); seen[a.id] = true; } });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function loadMore(event) {
|
|
138
|
+
var button = event.currentTarget;
|
|
139
|
+
button.disabled = true;
|
|
140
|
+
var args = {};
|
|
141
|
+
Object.keys(input || {}).forEach(function (k) { args[k] = input[k]; });
|
|
142
|
+
args.offset = (input.offset || 0) + avatars.length;
|
|
143
|
+
args.limit = input.limit || 50;
|
|
144
|
+
Cliptude.callTool("list_avatars", args).then(function (data) {
|
|
145
|
+
merge(data && data.results);
|
|
146
|
+
if (data && data.count) total = data.count;
|
|
147
|
+
render();
|
|
148
|
+
}).catch(function () { button.disabled = false; UI.toast("Could not load more avatars."); });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* ---- Create a new avatar (55 credits, after the user approves the price) ---- */
|
|
152
|
+
function openCreate() {
|
|
153
|
+
if (!Cliptude.canCallTools()) {
|
|
154
|
+
Cliptude.openLink(CREATE_PAGE).then(function () { UI.toast("Opened Create an avatar on cliptude.com."); })
|
|
155
|
+
.catch(function () { UI.toast("Open " + CREATE_PAGE + " to create an avatar."); });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
var panel = document.getElementById("create-panel");
|
|
159
|
+
panel.hidden = false;
|
|
160
|
+
var name = h("input", { type: "text", id: "av-name", maxlength: "100", placeholder: "e.g. Studio me" });
|
|
161
|
+
var gender = h("select", { id: "av-gender" }, [h("option", { value: "" }, ["Detect from photo"]),
|
|
162
|
+
h("option", { value: "female" }, ["Female"]), h("option", { value: "male" }, ["Male"])]);
|
|
163
|
+
var file = h("input", { type: "file", id: "av-photo", accept: "image/jpeg,image/png,image/webp" });
|
|
164
|
+
var desc = h("textarea", { id: "av-desc", maxlength: "1000", placeholder: "Or describe the presenter: a woman in her 30s with short dark hair, navy blazer, bright studio" });
|
|
165
|
+
var preview = h("span", {});
|
|
166
|
+
var go = h("button", { type: "button", class: "primary" }, ["Continue"]);
|
|
167
|
+
var cancel = h("button", { type: "button", onclick: function () { panel.hidden = true; } }, ["Cancel"]);
|
|
168
|
+
var out = h("div", { class: "list" });
|
|
169
|
+
var photo = null;
|
|
170
|
+
file.addEventListener("change", function () {
|
|
171
|
+
photo = null; UI.clear(preview);
|
|
172
|
+
var f = file.files[0];
|
|
173
|
+
if (!f) return;
|
|
174
|
+
if (f.size > 10 * 1024 * 1024) { UI.toast("The photo is over 10 MB."); file.value = ""; return; }
|
|
175
|
+
var reader = new FileReader();
|
|
176
|
+
reader.onload = function () {
|
|
177
|
+
var url = String(reader.result);
|
|
178
|
+
var img = h("img", { class: "photo-preview", src: url, alt: "Selected photo" });
|
|
179
|
+
img.onload = function () {
|
|
180
|
+
var ratio = img.naturalWidth / img.naturalHeight;
|
|
181
|
+
if (Math.abs(ratio - 16 / 9) > 0.08) UI.toast("Avatars are 16:9: use a landscape 16:9 photo (this one is " + img.naturalWidth + "×" + img.naturalHeight + ").");
|
|
182
|
+
Cliptude.reportSize();
|
|
183
|
+
};
|
|
184
|
+
preview.appendChild(img);
|
|
185
|
+
photo = { name: f.name, base64: url.split(",")[1] };
|
|
186
|
+
};
|
|
187
|
+
reader.readAsDataURL(f);
|
|
188
|
+
});
|
|
189
|
+
UI.clear(panel).appendChild(h("h2", {}, ["Create a new avatar"]));
|
|
190
|
+
panel.appendChild(h("span", { class: "sub" }, ["Private to your account. Use a landscape 16:9 photo of yourself, or of someone who agreed to it, or describe the presenter. HeyGen takes a few minutes to finish it."]));
|
|
191
|
+
panel.appendChild(h("div", { class: "toolbar" }, [h("label", { for: "av-name" }, ["Avatar name", name]), h("label", { for: "av-gender" }, ["Gender", gender])]));
|
|
192
|
+
panel.appendChild(h("label", { for: "av-photo" }, ["Photo (JPG, PNG or WEBP, 16:9)", file]));
|
|
193
|
+
panel.appendChild(preview);
|
|
194
|
+
panel.appendChild(h("label", { for: "av-desc" }, ["Description (when there is no photo)", desc]));
|
|
195
|
+
panel.appendChild(h("div", { class: "toolbar" }, [go, cancel]));
|
|
196
|
+
panel.appendChild(out);
|
|
197
|
+
go.addEventListener("click", function () {
|
|
198
|
+
if (!name.value.trim()) { UI.toast("Give the avatar a name."); return; }
|
|
199
|
+
if (!photo && !desc.value.trim()) { UI.toast("Add a photo or a description."); return; }
|
|
200
|
+
if (!photo && !gender.value) { UI.toast("Choose male or female for an avatar made from a description."); return; }
|
|
201
|
+
var args = { display_name: name.value.trim() };
|
|
202
|
+
if (gender.value) args.gender = gender.value;
|
|
203
|
+
if (photo) { args.photo_base64 = photo.base64; args.photo_file_name = photo.name; } else args.appearance = desc.value.trim();
|
|
204
|
+
go.disabled = true;
|
|
205
|
+
UI.status(out, "Checking the price…");
|
|
206
|
+
Cliptude.callTool("create_avatar", args).then(function (res) { go.disabled = false; handleCreate(res, args, out); })
|
|
207
|
+
.catch(function () { go.disabled = false; UI.status(out, "Could not reach Cliptude.", "error"); });
|
|
208
|
+
});
|
|
209
|
+
Cliptude.reportSize();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function handleCreate(res, args, out) {
|
|
213
|
+
if (res && res.status === 428 && res.detail && res.detail.review) { showReview(res.detail, args, out); return; }
|
|
214
|
+
var err = UI.errorText(res);
|
|
215
|
+
if (err) {
|
|
216
|
+
var detail = (res && res.detail) || {};
|
|
217
|
+
UI.status(out, detail.code === "insufficient_credits"
|
|
218
|
+
? "Not enough credits: " + (detail.credits_required || 55) + " needed, " + (detail.credits_available || 0) + " available."
|
|
219
|
+
: err, "error");
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
var a = res.avatar || {};
|
|
223
|
+
a.status = a.status || "pending";
|
|
224
|
+
avatars.unshift(a);
|
|
225
|
+
document.getElementById("create-panel").hidden = true;
|
|
226
|
+
render();
|
|
227
|
+
UI.toast("Avatar requested. It appears under Yours once HeyGen finishes it.");
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function showReview(detail, args, out) {
|
|
231
|
+
var review = detail.review;
|
|
232
|
+
var credits = review.credits || {};
|
|
233
|
+
var dl = h("dl", {});
|
|
234
|
+
(review.settings || []).forEach(function (s) { dl.appendChild(h("dt", {}, [s.label])); dl.appendChild(h("dd", {}, [String(s.value)])); });
|
|
235
|
+
dl.appendChild(h("dt", {}, ["Price"]));
|
|
236
|
+
dl.appendChild(h("dd", {}, [credits.credits_required + " credits (you have " + credits.credits_available + ")"]));
|
|
237
|
+
var confirm = h("button", { type: "button", class: "primary", disabled: credits.enough_credits === false },
|
|
238
|
+
["Create for " + credits.credits_required + " credits"]);
|
|
239
|
+
confirm.addEventListener("click", function () {
|
|
240
|
+
confirm.disabled = true; confirm.textContent = "Creating…";
|
|
241
|
+
var again = {}; Object.keys(args).forEach(function (k) { again[k] = args[k]; });
|
|
242
|
+
again.review_token = detail.review_token;
|
|
243
|
+
Cliptude.callTool("create_avatar", again).then(function (res) { handleCreate(res, args, out); })
|
|
244
|
+
.catch(function () { UI.status(out, "Could not reach Cliptude.", "error"); });
|
|
245
|
+
});
|
|
246
|
+
UI.clear(out).appendChild(h("div", { class: "panel review", role: "group", "aria-label": "Review" }, [
|
|
247
|
+
h("strong", {}, ["Review before creating"]), dl,
|
|
248
|
+
h("ul", { class: "sub" }, (review.warnings || []).map(function (w) { return h("li", {}, [w]); })),
|
|
249
|
+
credits.enough_credits === false ? h("span", { class: "status error" }, ["Not enough credits. Top up on cliptude.com first."]) : null,
|
|
250
|
+
h("div", { class: "toolbar" }, [confirm])
|
|
251
|
+
]));
|
|
252
|
+
Cliptude.reportSize();
|
|
253
|
+
confirm.scrollIntoView({ block: "nearest" });
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
document.getElementById("filter").addEventListener("input", render);
|
|
257
|
+
document.getElementById("use").addEventListener("click", function () {
|
|
258
|
+
if (!selected) return;
|
|
259
|
+
UI.choose(
|
|
260
|
+
"Use the avatar “" + selected.name + "” (avatar_profile_id " + selected.id + ") as the presenter.",
|
|
261
|
+
{ avatar_profile_id: selected.id, avatar_name: selected.name }
|
|
262
|
+
);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
Cliptude.connect({
|
|
266
|
+
name: "cliptude-avatar-picker",
|
|
267
|
+
onInput: function (args) { input = args || {}; },
|
|
268
|
+
onResult: function (data) {
|
|
269
|
+
var err = UI.errorText(data);
|
|
270
|
+
if (err) { UI.status(content, err, "error"); return; }
|
|
271
|
+
avatars = (data.results || []).slice();
|
|
272
|
+
total = data.count || avatars.length;
|
|
273
|
+
render();
|
|
274
|
+
// The user's own avatars may sit past the first page of a mixed list: fetch them so Yours is complete.
|
|
275
|
+
if (!input.section && Cliptude.canCallTools()) {
|
|
276
|
+
Cliptude.callTool("list_avatars", { section: "mine", limit: 100 }).then(function (mine) {
|
|
277
|
+
merge(mine && mine.results);
|
|
278
|
+
render();
|
|
279
|
+
}).catch(function () {});
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
onCancelled: function () { UI.status(content, "The avatar list was cancelled."); }
|
|
283
|
+
}).catch(function () { UI.status(content, "This view could not connect to the chat.", "error"); });
|
|
284
|
+
})();
|
|
285
|
+
</script>
|
|
286
|
+
</body>
|
|
287
|
+
</html>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* Shared look of the Cliptude MCP Apps. Host variables (ui/initialize hostContext.styles.variables) override
|
|
2
|
+
these defaults; the defaults follow the host theme through color-scheme + light-dark(). */
|
|
3
|
+
:root {
|
|
4
|
+
color-scheme: light dark;
|
|
5
|
+
--color-background-primary: light-dark(#ffffff, #1c1c1e);
|
|
6
|
+
--color-background-secondary: light-dark(#f4f4f5, #26262a);
|
|
7
|
+
--color-background-tertiary: light-dark(#e9e9ec, #303036);
|
|
8
|
+
--color-text-primary: light-dark(#18181b, #f4f4f5);
|
|
9
|
+
--color-text-secondary: light-dark(#52525b, #b4b4bb);
|
|
10
|
+
--color-text-tertiary: light-dark(#71717a, #8e8e96);
|
|
11
|
+
--color-border-primary: light-dark(#d4d4d8, #3f3f46);
|
|
12
|
+
--color-border-secondary: light-dark(#e4e4e7, #34343a);
|
|
13
|
+
--color-ring-primary: light-dark(#2563eb, #60a5fa);
|
|
14
|
+
--color-text-info: light-dark(#1d4ed8, #93c5fd);
|
|
15
|
+
--color-background-info: light-dark(#eff6ff, #172554);
|
|
16
|
+
--color-text-danger: light-dark(#b91c1c, #fca5a5);
|
|
17
|
+
--color-text-success: light-dark(#15803d, #86efac);
|
|
18
|
+
--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
19
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
20
|
+
--font-text-xs-size: 12px;
|
|
21
|
+
--font-text-sm-size: 13px;
|
|
22
|
+
--font-text-md-size: 14px;
|
|
23
|
+
--font-heading-sm-size: 16px;
|
|
24
|
+
--border-radius-sm: 6px;
|
|
25
|
+
--border-radius-md: 10px;
|
|
26
|
+
--border-radius-lg: 14px;
|
|
27
|
+
--border-radius-full: 999px;
|
|
28
|
+
--accent: var(--color-ring-primary);
|
|
29
|
+
}
|
|
30
|
+
:root[data-theme="dark"] { color-scheme: dark; }
|
|
31
|
+
:root[data-theme="light"] { color-scheme: light; }
|
|
32
|
+
* { box-sizing: border-box; }
|
|
33
|
+
[hidden] { display: none !important; }
|
|
34
|
+
html, body { margin: 0; padding: 0; }
|
|
35
|
+
body {
|
|
36
|
+
background: var(--color-background-primary);
|
|
37
|
+
color: var(--color-text-primary);
|
|
38
|
+
font-family: var(--font-sans);
|
|
39
|
+
font-size: var(--font-text-md-size);
|
|
40
|
+
line-height: 1.45;
|
|
41
|
+
-webkit-font-smoothing: antialiased;
|
|
42
|
+
}
|
|
43
|
+
.app { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
|
|
44
|
+
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
|
|
45
|
+
.head h1 { font-size: var(--font-heading-sm-size); margin: 0; font-weight: 600; }
|
|
46
|
+
.sub { color: var(--color-text-secondary); font-size: var(--font-text-sm-size); }
|
|
47
|
+
.muted { color: var(--color-text-tertiary); font-size: var(--font-text-xs-size); }
|
|
48
|
+
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
|
|
49
|
+
input[type="search"], select {
|
|
50
|
+
font: inherit; font-size: var(--font-text-sm-size); color: var(--color-text-primary);
|
|
51
|
+
background: var(--color-background-secondary); border: 1px solid var(--color-border-primary);
|
|
52
|
+
border-radius: var(--border-radius-sm); padding: 7px 10px; min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
input[type="search"] { flex: 1 1 180px; }
|
|
55
|
+
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, .card:focus-visible {
|
|
56
|
+
outline: 2px solid var(--accent); outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
button {
|
|
59
|
+
font: inherit; font-size: var(--font-text-sm-size); cursor: pointer; border-radius: var(--border-radius-sm);
|
|
60
|
+
border: 1px solid var(--color-border-primary); background: var(--color-background-secondary);
|
|
61
|
+
color: var(--color-text-primary); padding: 6px 11px; line-height: 1.2;
|
|
62
|
+
}
|
|
63
|
+
button:hover { background: var(--color-background-tertiary); }
|
|
64
|
+
button:disabled { opacity: .5; cursor: default; }
|
|
65
|
+
button.primary { background: var(--accent); border-color: var(--accent); color: light-dark(#ffffff, #0b1220); font-weight: 600; }
|
|
66
|
+
button.primary:hover { filter: brightness(1.08); }
|
|
67
|
+
button.icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--border-radius-full); flex: none; }
|
|
68
|
+
button.icon svg { width: 16px; height: 16px; fill: currentColor; }
|
|
69
|
+
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
70
|
+
.chip {
|
|
71
|
+
font-size: var(--font-text-xs-size); padding: 2px 8px; border-radius: var(--border-radius-full);
|
|
72
|
+
background: var(--color-background-tertiary); color: var(--color-text-secondary); max-width: 100%; overflow-wrap: anywhere;
|
|
73
|
+
}
|
|
74
|
+
.chip.info { background: var(--color-background-info); color: var(--color-text-info); }
|
|
75
|
+
button.chip { border: 1px solid transparent; cursor: pointer; }
|
|
76
|
+
button.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--color-text-primary); }
|
|
77
|
+
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
|
|
78
|
+
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
|
|
79
|
+
.card {
|
|
80
|
+
background: var(--color-background-secondary); border: 1px solid var(--color-border-secondary);
|
|
81
|
+
border-radius: var(--border-radius-md); overflow: hidden; display: flex; flex-direction: column;
|
|
82
|
+
cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit;
|
|
83
|
+
}
|
|
84
|
+
.card:hover { border-color: var(--color-border-primary); }
|
|
85
|
+
.card[aria-pressed="true"], .row[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
|
86
|
+
.card .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
|
|
87
|
+
.card .name { font-weight: 600; font-size: var(--font-text-sm-size); overflow-wrap: anywhere; }
|
|
88
|
+
.thumb { aspect-ratio: 1 / 1; background: var(--color-background-tertiary); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
|
|
89
|
+
.thumb.r16x9 { aspect-ratio: 16 / 9; }
|
|
90
|
+
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
91
|
+
.thumb-fallback { font-size: 28px; font-weight: 600; color: var(--color-text-tertiary); }
|
|
92
|
+
.list { display: flex; flex-direction: column; gap: 6px; }
|
|
93
|
+
.row {
|
|
94
|
+
display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--border-radius-md);
|
|
95
|
+
background: var(--color-background-secondary); border: 1px solid var(--color-border-secondary);
|
|
96
|
+
}
|
|
97
|
+
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
|
|
98
|
+
.row .name { font-weight: 600; overflow-wrap: anywhere; }
|
|
99
|
+
.row .desc { color: var(--color-text-secondary); font-size: var(--font-text-sm-size); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
100
|
+
.selection {
|
|
101
|
+
position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; justify-content: space-between;
|
|
102
|
+
padding: 10px 12px; border-radius: var(--border-radius-md); background: var(--color-background-tertiary);
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
}
|
|
105
|
+
.selection .what { font-size: var(--font-text-sm-size); min-width: 0; overflow-wrap: anywhere; }
|
|
106
|
+
.status { padding: 18px 12px; text-align: center; color: var(--color-text-secondary); border: 1px dashed var(--color-border-primary); border-radius: var(--border-radius-md); }
|
|
107
|
+
.status.error { color: var(--color-text-danger); border-color: currentColor; }
|
|
108
|
+
.section-title { font-size: var(--font-text-xs-size); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-tertiary); margin: 4px 0 -2px; }
|
|
109
|
+
.swatches { display: flex; gap: 4px; }
|
|
110
|
+
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--color-border-primary); }
|
|
111
|
+
#toast {
|
|
112
|
+
position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%) translateY(20px); opacity: 0;
|
|
113
|
+
background: var(--color-text-primary); color: var(--color-background-primary); padding: 8px 14px;
|
|
114
|
+
border-radius: var(--border-radius-full); font-size: var(--font-text-sm-size); transition: all .2s; pointer-events: none;
|
|
115
|
+
max-width: calc(100% - 24px); text-align: center;
|
|
116
|
+
}
|
|
117
|
+
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
|
|
118
|
+
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
119
|
+
@media (max-width: 420px) {
|
|
120
|
+
.grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
|
|
121
|
+
.app { padding: 10px; }
|
|
122
|
+
}
|
|
123
|
+
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
|