@invergent/agent-chat-react 2.11.0 → 2.11.1
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/dist/index.cjs +2819 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +103 -5
- package/dist/index.d.ts +103 -5
- package/dist/index.js +2692 -175
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn, __publicField } from './chunk-47MF6JUW.js';
|
|
2
|
-
import { createContext, memo, useRef, useEffect, useCallback, useMemo, useState, useLayoutEffect, lazy, useContext, Fragment as Fragment$1, Children, Suspense } from 'react';
|
|
2
|
+
import { createContext, memo, useRef, useEffect, useCallback, useMemo, useState, useLayoutEffect, forwardRef, useId, lazy, useContext, useSyncExternalStore, Fragment as Fragment$1, Children, Suspense } from 'react';
|
|
3
3
|
import { ChevronDownIcon, AlertTriangle, ChevronDown, ChevronRight, RefreshCw, CreditCard, File as File$1, FileImage, FileAudio, FileVideo, FileText, FileCode, FileArchive, FileSpreadsheet, PlugZapIcon, ChevronRightIcon, ArrowLeftIcon, Loader2Icon, InboxIcon, Loader2, AlertCircle, Pause, Play, Ban, TargetIcon, CalendarClockIcon, UsersIcon, MessageSquareIcon, ZapIcon, Maximize2Icon, FolderOpenIcon, UploadIcon, RefreshCwIcon, AlertCircleIcon, ExternalLinkIcon, ClipboardCheckIcon, ShieldAlertIcon, TimerIcon, CircleDotIcon, XIcon, Trash2Icon, SquareIcon, ArrowDownIcon, RotateCcwIcon, MousePointer2Icon, DownloadIcon, TrashIcon, ImageIcon, FileTextIcon, CheckIcon, Clock, ArrowRight, TerminalIcon, SparklesIcon, ClockIcon, PlusIcon, CloudIcon, HardDriveIcon, PaperclipIcon, GlobeIcon, IdCardIcon, FolderIcon, CopyIcon, FileIcon, ChevronLeftIcon, MinusIcon, SearchIcon, CircleDot, XCircle, CheckCircle2, ArrowUpIcon, CircleCheckIcon, ThumbsUpIcon, ThumbsDownIcon, BookOpenIcon, GitBranchIcon, ActivityIcon, EyeIcon, ListTodoIcon, BotIcon, ListIcon, PenLineIcon, FileEditIcon, WrenchIcon, FileCodeIcon, CodeIcon, FileArchiveIcon, FileVideoIcon, FileAudioIcon, FileImageIcon, FileChartLineIcon, FileSpreadsheetIcon, XCircleIcon, CheckCircle2Icon, Code, CircleXIcon, SkullIcon, CheckCircleIcon, CircleIcon } from 'lucide-react';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { Collapsible as Collapsible$1, Slot, Tooltip as Tooltip$1, Progress as Progress$1, Tabs as Tabs$1, Dialog as Dialog$1, ScrollArea as ScrollArea$1, Popover as Popover$1 } from 'radix-ui';
|
|
@@ -11,6 +11,7 @@ import { math } from '@streamdown/math';
|
|
|
11
11
|
import { mermaid } from '@streamdown/mermaid';
|
|
12
12
|
import { Streamdown } from 'streamdown';
|
|
13
13
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
14
|
+
import { ThinkingOrb } from 'thinking-orbs';
|
|
14
15
|
import { createHighlighter } from 'shiki';
|
|
15
16
|
import { diffLines, diffWordsWithSpace } from 'diff';
|
|
16
17
|
import AnsiImport from 'ansi-to-react';
|
|
@@ -1047,6 +1048,18 @@ var ShimmerComponent = ({
|
|
|
1047
1048
|
);
|
|
1048
1049
|
};
|
|
1049
1050
|
var Shimmer = memo(ShimmerComponent);
|
|
1051
|
+
function OrbShimmerLabel({
|
|
1052
|
+
state,
|
|
1053
|
+
label,
|
|
1054
|
+
duration = 3,
|
|
1055
|
+
spread = 3,
|
|
1056
|
+
className
|
|
1057
|
+
}) {
|
|
1058
|
+
return /* @__PURE__ */ jsxs("span", { className: cn("flex items-center gap-2", className), children: [
|
|
1059
|
+
/* @__PURE__ */ jsx(ThinkingOrb, { state, size: 20, "aria-hidden": true }),
|
|
1060
|
+
/* @__PURE__ */ jsx(Shimmer, { duration, spread, className: "text-sm", children: label })
|
|
1061
|
+
] });
|
|
1062
|
+
}
|
|
1050
1063
|
var ReasoningContext = createContext(null);
|
|
1051
1064
|
var useReasoning = () => {
|
|
1052
1065
|
const context = useContext(ReasoningContext);
|
|
@@ -1116,7 +1129,7 @@ var Reasoning = memo(
|
|
|
1116
1129
|
);
|
|
1117
1130
|
var defaultGetThinkingMessage = (isStreaming, duration) => {
|
|
1118
1131
|
if (isStreaming || duration === 0) {
|
|
1119
|
-
return /* @__PURE__ */ jsx(
|
|
1132
|
+
return /* @__PURE__ */ jsx(OrbShimmerLabel, { state: "solving", label: "Thinking...", duration: 1 });
|
|
1120
1133
|
}
|
|
1121
1134
|
if (duration === void 0) {
|
|
1122
1135
|
return /* @__PURE__ */ jsx("p", { className: "text-muted-foreground italic", children: "Thought for a few seconds" });
|
|
@@ -1306,6 +1319,123 @@ function TimelineSeparator({
|
|
|
1306
1319
|
}
|
|
1307
1320
|
);
|
|
1308
1321
|
}
|
|
1322
|
+
|
|
1323
|
+
// src/runtime/orb-state.ts
|
|
1324
|
+
var ORB_STATE_LABELS = {
|
|
1325
|
+
working: "Working on it...",
|
|
1326
|
+
searching: "Searching\u2026",
|
|
1327
|
+
solving: "Solving\u2026",
|
|
1328
|
+
listening: "Waiting for your answer\u2026",
|
|
1329
|
+
composing: "Writing\u2026",
|
|
1330
|
+
shaping: "Shaping\u2026"
|
|
1331
|
+
};
|
|
1332
|
+
var TOOL_ORB_STATES = {
|
|
1333
|
+
// Retrieval: the scan-meridian globe.
|
|
1334
|
+
web_search: "searching",
|
|
1335
|
+
web_extract: "searching",
|
|
1336
|
+
web_crawl: "searching",
|
|
1337
|
+
session_search: "searching",
|
|
1338
|
+
kb_list_pages: "searching",
|
|
1339
|
+
kb_read_page: "searching",
|
|
1340
|
+
search_files: "searching",
|
|
1341
|
+
list_files: "searching",
|
|
1342
|
+
research_memory: "searching",
|
|
1343
|
+
fetch_channel_messages: "searching",
|
|
1344
|
+
fetch_channel_file: "searching",
|
|
1345
|
+
// Creation/authoring: the circle→triangle→square morph.
|
|
1346
|
+
write_file: "shaping",
|
|
1347
|
+
patch: "shaping",
|
|
1348
|
+
create_artifact: "shaping",
|
|
1349
|
+
generate_image: "shaping",
|
|
1350
|
+
generate_video: "shaping",
|
|
1351
|
+
skill_manage: "shaping",
|
|
1352
|
+
research_outline: "shaping",
|
|
1353
|
+
// Heavy analysis/computation: bands scramble, then click back solved.
|
|
1354
|
+
run_coding_agent: "solving",
|
|
1355
|
+
consult_expert: "solving",
|
|
1356
|
+
vision_analyze: "solving",
|
|
1357
|
+
idea_tree: "solving",
|
|
1358
|
+
dispatch_experiments: "solving",
|
|
1359
|
+
merge_experiment: "solving",
|
|
1360
|
+
// Waiting on the user: the waveform.
|
|
1361
|
+
ask_user_question: "listening"
|
|
1362
|
+
};
|
|
1363
|
+
var MCP_TOOL_PREFIX = "mcp__";
|
|
1364
|
+
var MCP_SEARCHING_RE = /(?:^|_)(?:search|query|find|lookup|fetch|list|read|get)(?:_|$)/;
|
|
1365
|
+
var MCP_SHAPING_RE = /(?:^|_)(?:write|create|generate|edit|update|build|make)(?:_|$)/;
|
|
1366
|
+
function toolOrbState(toolName) {
|
|
1367
|
+
const mapped = TOOL_ORB_STATES[toolName];
|
|
1368
|
+
if (mapped) return mapped;
|
|
1369
|
+
if (toolName.startsWith(MCP_TOOL_PREFIX)) {
|
|
1370
|
+
const leaf = toolName.split("__").pop() ?? "";
|
|
1371
|
+
if (MCP_SEARCHING_RE.test(leaf)) return "searching";
|
|
1372
|
+
if (MCP_SHAPING_RE.test(leaf)) return "shaping";
|
|
1373
|
+
}
|
|
1374
|
+
return "working";
|
|
1375
|
+
}
|
|
1376
|
+
function lastRunningToolCall(message, toolFilter) {
|
|
1377
|
+
const calls = message.toolCalls ?? [];
|
|
1378
|
+
for (let i = calls.length - 1; i >= 0; i--) {
|
|
1379
|
+
const tc = calls[i];
|
|
1380
|
+
if (tc && tc.status === "running" && (!toolFilter || toolFilter(tc))) {
|
|
1381
|
+
return tc;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return void 0;
|
|
1385
|
+
}
|
|
1386
|
+
function messageOrbState(message, options = {}) {
|
|
1387
|
+
if (message.toolCalls?.some(
|
|
1388
|
+
(tc) => tc.toolName === "ask_user_question" && tc.status === "running"
|
|
1389
|
+
)) {
|
|
1390
|
+
return "listening";
|
|
1391
|
+
}
|
|
1392
|
+
const running = lastRunningToolCall(message, options.toolFilter);
|
|
1393
|
+
if (running) return toolOrbState(running.toolName);
|
|
1394
|
+
if (message.toolCalls?.some((tc) => tc.status === "running")) {
|
|
1395
|
+
return "working";
|
|
1396
|
+
}
|
|
1397
|
+
if (message.status !== "streaming") return "working";
|
|
1398
|
+
if (message.content.length > 0) return "composing";
|
|
1399
|
+
if (message.reasoning && message.reasoning.length > 0) return "solving";
|
|
1400
|
+
return "working";
|
|
1401
|
+
}
|
|
1402
|
+
function deriveOrbActivity(messages, options = {}) {
|
|
1403
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1404
|
+
const m = messages[i];
|
|
1405
|
+
if (!m) continue;
|
|
1406
|
+
if (m.role === "user") break;
|
|
1407
|
+
if (m.role !== "assistant") continue;
|
|
1408
|
+
const state = messageOrbState(m, options);
|
|
1409
|
+
return { state, label: ORB_STATE_LABELS[state] };
|
|
1410
|
+
}
|
|
1411
|
+
return { state: "working", label: ORB_STATE_LABELS.working };
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
// src/runtime/simple-mode.ts
|
|
1415
|
+
var SIMPLE_MODE_HIDDEN_TOOLS = /* @__PURE__ */ new Set([
|
|
1416
|
+
"list_files",
|
|
1417
|
+
"search_files",
|
|
1418
|
+
"session_search",
|
|
1419
|
+
"skills_list",
|
|
1420
|
+
"skill_view",
|
|
1421
|
+
"skill_manage",
|
|
1422
|
+
"process",
|
|
1423
|
+
"memory",
|
|
1424
|
+
// Shell commands and code execution are infrastructure plumbing the
|
|
1425
|
+
// user doesn't need to see when the goal is to know *what* the
|
|
1426
|
+
// agent accomplished, not *how*. Expert mode still has the full
|
|
1427
|
+
// command + output block.
|
|
1428
|
+
"terminal",
|
|
1429
|
+
"execute_code"
|
|
1430
|
+
]);
|
|
1431
|
+
function isHiddenSimpleTool(tc) {
|
|
1432
|
+
if (SIMPLE_MODE_HIDDEN_TOOLS.has(tc.toolName)) return true;
|
|
1433
|
+
if (tc.toolName.startsWith("browser_")) return true;
|
|
1434
|
+
return false;
|
|
1435
|
+
}
|
|
1436
|
+
var SIMPLE_MODE_ORB_OPTIONS = {
|
|
1437
|
+
toolFilter: (tc) => !isHiddenSimpleTool(tc)
|
|
1438
|
+
};
|
|
1309
1439
|
function BrowserActivityGroup({ calls }) {
|
|
1310
1440
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border border-line bg-card px-3 py-2 text-xs", children: [
|
|
1311
1441
|
/* @__PURE__ */ jsx(ZapIcon, { className: "size-3 shrink-0 text-amber-500", "aria-hidden": "true" }),
|
|
@@ -3941,7 +4071,34 @@ function AskUserQuestionToolBlock({ tc }) {
|
|
|
3941
4071
|
() => questions.map((q, i) => buildAnswer(q, selections[i] ?? emptySelection())),
|
|
3942
4072
|
[questions, selections]
|
|
3943
4073
|
);
|
|
3944
|
-
const
|
|
4074
|
+
const answeredCount = answers.filter((a) => a !== null).length;
|
|
4075
|
+
const allAnswered = answeredCount === questions.length;
|
|
4076
|
+
const nextUnanswered = useCallback(
|
|
4077
|
+
(from) => {
|
|
4078
|
+
for (let step = 1; step < questions.length; step++) {
|
|
4079
|
+
const i = (from + step) % questions.length;
|
|
4080
|
+
if (answers[i] === null) return i;
|
|
4081
|
+
}
|
|
4082
|
+
return null;
|
|
4083
|
+
},
|
|
4084
|
+
[questions.length, answers]
|
|
4085
|
+
);
|
|
4086
|
+
const selectChoice = useCallback(
|
|
4087
|
+
(choiceIndex) => {
|
|
4088
|
+
const wasAnswered = answers[active] !== null;
|
|
4089
|
+
const copy = selections.slice();
|
|
4090
|
+
copy[active] = { index: choiceIndex, other: "" };
|
|
4091
|
+
setSelections(copy);
|
|
4092
|
+
if (wasAnswered) return;
|
|
4093
|
+
const next = nextUnanswered(active);
|
|
4094
|
+
if (next !== null) setActive(next);
|
|
4095
|
+
},
|
|
4096
|
+
[active, answers, selections, nextUnanswered]
|
|
4097
|
+
);
|
|
4098
|
+
const advance = useCallback(() => {
|
|
4099
|
+
const next = nextUnanswered(active);
|
|
4100
|
+
if (next !== null) setActive(next);
|
|
4101
|
+
}, [active, nextUnanswered]);
|
|
3945
4102
|
const handleSubmit = useCallback(async () => {
|
|
3946
4103
|
if (!sessionId || locked || submitting) return;
|
|
3947
4104
|
if (!allAnswered) {
|
|
@@ -4019,7 +4176,7 @@ function AskUserQuestionToolBlock({ tc }) {
|
|
|
4019
4176
|
"Question ",
|
|
4020
4177
|
i + 1
|
|
4021
4178
|
] }),
|
|
4022
|
-
answered &&
|
|
4179
|
+
answered && /* @__PURE__ */ jsx("span", { className: "ml-1 text-[10px] text-emerald-500", children: "\u25CF" }),
|
|
4023
4180
|
isActive && /* @__PURE__ */ jsx("span", { className: "absolute inset-x-0 bottom-0 h-px bg-foreground" })
|
|
4024
4181
|
]
|
|
4025
4182
|
},
|
|
@@ -4045,7 +4202,7 @@ function AskUserQuestionToolBlock({ tc }) {
|
|
|
4045
4202
|
{
|
|
4046
4203
|
choice,
|
|
4047
4204
|
selected: currentSel.index === i,
|
|
4048
|
-
onSelect: () =>
|
|
4205
|
+
onSelect: () => selectChoice(i)
|
|
4049
4206
|
},
|
|
4050
4207
|
i
|
|
4051
4208
|
)),
|
|
@@ -4055,32 +4212,50 @@ function AskUserQuestionToolBlock({ tc }) {
|
|
|
4055
4212
|
selected: currentSel.index >= OTHER_INDEX_OFFSET,
|
|
4056
4213
|
value: currentSel.other,
|
|
4057
4214
|
onSelect: () => updateSelection({ index: OTHER_INDEX_OFFSET }),
|
|
4058
|
-
onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v })
|
|
4215
|
+
onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v }),
|
|
4216
|
+
onCommit: () => {
|
|
4217
|
+
if (allAnswered) void handleSubmit();
|
|
4218
|
+
else advance();
|
|
4219
|
+
}
|
|
4059
4220
|
}
|
|
4060
4221
|
)
|
|
4061
4222
|
] }),
|
|
4062
|
-
/* @__PURE__ */ jsxs("div", { className: "border-t border-border px-3 py-2", children: [
|
|
4063
|
-
/* @__PURE__ */ jsxs(
|
|
4223
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-3 py-2", children: [
|
|
4224
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 text-xs text-muted-foreground", children: [
|
|
4225
|
+
questions.length > 1 && /* @__PURE__ */ jsxs("span", { className: "mr-2 tabular-nums", children: [
|
|
4226
|
+
answeredCount,
|
|
4227
|
+
" of ",
|
|
4228
|
+
questions.length,
|
|
4229
|
+
" answered"
|
|
4230
|
+
] }),
|
|
4231
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70", children: "Esc to cancel" }),
|
|
4232
|
+
error && /* @__PURE__ */ jsx("span", { className: "ml-2 text-destructive", children: error })
|
|
4233
|
+
] }),
|
|
4234
|
+
allAnswered || questions.length === 1 ? /* @__PURE__ */ jsx(
|
|
4064
4235
|
"button",
|
|
4065
4236
|
{
|
|
4066
4237
|
type: "button",
|
|
4067
4238
|
disabled: !allAnswered || submitting,
|
|
4068
4239
|
onClick: () => void handleSubmit(),
|
|
4069
4240
|
className: cn(
|
|
4070
|
-
"
|
|
4071
|
-
"
|
|
4072
|
-
"disabled:cursor-not-allowed disabled:opacity-
|
|
4241
|
+
"shrink-0 rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground transition-colors",
|
|
4242
|
+
"hover:bg-primary/80",
|
|
4243
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
4073
4244
|
),
|
|
4074
|
-
children:
|
|
4075
|
-
/* @__PURE__ */ jsx("span", { className: "mr-2 text-muted-foreground/70", children: answers.filter((a) => a !== null).length }),
|
|
4076
|
-
submitting ? "Submitting\u2026" : allAnswered ? "Submit answers" : `Answer ${questions.length - answers.filter((a) => a !== null).length} more to submit`
|
|
4077
|
-
]
|
|
4245
|
+
children: submitting ? "Submitting\u2026" : "Submit"
|
|
4078
4246
|
}
|
|
4079
|
-
)
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4247
|
+
) : /* @__PURE__ */ jsx(
|
|
4248
|
+
"button",
|
|
4249
|
+
{
|
|
4250
|
+
type: "button",
|
|
4251
|
+
onClick: advance,
|
|
4252
|
+
className: cn(
|
|
4253
|
+
"shrink-0 rounded-md border border-border bg-muted/40 px-4 py-1.5 text-sm font-medium text-foreground transition-colors",
|
|
4254
|
+
"hover:bg-muted"
|
|
4255
|
+
),
|
|
4256
|
+
children: "Next question \u2192"
|
|
4257
|
+
}
|
|
4258
|
+
)
|
|
4084
4259
|
] })
|
|
4085
4260
|
]
|
|
4086
4261
|
}
|
|
@@ -4114,7 +4289,8 @@ function OtherRow({
|
|
|
4114
4289
|
selected,
|
|
4115
4290
|
value,
|
|
4116
4291
|
onSelect,
|
|
4117
|
-
onChange
|
|
4292
|
+
onChange,
|
|
4293
|
+
onCommit
|
|
4118
4294
|
}) {
|
|
4119
4295
|
return /* @__PURE__ */ jsxs(
|
|
4120
4296
|
"div",
|
|
@@ -4143,6 +4319,12 @@ function OtherRow({
|
|
|
4143
4319
|
value,
|
|
4144
4320
|
onFocus: onSelect,
|
|
4145
4321
|
onChange: (e) => onChange(e.target.value),
|
|
4322
|
+
onKeyDown: (e) => {
|
|
4323
|
+
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && value.trim()) {
|
|
4324
|
+
e.preventDefault();
|
|
4325
|
+
onCommit();
|
|
4326
|
+
}
|
|
4327
|
+
},
|
|
4146
4328
|
className: "mt-0.5 h-7 px-0 text-xs"
|
|
4147
4329
|
}
|
|
4148
4330
|
)
|
|
@@ -5060,6 +5242,2299 @@ function CommandItem({
|
|
|
5060
5242
|
function Spinner({ className, ...props }) {
|
|
5061
5243
|
return /* @__PURE__ */ jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn("size-4 animate-spin", className), ...props });
|
|
5062
5244
|
}
|
|
5245
|
+
|
|
5246
|
+
// src/components/ui/border-beam/styles.ts
|
|
5247
|
+
var sizePresets = {
|
|
5248
|
+
sm: {
|
|
5249
|
+
borderRadius: 32,
|
|
5250
|
+
borderWidth: 1,
|
|
5251
|
+
width: 70,
|
|
5252
|
+
height: 36
|
|
5253
|
+
},
|
|
5254
|
+
md: {
|
|
5255
|
+
borderRadius: 16,
|
|
5256
|
+
borderWidth: 1
|
|
5257
|
+
},
|
|
5258
|
+
line: {
|
|
5259
|
+
borderRadius: 16,
|
|
5260
|
+
borderWidth: 1
|
|
5261
|
+
},
|
|
5262
|
+
"pulse-outside": {
|
|
5263
|
+
borderRadius: 16,
|
|
5264
|
+
borderWidth: 1
|
|
5265
|
+
},
|
|
5266
|
+
"pulse-inner": {
|
|
5267
|
+
borderRadius: 16,
|
|
5268
|
+
borderWidth: 1
|
|
5269
|
+
}
|
|
5270
|
+
};
|
|
5271
|
+
var sizeThemePresets = {
|
|
5272
|
+
sm: {
|
|
5273
|
+
dark: {
|
|
5274
|
+
strokeOpacity: 0.46,
|
|
5275
|
+
innerOpacity: 0.24,
|
|
5276
|
+
bloomOpacity: 0.38,
|
|
5277
|
+
innerShadow: "rgba(255, 255, 255, 0.3)",
|
|
5278
|
+
saturation: 1.2
|
|
5279
|
+
},
|
|
5280
|
+
light: {
|
|
5281
|
+
strokeOpacity: 0.12,
|
|
5282
|
+
innerOpacity: 0.3,
|
|
5283
|
+
bloomOpacity: 0.16,
|
|
5284
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
5285
|
+
saturation: 1.8
|
|
5286
|
+
}
|
|
5287
|
+
},
|
|
5288
|
+
md: {
|
|
5289
|
+
dark: {
|
|
5290
|
+
strokeOpacity: 0.26,
|
|
5291
|
+
innerOpacity: 0.42,
|
|
5292
|
+
bloomOpacity: 0.24,
|
|
5293
|
+
innerShadow: "rgba(255, 255, 255, 0.27)",
|
|
5294
|
+
saturation: 1.2
|
|
5295
|
+
},
|
|
5296
|
+
light: {
|
|
5297
|
+
strokeOpacity: 0.12,
|
|
5298
|
+
innerOpacity: 0.26,
|
|
5299
|
+
bloomOpacity: 0.34,
|
|
5300
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
5301
|
+
saturation: 1.5
|
|
5302
|
+
}
|
|
5303
|
+
},
|
|
5304
|
+
line: {
|
|
5305
|
+
dark: {
|
|
5306
|
+
strokeOpacity: 1.14,
|
|
5307
|
+
innerOpacity: 0.7,
|
|
5308
|
+
bloomOpacity: 0.8,
|
|
5309
|
+
innerShadow: "rgba(255, 255, 255, 0.1)",
|
|
5310
|
+
saturation: 1.2
|
|
5311
|
+
},
|
|
5312
|
+
light: {
|
|
5313
|
+
strokeOpacity: 0.16,
|
|
5314
|
+
innerOpacity: 0.32,
|
|
5315
|
+
bloomOpacity: 0.3,
|
|
5316
|
+
innerShadow: "rgba(0, 0, 0, 0.14)",
|
|
5317
|
+
saturation: 1.95
|
|
5318
|
+
}
|
|
5319
|
+
},
|
|
5320
|
+
// Pulse Outside — outward-blooming breathe (ported from v5 "Breathe Outside Uncropped" / c6)
|
|
5321
|
+
"pulse-outside": {
|
|
5322
|
+
dark: {
|
|
5323
|
+
strokeOpacity: 0.94,
|
|
5324
|
+
innerOpacity: 0.34,
|
|
5325
|
+
bloomOpacity: 0.3,
|
|
5326
|
+
innerShadow: "transparent",
|
|
5327
|
+
saturation: 1.2,
|
|
5328
|
+
brightness: 1.9,
|
|
5329
|
+
// v5 Card 5 frames the card with a single 1px hairline (its box-shadow at
|
|
5330
|
+
// 0.3). Wrapped components here already supply their own ~equivalent 1px
|
|
5331
|
+
// border, so the beam must NOT add a second hairline on top or the edge
|
|
5332
|
+
// reads brighter than v5. Kept at 0 to match v5's single-hairline look.
|
|
5333
|
+
hairlineOpacity: 0
|
|
5334
|
+
},
|
|
5335
|
+
light: {
|
|
5336
|
+
strokeOpacity: 1.96,
|
|
5337
|
+
innerOpacity: 1.04,
|
|
5338
|
+
bloomOpacity: 0.42,
|
|
5339
|
+
innerShadow: "transparent",
|
|
5340
|
+
saturation: 0.6,
|
|
5341
|
+
brightness: 1.7,
|
|
5342
|
+
hairlineOpacity: 0
|
|
5343
|
+
}
|
|
5344
|
+
},
|
|
5345
|
+
// Pulse Inner — contained breathe (ported from v5 "Breathe" / c4)
|
|
5346
|
+
"pulse-inner": {
|
|
5347
|
+
dark: {
|
|
5348
|
+
strokeOpacity: 1.54,
|
|
5349
|
+
innerOpacity: 0.44,
|
|
5350
|
+
bloomOpacity: 0.66,
|
|
5351
|
+
innerShadow: "transparent",
|
|
5352
|
+
saturation: 1.2,
|
|
5353
|
+
brightness: 0.75
|
|
5354
|
+
},
|
|
5355
|
+
light: {
|
|
5356
|
+
strokeOpacity: 0.32,
|
|
5357
|
+
innerOpacity: 0.4,
|
|
5358
|
+
bloomOpacity: 0.8,
|
|
5359
|
+
innerShadow: "transparent",
|
|
5360
|
+
saturation: 0.75,
|
|
5361
|
+
brightness: 1.3
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5364
|
+
};
|
|
5365
|
+
var colorPalettes = {
|
|
5366
|
+
colorful: {
|
|
5367
|
+
border: [
|
|
5368
|
+
{ color: "rgb(255, 50, 100)", pos: "33% -7.4%", size: "70px 40px" },
|
|
5369
|
+
{ color: "rgb(40, 140, 255)", pos: "12% -5%", size: "60px 35px" },
|
|
5370
|
+
{ color: "rgb(50, 200, 80)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
5371
|
+
{ color: "rgb(30, 185, 170)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
5372
|
+
{ color: "rgb(100, 70, 255)", pos: "74.4% 100%", size: "180px 32px" },
|
|
5373
|
+
{ color: "rgb(40, 140, 255)", pos: "55% 100%", size: "85px 26px" },
|
|
5374
|
+
{ color: "rgb(255, 120, 40)", pos: "93.9% 0%", size: "74px 32px" },
|
|
5375
|
+
{ color: "rgb(240, 50, 180)", pos: "100% 27.1%", size: "26px 42px" },
|
|
5376
|
+
{ color: "rgb(180, 40, 240)", pos: "100% 27.1%", size: "52px 48px" }
|
|
5377
|
+
],
|
|
5378
|
+
spike: { primary: "rgb(255, 60, 80)", secondary: "rgba(40, 190, 180, 0.98)" },
|
|
5379
|
+
spikeLt: { primary: "rgb(200, 30, 60)", secondary: "rgb(20, 150, 140)" }
|
|
5380
|
+
},
|
|
5381
|
+
mono: {
|
|
5382
|
+
border: [
|
|
5383
|
+
{ color: "rgb(180, 180, 180)", pos: "33% -7.4%", size: "70px 40px" },
|
|
5384
|
+
{ color: "rgb(140, 140, 140)", pos: "12% -5%", size: "60px 35px" },
|
|
5385
|
+
{ color: "rgb(160, 160, 160)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
5386
|
+
{ color: "rgb(130, 130, 130)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
5387
|
+
{ color: "rgb(170, 170, 170)", pos: "74.4% 100%", size: "180px 32px" },
|
|
5388
|
+
{ color: "rgb(150, 150, 150)", pos: "55% 100%", size: "85px 26px" },
|
|
5389
|
+
{ color: "rgb(190, 190, 190)", pos: "93.9% 0%", size: "74px 32px" },
|
|
5390
|
+
{ color: "rgb(145, 145, 145)", pos: "100% 27.1%", size: "26px 42px" },
|
|
5391
|
+
{ color: "rgb(165, 165, 165)", pos: "100% 27.1%", size: "52px 48px" }
|
|
5392
|
+
],
|
|
5393
|
+
spike: { primary: "rgb(200, 200, 200)", secondary: "rgb(170, 170, 170)" },
|
|
5394
|
+
spikeLt: { primary: "rgb(80, 80, 80)", secondary: "rgb(120, 120, 120)" }
|
|
5395
|
+
},
|
|
5396
|
+
ocean: {
|
|
5397
|
+
border: [
|
|
5398
|
+
{ color: "rgb(100, 80, 220)", pos: "33% -7.4%", size: "70px 40px" },
|
|
5399
|
+
{ color: "rgb(60, 120, 255)", pos: "12% -5%", size: "60px 35px" },
|
|
5400
|
+
{ color: "rgb(80, 100, 200)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
5401
|
+
{ color: "rgb(50, 140, 220)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
5402
|
+
{ color: "rgb(120, 80, 255)", pos: "74.4% 100%", size: "180px 32px" },
|
|
5403
|
+
{ color: "rgb(70, 130, 255)", pos: "55% 100%", size: "85px 26px" },
|
|
5404
|
+
{ color: "rgb(140, 100, 240)", pos: "93.9% 0%", size: "74px 32px" },
|
|
5405
|
+
{ color: "rgb(90, 110, 230)", pos: "100% 27.1%", size: "26px 42px" },
|
|
5406
|
+
{ color: "rgb(130, 70, 255)", pos: "100% 27.1%", size: "52px 48px" }
|
|
5407
|
+
],
|
|
5408
|
+
spike: { primary: "rgb(100, 120, 255)", secondary: "rgba(130, 100, 220, 0.98)" },
|
|
5409
|
+
spikeLt: { primary: "rgb(60, 60, 180)", secondary: "rgb(80, 100, 200)" }
|
|
5410
|
+
},
|
|
5411
|
+
sunset: {
|
|
5412
|
+
border: [
|
|
5413
|
+
{ color: "rgb(255, 80, 50)", pos: "33% -7.4%", size: "70px 40px" },
|
|
5414
|
+
{ color: "rgb(255, 160, 40)", pos: "12% -5%", size: "60px 35px" },
|
|
5415
|
+
{ color: "rgb(255, 120, 60)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
5416
|
+
{ color: "rgb(255, 200, 50)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
5417
|
+
{ color: "rgb(255, 100, 80)", pos: "74.4% 100%", size: "180px 32px" },
|
|
5418
|
+
{ color: "rgb(255, 180, 60)", pos: "55% 100%", size: "85px 26px" },
|
|
5419
|
+
{ color: "rgb(255, 60, 60)", pos: "93.9% 0%", size: "74px 32px" },
|
|
5420
|
+
{ color: "rgb(255, 140, 50)", pos: "100% 27.1%", size: "26px 42px" },
|
|
5421
|
+
{ color: "rgb(255, 90, 70)", pos: "100% 27.1%", size: "52px 48px" }
|
|
5422
|
+
],
|
|
5423
|
+
spike: { primary: "rgb(255, 140, 80)", secondary: "rgba(255, 100, 60, 0.98)" },
|
|
5424
|
+
spikeLt: { primary: "rgb(200, 80, 40)", secondary: "rgb(220, 120, 30)" }
|
|
5425
|
+
},
|
|
5426
|
+
brand: {
|
|
5427
|
+
border: [
|
|
5428
|
+
{ color: "rgb(217, 119, 6)", pos: "33% -7.4%", size: "70px 40px" },
|
|
5429
|
+
{ color: "rgb(245, 158, 11)", pos: "12% -5%", size: "60px 35px" },
|
|
5430
|
+
{ color: "rgb(234, 138, 9)", pos: "2.1% 68.3%", size: "40px 70px" },
|
|
5431
|
+
{ color: "rgb(252, 211, 77)", pos: "2.1% 68.3%", size: "20px 35px" },
|
|
5432
|
+
{ color: "rgb(245, 158, 11)", pos: "74.4% 100%", size: "180px 32px" },
|
|
5433
|
+
{ color: "rgb(251, 191, 36)", pos: "55% 100%", size: "85px 26px" },
|
|
5434
|
+
{ color: "rgb(217, 119, 6)", pos: "93.9% 0%", size: "74px 32px" },
|
|
5435
|
+
{ color: "rgb(251, 191, 36)", pos: "100% 27.1%", size: "26px 42px" },
|
|
5436
|
+
{ color: "rgb(245, 158, 11)", pos: "100% 27.1%", size: "52px 48px" }
|
|
5437
|
+
],
|
|
5438
|
+
spike: { primary: "rgb(251, 191, 36)", secondary: "rgba(245, 158, 11, 0.98)" },
|
|
5439
|
+
spikeLt: { primary: "rgb(180, 83, 9)", secondary: "rgb(202, 138, 4)" }
|
|
5440
|
+
}
|
|
5441
|
+
};
|
|
5442
|
+
var smallColorPalettes = {
|
|
5443
|
+
colorful: {
|
|
5444
|
+
border: [
|
|
5445
|
+
{ color: "rgb(50, 200, 80)", pos: "2% 68%", size: "9px 18px" },
|
|
5446
|
+
{ color: "rgb(30, 185, 170)", pos: "2% 68%", size: "4px 8px" },
|
|
5447
|
+
{ color: "rgb(255, 120, 40)", pos: "72% -3%", size: "59px 9px" },
|
|
5448
|
+
{ color: "rgb(100, 70, 255)", pos: "74% 100%", size: "42px 7px" },
|
|
5449
|
+
{ color: "rgb(240, 50, 180)", pos: "100% 27%", size: "10px 17px" },
|
|
5450
|
+
{ color: "rgb(180, 40, 240)", pos: "100% 27%", size: "10px 18px" },
|
|
5451
|
+
{ color: "rgb(40, 140, 255)", pos: "100% 27%", size: "5px 10px" },
|
|
5452
|
+
{ color: "rgb(255, 50, 100)", pos: "100% 27%", size: "11px 12px" }
|
|
5453
|
+
],
|
|
5454
|
+
inner: [
|
|
5455
|
+
{ color: "rgba(50, 200, 80, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
5456
|
+
{ color: "rgba(30, 185, 170, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
5457
|
+
{ color: "rgba(255, 120, 40, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
5458
|
+
{ color: "rgba(100, 70, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
5459
|
+
{ color: "rgba(240, 50, 180, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
5460
|
+
{ color: "rgba(180, 40, 240, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
5461
|
+
{ color: "rgba(40, 140, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
5462
|
+
{ color: "rgba(255, 50, 100, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
5463
|
+
]
|
|
5464
|
+
},
|
|
5465
|
+
mono: {
|
|
5466
|
+
border: [
|
|
5467
|
+
{ color: "rgb(160, 160, 160)", pos: "2% 68%", size: "9px 18px" },
|
|
5468
|
+
{ color: "rgb(140, 140, 140)", pos: "2% 68%", size: "4px 8px" },
|
|
5469
|
+
{ color: "rgb(180, 180, 180)", pos: "72% -3%", size: "59px 9px" },
|
|
5470
|
+
{ color: "rgb(150, 150, 150)", pos: "74% 100%", size: "42px 7px" },
|
|
5471
|
+
{ color: "rgb(170, 170, 170)", pos: "100% 27%", size: "10px 17px" },
|
|
5472
|
+
{ color: "rgb(155, 155, 155)", pos: "100% 27%", size: "10px 18px" },
|
|
5473
|
+
{ color: "rgb(145, 145, 145)", pos: "100% 27%", size: "5px 10px" },
|
|
5474
|
+
{ color: "rgb(165, 165, 165)", pos: "100% 27%", size: "11px 12px" }
|
|
5475
|
+
],
|
|
5476
|
+
inner: [
|
|
5477
|
+
{ color: "rgba(160, 160, 160, 0.25)", pos: "2% 68%", size: "9px 18px" },
|
|
5478
|
+
{ color: "rgba(140, 140, 140, 0.22)", pos: "2% 68%", size: "4px 8px" },
|
|
5479
|
+
{ color: "rgba(180, 180, 180, 0.17)", pos: "72% -3%", size: "59px 9px" },
|
|
5480
|
+
{ color: "rgba(150, 150, 150, 0.17)", pos: "74% 100%", size: "42px 7px" },
|
|
5481
|
+
{ color: "rgba(170, 170, 170, 0.15)", pos: "100% 27%", size: "10px 17px" },
|
|
5482
|
+
{ color: "rgba(155, 155, 155, 0.20)", pos: "100% 27%", size: "10px 18px" },
|
|
5483
|
+
{ color: "rgba(145, 145, 145, 0.15)", pos: "100% 27%", size: "5px 10px" },
|
|
5484
|
+
{ color: "rgba(165, 165, 165, 0.15)", pos: "100% 27%", size: "11px 12px" }
|
|
5485
|
+
]
|
|
5486
|
+
},
|
|
5487
|
+
ocean: {
|
|
5488
|
+
border: [
|
|
5489
|
+
{ color: "rgb(60, 140, 200)", pos: "2% 68%", size: "9px 18px" },
|
|
5490
|
+
{ color: "rgb(50, 120, 180)", pos: "2% 68%", size: "4px 8px" },
|
|
5491
|
+
{ color: "rgb(100, 80, 220)", pos: "72% -3%", size: "59px 9px" },
|
|
5492
|
+
{ color: "rgb(80, 100, 255)", pos: "74% 100%", size: "42px 7px" },
|
|
5493
|
+
{ color: "rgb(120, 70, 240)", pos: "100% 27%", size: "10px 17px" },
|
|
5494
|
+
{ color: "rgb(90, 80, 220)", pos: "100% 27%", size: "10px 18px" },
|
|
5495
|
+
{ color: "rgb(70, 110, 255)", pos: "100% 27%", size: "5px 10px" },
|
|
5496
|
+
{ color: "rgb(110, 90, 230)", pos: "100% 27%", size: "11px 12px" }
|
|
5497
|
+
],
|
|
5498
|
+
inner: [
|
|
5499
|
+
{ color: "rgba(60, 140, 200, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
5500
|
+
{ color: "rgba(50, 120, 180, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
5501
|
+
{ color: "rgba(100, 80, 220, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
5502
|
+
{ color: "rgba(80, 100, 255, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
5503
|
+
{ color: "rgba(120, 70, 240, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
5504
|
+
{ color: "rgba(90, 80, 220, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
5505
|
+
{ color: "rgba(70, 110, 255, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
5506
|
+
{ color: "rgba(110, 90, 230, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
5507
|
+
]
|
|
5508
|
+
},
|
|
5509
|
+
sunset: {
|
|
5510
|
+
border: [
|
|
5511
|
+
{ color: "rgb(255, 180, 50)", pos: "2% 68%", size: "9px 18px" },
|
|
5512
|
+
{ color: "rgb(255, 150, 40)", pos: "2% 68%", size: "4px 8px" },
|
|
5513
|
+
{ color: "rgb(255, 80, 60)", pos: "72% -3%", size: "59px 9px" },
|
|
5514
|
+
{ color: "rgb(255, 100, 80)", pos: "74% 100%", size: "42px 7px" },
|
|
5515
|
+
{ color: "rgb(255, 60, 80)", pos: "100% 27%", size: "10px 17px" },
|
|
5516
|
+
{ color: "rgb(255, 120, 60)", pos: "100% 27%", size: "10px 18px" },
|
|
5517
|
+
{ color: "rgb(255, 200, 50)", pos: "100% 27%", size: "5px 10px" },
|
|
5518
|
+
{ color: "rgb(255, 90, 70)", pos: "100% 27%", size: "11px 12px" }
|
|
5519
|
+
],
|
|
5520
|
+
inner: [
|
|
5521
|
+
{ color: "rgba(255, 180, 50, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
5522
|
+
{ color: "rgba(255, 150, 40, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
5523
|
+
{ color: "rgba(255, 80, 60, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
5524
|
+
{ color: "rgba(255, 100, 80, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
5525
|
+
{ color: "rgba(255, 60, 80, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
5526
|
+
{ color: "rgba(255, 120, 60, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
5527
|
+
{ color: "rgba(255, 200, 50, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
5528
|
+
{ color: "rgba(255, 90, 70, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
5529
|
+
]
|
|
5530
|
+
},
|
|
5531
|
+
brand: {
|
|
5532
|
+
border: [
|
|
5533
|
+
{ color: "rgb(251, 191, 36)", pos: "2% 68%", size: "9px 18px" },
|
|
5534
|
+
{ color: "rgb(245, 158, 11)", pos: "2% 68%", size: "4px 8px" },
|
|
5535
|
+
{ color: "rgb(217, 119, 6)", pos: "72% -3%", size: "59px 9px" },
|
|
5536
|
+
{ color: "rgb(245, 158, 11)", pos: "74% 100%", size: "42px 7px" },
|
|
5537
|
+
{ color: "rgb(217, 119, 6)", pos: "100% 27%", size: "10px 17px" },
|
|
5538
|
+
{ color: "rgb(245, 158, 11)", pos: "100% 27%", size: "10px 18px" },
|
|
5539
|
+
{ color: "rgb(252, 211, 77)", pos: "100% 27%", size: "5px 10px" },
|
|
5540
|
+
{ color: "rgb(251, 191, 36)", pos: "100% 27%", size: "11px 12px" }
|
|
5541
|
+
],
|
|
5542
|
+
inner: [
|
|
5543
|
+
{ color: "rgba(251, 191, 36, 0.5)", pos: "2% 68%", size: "9px 18px" },
|
|
5544
|
+
{ color: "rgba(245, 158, 11, 0.45)", pos: "2% 68%", size: "4px 8px" },
|
|
5545
|
+
{ color: "rgba(217, 119, 6, 0.35)", pos: "72% -3%", size: "59px 9px" },
|
|
5546
|
+
{ color: "rgba(245, 158, 11, 0.35)", pos: "74% 100%", size: "42px 7px" },
|
|
5547
|
+
{ color: "rgba(217, 119, 6, 0.3)", pos: "100% 27%", size: "10px 17px" },
|
|
5548
|
+
{ color: "rgba(245, 158, 11, 0.4)", pos: "100% 27%", size: "10px 18px" },
|
|
5549
|
+
{ color: "rgba(252, 211, 77, 0.3)", pos: "100% 27%", size: "5px 10px" },
|
|
5550
|
+
{ color: "rgba(251, 191, 36, 0.3)", pos: "100% 27%", size: "11px 12px" }
|
|
5551
|
+
]
|
|
5552
|
+
}
|
|
5553
|
+
};
|
|
5554
|
+
function getSmallColorGradients(colorVariant) {
|
|
5555
|
+
const palette = smallColorPalettes[colorVariant];
|
|
5556
|
+
return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
5557
|
+
}
|
|
5558
|
+
function getSmallInnerGradients(colorVariant) {
|
|
5559
|
+
const palette = smallColorPalettes[colorVariant];
|
|
5560
|
+
return palette.inner.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
5561
|
+
}
|
|
5562
|
+
function getColorGradients(colorVariant) {
|
|
5563
|
+
const palette = colorPalettes[colorVariant];
|
|
5564
|
+
return palette.border.map((c) => `radial-gradient(ellipse ${c.size} at ${c.pos}, ${c.color}, transparent)`).join(",\n ");
|
|
5565
|
+
}
|
|
5566
|
+
function getInnerGradients(colorVariant) {
|
|
5567
|
+
const palette = colorPalettes[colorVariant];
|
|
5568
|
+
const baseOpacity = colorVariant === "mono" ? 0.225 : 0.45;
|
|
5569
|
+
return palette.border.map((c) => {
|
|
5570
|
+
const rgba = c.color.replace("rgb(", "rgba(").replace(")", `, ${baseOpacity})`);
|
|
5571
|
+
const smallerSize = c.size.split(" ").map((s) => {
|
|
5572
|
+
const val = parseInt(s);
|
|
5573
|
+
return `${Math.round(val * 0.9)}px`;
|
|
5574
|
+
}).join(" ");
|
|
5575
|
+
return `radial-gradient(ellipse ${smallerSize} at ${c.pos}, ${rgba}, transparent)`;
|
|
5576
|
+
}).join(",\n ");
|
|
5577
|
+
}
|
|
5578
|
+
function getSpikeColors(colorVariant, isDark) {
|
|
5579
|
+
const palette = colorPalettes[colorVariant];
|
|
5580
|
+
return isDark ? palette.spike : palette.spikeLt;
|
|
5581
|
+
}
|
|
5582
|
+
var lineColorPalettes = {
|
|
5583
|
+
colorful: {
|
|
5584
|
+
dark: [
|
|
5585
|
+
{ color: "rgb(255, 50, 100)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5586
|
+
{ color: "rgb(40, 180, 220)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
5587
|
+
{ color: "rgb(50, 200, 80)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
5588
|
+
{ color: "rgb(180, 40, 240)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
5589
|
+
{ color: "rgb(255, 160, 30)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
5590
|
+
{ color: "rgb(100, 70, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
5591
|
+
{ color: "rgb(40, 140, 255)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
5592
|
+
{ color: "rgb(240, 50, 180)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
5593
|
+
{ color: "rgb(30, 185, 170)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
5594
|
+
],
|
|
5595
|
+
light: [
|
|
5596
|
+
{ color: "rgb(255, 50, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5597
|
+
{ color: "rgb(40, 140, 255)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
5598
|
+
{ color: "rgb(50, 200, 80)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
5599
|
+
{ color: "rgb(180, 40, 240)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
5600
|
+
{ color: "rgb(30, 185, 170)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
5601
|
+
{ color: "rgb(100, 70, 255)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
5602
|
+
{ color: "rgb(40, 140, 255)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
5603
|
+
{ color: "rgb(255, 120, 40)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
5604
|
+
{ color: "rgb(240, 50, 180)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
5605
|
+
]
|
|
5606
|
+
},
|
|
5607
|
+
mono: {
|
|
5608
|
+
dark: [
|
|
5609
|
+
{ color: "rgb(200, 200, 200)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5610
|
+
{ color: "rgb(170, 170, 170)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
5611
|
+
{ color: "rgb(155, 155, 155)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
5612
|
+
{ color: "rgb(185, 185, 185)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
5613
|
+
{ color: "rgb(165, 165, 165)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
5614
|
+
{ color: "rgb(180, 180, 180)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
5615
|
+
{ color: "rgb(160, 160, 160)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
5616
|
+
{ color: "rgb(175, 175, 175)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
5617
|
+
{ color: "rgb(190, 190, 190)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
5618
|
+
],
|
|
5619
|
+
light: [
|
|
5620
|
+
{ color: "rgb(100, 100, 100)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5621
|
+
{ color: "rgb(80, 80, 80)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
5622
|
+
{ color: "rgb(90, 90, 90)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
5623
|
+
{ color: "rgb(70, 70, 70)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
5624
|
+
{ color: "rgb(85, 85, 85)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
5625
|
+
{ color: "rgb(95, 95, 95)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
5626
|
+
{ color: "rgb(75, 75, 75)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
5627
|
+
{ color: "rgb(105, 105, 105)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
5628
|
+
{ color: "rgb(65, 65, 65)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
5629
|
+
]
|
|
5630
|
+
},
|
|
5631
|
+
ocean: {
|
|
5632
|
+
dark: [
|
|
5633
|
+
{ color: "rgb(100, 80, 220)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5634
|
+
{ color: "rgb(60, 120, 255)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
5635
|
+
{ color: "rgb(80, 100, 200)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
5636
|
+
{ color: "rgb(130, 70, 255)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
5637
|
+
{ color: "rgb(70, 130, 255)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
5638
|
+
{ color: "rgb(120, 80, 255)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
5639
|
+
{ color: "rgb(90, 110, 230)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
5640
|
+
{ color: "rgb(110, 90, 240)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
5641
|
+
{ color: "rgb(140, 100, 255)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
5642
|
+
],
|
|
5643
|
+
light: [
|
|
5644
|
+
{ color: "rgb(80, 60, 200)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5645
|
+
{ color: "rgb(50, 100, 220)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
5646
|
+
{ color: "rgb(70, 90, 190)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
5647
|
+
{ color: "rgb(110, 60, 220)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
5648
|
+
{ color: "rgb(60, 110, 230)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
5649
|
+
{ color: "rgb(100, 70, 240)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
5650
|
+
{ color: "rgb(80, 100, 210)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
5651
|
+
{ color: "rgb(90, 80, 225)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
5652
|
+
{ color: "rgb(120, 90, 245)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
5653
|
+
]
|
|
5654
|
+
},
|
|
5655
|
+
sunset: {
|
|
5656
|
+
dark: [
|
|
5657
|
+
{ color: "rgb(255, 100, 60)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5658
|
+
{ color: "rgb(255, 180, 50)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
5659
|
+
{ color: "rgb(255, 140, 70)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
5660
|
+
{ color: "rgb(255, 80, 80)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
5661
|
+
{ color: "rgb(255, 200, 60)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
5662
|
+
{ color: "rgb(255, 120, 50)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
5663
|
+
{ color: "rgb(255, 160, 80)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
5664
|
+
{ color: "rgb(255, 90, 60)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
5665
|
+
{ color: "rgb(255, 70, 70)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
5666
|
+
],
|
|
5667
|
+
light: [
|
|
5668
|
+
{ color: "rgb(220, 80, 40)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5669
|
+
{ color: "rgb(230, 150, 30)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
5670
|
+
{ color: "rgb(210, 110, 50)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
5671
|
+
{ color: "rgb(200, 60, 60)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
5672
|
+
{ color: "rgb(220, 170, 40)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
5673
|
+
{ color: "rgb(210, 100, 30)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
5674
|
+
{ color: "rgb(230, 130, 60)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
5675
|
+
{ color: "rgb(190, 70, 50)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
5676
|
+
{ color: "rgb(180, 50, 50)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
5677
|
+
]
|
|
5678
|
+
},
|
|
5679
|
+
brand: {
|
|
5680
|
+
dark: [
|
|
5681
|
+
{ color: "rgb(245, 158, 11)", sizeW: 36, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5682
|
+
{ color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 32, offsetX: 39, offsetY: 0 },
|
|
5683
|
+
{ color: "rgb(245, 158, 11)", sizeW: 33, sizeH: 28, offsetX: -36, offsetY: 2 },
|
|
5684
|
+
{ color: "rgb(217, 119, 6)", sizeW: 29, sizeH: 34, offsetX: -54, offsetY: 0 },
|
|
5685
|
+
{ color: "rgb(252, 211, 77)", sizeW: 27, sizeH: 30, offsetX: 51, offsetY: -1 },
|
|
5686
|
+
{ color: "rgb(234, 138, 9)", sizeW: 36, sizeH: 24, offsetX: 21, offsetY: 1 },
|
|
5687
|
+
{ color: "rgb(251, 191, 36)", sizeW: 30, sizeH: 22, offsetX: -21, offsetY: 0 },
|
|
5688
|
+
{ color: "rgb(217, 119, 6)", sizeW: 25, sizeH: 28, offsetX: 66, offsetY: 1 },
|
|
5689
|
+
{ color: "rgb(245, 158, 11)", sizeW: 23, sizeH: 30, offsetX: -66, offsetY: -1 }
|
|
5690
|
+
],
|
|
5691
|
+
light: [
|
|
5692
|
+
{ color: "rgb(180, 83, 9)", sizeW: 45, sizeH: 36, offsetX: 0, offsetY: 2 },
|
|
5693
|
+
{ color: "rgb(202, 138, 4)", sizeW: 35, sizeH: 32, offsetX: 65, offsetY: 0 },
|
|
5694
|
+
{ color: "rgb(180, 83, 9)", sizeW: 40, sizeH: 28, offsetX: -60, offsetY: 2 },
|
|
5695
|
+
{ color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 34, offsetX: -90, offsetY: 0 },
|
|
5696
|
+
{ color: "rgb(202, 138, 4)", sizeW: 38, sizeH: 30, offsetX: 85, offsetY: -1 },
|
|
5697
|
+
{ color: "rgb(161, 98, 7)", sizeW: 50, sizeH: 24, offsetX: 35, offsetY: 1 },
|
|
5698
|
+
{ color: "rgb(202, 138, 4)", sizeW: 40, sizeH: 22, offsetX: -35, offsetY: 0 },
|
|
5699
|
+
{ color: "rgb(146, 64, 14)", sizeW: 35, sizeH: 28, offsetX: 110, offsetY: 1 },
|
|
5700
|
+
{ color: "rgb(180, 83, 9)", sizeW: 30, sizeH: 30, offsetX: -110, offsetY: -1 }
|
|
5701
|
+
]
|
|
5702
|
+
}
|
|
5703
|
+
};
|
|
5704
|
+
function getLineColorGradients(colorVariant, isDark, id) {
|
|
5705
|
+
const palette = lineColorPalettes[colorVariant][isDark ? "dark" : "light"];
|
|
5706
|
+
return palette.map((c) => {
|
|
5707
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
5708
|
+
const offsetYStr = c.offsetY === 0 ? "" : c.offsetY > 0 ? ` + ${c.offsetY}px` : ` - ${Math.abs(c.offsetY)}px`;
|
|
5709
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
5710
|
+
}).join(",\n ");
|
|
5711
|
+
}
|
|
5712
|
+
var lineInnerGradientData = {
|
|
5713
|
+
colorful: [
|
|
5714
|
+
{ color: "rgba(255, 50, 100, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
5715
|
+
{ color: "rgba(40, 180, 220, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
5716
|
+
{ color: "rgba(50, 200, 80, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
5717
|
+
{ color: "rgba(180, 40, 240, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
5718
|
+
{ color: "rgba(255, 160, 30, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
5719
|
+
{ color: "rgba(100, 70, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
5720
|
+
{ color: "rgba(40, 140, 255, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
5721
|
+
{ color: "rgba(240, 50, 180, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
5722
|
+
{ color: "rgba(30, 185, 170, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
5723
|
+
],
|
|
5724
|
+
mono: [
|
|
5725
|
+
{ color: "rgba(200, 200, 200, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
5726
|
+
{ color: "rgba(170, 170, 170, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
5727
|
+
{ color: "rgba(155, 155, 155, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
5728
|
+
{ color: "rgba(185, 185, 185, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
5729
|
+
{ color: "rgba(165, 165, 165, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
5730
|
+
{ color: "rgba(180, 180, 180, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
5731
|
+
{ color: "rgba(160, 160, 160, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
5732
|
+
{ color: "rgba(175, 175, 175, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
5733
|
+
{ color: "rgba(190, 190, 190, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
5734
|
+
],
|
|
5735
|
+
ocean: [
|
|
5736
|
+
{ color: "rgba(100, 80, 220, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
5737
|
+
{ color: "rgba(60, 120, 255, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
5738
|
+
{ color: "rgba(80, 100, 200, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
5739
|
+
{ color: "rgba(130, 70, 255, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
5740
|
+
{ color: "rgba(70, 130, 255, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
5741
|
+
{ color: "rgba(120, 80, 255, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
5742
|
+
{ color: "rgba(90, 110, 230, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
5743
|
+
{ color: "rgba(110, 90, 240, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
5744
|
+
{ color: "rgba(140, 100, 255, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
5745
|
+
],
|
|
5746
|
+
sunset: [
|
|
5747
|
+
{ color: "rgba(255, 100, 60, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
5748
|
+
{ color: "rgba(255, 180, 50, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
5749
|
+
{ color: "rgba(255, 140, 70, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
5750
|
+
{ color: "rgba(255, 80, 80, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
5751
|
+
{ color: "rgba(255, 200, 60, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
5752
|
+
{ color: "rgba(255, 120, 50, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
5753
|
+
{ color: "rgba(255, 160, 80, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
5754
|
+
{ color: "rgba(255, 90, 60, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
5755
|
+
{ color: "rgba(255, 70, 70, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
5756
|
+
],
|
|
5757
|
+
brand: [
|
|
5758
|
+
{ color: "rgba(245, 158, 11, 0.48)", sizeW: 33, sizeH: 30, offsetX: 0, offsetY: 0 },
|
|
5759
|
+
{ color: "rgba(251, 191, 36, 0.42)", sizeW: 24, sizeH: 26, offsetX: 39, offsetY: -3 },
|
|
5760
|
+
{ color: "rgba(245, 158, 11, 0.48)", sizeW: 27, sizeH: 24, offsetX: -36, offsetY: 0 },
|
|
5761
|
+
{ color: "rgba(217, 119, 6, 0.42)", sizeW: 23, sizeH: 28, offsetX: -54, offsetY: -2 },
|
|
5762
|
+
{ color: "rgba(252, 211, 77, 0.50)", sizeW: 24, sizeH: 24, offsetX: 51, offsetY: -1 },
|
|
5763
|
+
{ color: "rgba(234, 138, 9, 0.45)", sizeW: 30, sizeH: 20, offsetX: 21, offsetY: 0 },
|
|
5764
|
+
{ color: "rgba(251, 191, 36, 0.40)", sizeW: 25, sizeH: 18, offsetX: -21, offsetY: -2 },
|
|
5765
|
+
{ color: "rgba(217, 119, 6, 0.45)", sizeW: 21, sizeH: 24, offsetX: 66, offsetY: 0 },
|
|
5766
|
+
{ color: "rgba(245, 158, 11, 0.52)", sizeW: 18, sizeH: 26, offsetX: -66, offsetY: -1 }
|
|
5767
|
+
]
|
|
5768
|
+
};
|
|
5769
|
+
function getLineInnerGradients(colorVariant, id) {
|
|
5770
|
+
const data = lineInnerGradientData[colorVariant];
|
|
5771
|
+
return data.map((c) => {
|
|
5772
|
+
const offsetXStr = c.offsetX === 0 ? "" : c.offsetX > 0 ? ` + ${c.offsetX}px` : ` - ${Math.abs(c.offsetX)}px`;
|
|
5773
|
+
const offsetYStr = c.offsetY === 0 ? "" : ` - ${Math.abs(c.offsetY)}px`;
|
|
5774
|
+
return `radial-gradient(ellipse calc(${c.sizeW}px * var(--beam-w-${id})) calc(${c.sizeH}px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%${offsetXStr}) calc(100%${offsetYStr}), ${c.color}, transparent)`;
|
|
5775
|
+
}).join(",\n ");
|
|
5776
|
+
}
|
|
5777
|
+
var lineBloomColors = {
|
|
5778
|
+
colorful: {
|
|
5779
|
+
dark: {
|
|
5780
|
+
spikes: [
|
|
5781
|
+
{ color1: "rgb(100, 70, 255)", color2: "rgba(100, 70, 255, 1)" },
|
|
5782
|
+
// 36%
|
|
5783
|
+
{ color1: "rgba(255, 170, 40, 0.59)", color2: "rgba(255, 170, 40, 0.29)" },
|
|
5784
|
+
// 50%
|
|
5785
|
+
{ color1: "rgb(50, 200, 100)", color2: "rgba(50, 200, 100, 1)" },
|
|
5786
|
+
// 64%
|
|
5787
|
+
{ color1: "rgba(200, 50, 240, 0.91)", color2: "rgba(200, 50, 240, 0.45)" },
|
|
5788
|
+
// 78%
|
|
5789
|
+
{ color1: "rgb(40, 140, 255)", color2: "rgba(40, 140, 255, 1)" }
|
|
5790
|
+
// 92%
|
|
5791
|
+
]
|
|
5792
|
+
},
|
|
5793
|
+
light: {
|
|
5794
|
+
spikes: [
|
|
5795
|
+
{ color1: "rgb(80, 50, 200)", color2: "rgba(80, 50, 200, 0.8)" },
|
|
5796
|
+
// 36%
|
|
5797
|
+
{ color1: "rgba(210, 130, 0, 0.7)", color2: "rgba(210, 130, 0, 0.46)" },
|
|
5798
|
+
// 50%
|
|
5799
|
+
{ color1: "rgb(30, 160, 70)", color2: "rgba(30, 160, 70, 0.82)" },
|
|
5800
|
+
// 64%
|
|
5801
|
+
{ color1: "rgb(160, 30, 190)", color2: "rgba(160, 30, 190, 0.7)" },
|
|
5802
|
+
// 78%
|
|
5803
|
+
{ color1: "rgb(30, 100, 200)", color2: "rgba(30, 100, 200, 0.78)" }
|
|
5804
|
+
// 92%
|
|
5805
|
+
]
|
|
5806
|
+
}
|
|
5807
|
+
},
|
|
5808
|
+
mono: {
|
|
5809
|
+
dark: {
|
|
5810
|
+
spikes: [
|
|
5811
|
+
{ color1: "rgb(200, 200, 200)", color2: "rgba(200, 200, 200, 1)" },
|
|
5812
|
+
{ color1: "rgba(180, 180, 180, 0.59)", color2: "rgba(180, 180, 180, 0.29)" },
|
|
5813
|
+
{ color1: "rgb(190, 190, 190)", color2: "rgba(190, 190, 190, 1)" },
|
|
5814
|
+
{ color1: "rgba(170, 170, 170, 0.91)", color2: "rgba(170, 170, 170, 0.45)" },
|
|
5815
|
+
{ color1: "rgb(185, 185, 185)", color2: "rgba(185, 185, 185, 1)" }
|
|
5816
|
+
]
|
|
5817
|
+
},
|
|
5818
|
+
light: {
|
|
5819
|
+
spikes: [
|
|
5820
|
+
{ color1: "rgb(80, 80, 80)", color2: "rgba(80, 80, 80, 0.8)" },
|
|
5821
|
+
{ color1: "rgba(100, 100, 100, 0.7)", color2: "rgba(100, 100, 100, 0.46)" },
|
|
5822
|
+
{ color1: "rgb(70, 70, 70)", color2: "rgba(70, 70, 70, 0.82)" },
|
|
5823
|
+
{ color1: "rgb(90, 90, 90)", color2: "rgba(90, 90, 90, 0.7)" },
|
|
5824
|
+
{ color1: "rgb(85, 85, 85)", color2: "rgba(85, 85, 85, 0.78)" }
|
|
5825
|
+
]
|
|
5826
|
+
}
|
|
5827
|
+
},
|
|
5828
|
+
ocean: {
|
|
5829
|
+
dark: {
|
|
5830
|
+
spikes: [
|
|
5831
|
+
{ color1: "rgb(100, 80, 255)", color2: "rgb(100, 80, 255)" },
|
|
5832
|
+
{ color1: "rgba(80, 130, 220, 0.59)", color2: "rgba(80, 130, 220, 0.29)" },
|
|
5833
|
+
{ color1: "rgb(60, 100, 255)", color2: "rgb(60, 100, 255)" },
|
|
5834
|
+
{ color1: "rgba(90, 120, 200, 0.91)", color2: "rgba(90, 120, 200, 0.45)" },
|
|
5835
|
+
{ color1: "rgb(120, 90, 255)", color2: "rgb(120, 90, 255)" }
|
|
5836
|
+
]
|
|
5837
|
+
},
|
|
5838
|
+
light: {
|
|
5839
|
+
spikes: [
|
|
5840
|
+
{ color1: "rgb(50, 40, 180)", color2: "rgba(50, 40, 180, 0.8)" },
|
|
5841
|
+
{ color1: "rgba(40, 80, 200, 0.7)", color2: "rgba(40, 80, 200, 0.46)" },
|
|
5842
|
+
{ color1: "rgb(30, 50, 190)", color2: "rgba(30, 50, 190, 0.82)" },
|
|
5843
|
+
{ color1: "rgb(60, 90, 180)", color2: "rgba(60, 90, 180, 0.7)" },
|
|
5844
|
+
{ color1: "rgb(70, 60, 200)", color2: "rgba(70, 60, 200, 0.78)" }
|
|
5845
|
+
]
|
|
5846
|
+
}
|
|
5847
|
+
},
|
|
5848
|
+
sunset: {
|
|
5849
|
+
dark: {
|
|
5850
|
+
spikes: [
|
|
5851
|
+
{ color1: "rgb(255, 100, 80)", color2: "rgb(255, 100, 80)" },
|
|
5852
|
+
{ color1: "rgba(255, 150, 80, 0.59)", color2: "rgba(255, 150, 80, 0.29)" },
|
|
5853
|
+
{ color1: "rgb(255, 80, 60)", color2: "rgb(255, 80, 60)" },
|
|
5854
|
+
{ color1: "rgba(255, 120, 50, 0.91)", color2: "rgba(255, 120, 50, 0.45)" },
|
|
5855
|
+
{ color1: "rgb(255, 140, 70)", color2: "rgb(255, 140, 70)" }
|
|
5856
|
+
]
|
|
5857
|
+
},
|
|
5858
|
+
light: {
|
|
5859
|
+
spikes: [
|
|
5860
|
+
{ color1: "rgb(200, 60, 30)", color2: "rgba(200, 60, 30, 0.8)" },
|
|
5861
|
+
{ color1: "rgba(220, 100, 20, 0.7)", color2: "rgba(220, 100, 20, 0.46)" },
|
|
5862
|
+
{ color1: "rgb(180, 40, 20)", color2: "rgba(180, 40, 20, 0.82)" },
|
|
5863
|
+
{ color1: "rgb(210, 80, 10)", color2: "rgba(210, 80, 10, 0.7)" },
|
|
5864
|
+
{ color1: "rgb(190, 70, 30)", color2: "rgba(190, 70, 30, 0.78)" }
|
|
5865
|
+
]
|
|
5866
|
+
}
|
|
5867
|
+
},
|
|
5868
|
+
brand: {
|
|
5869
|
+
dark: {
|
|
5870
|
+
spikes: [
|
|
5871
|
+
{ color1: "rgb(251, 191, 36)", color2: "rgb(251, 191, 36)" },
|
|
5872
|
+
{ color1: "rgba(245, 158, 11, 0.59)", color2: "rgba(245, 158, 11, 0.29)" },
|
|
5873
|
+
{ color1: "rgb(217, 119, 6)", color2: "rgb(217, 119, 6)" },
|
|
5874
|
+
{ color1: "rgba(252, 211, 77, 0.91)", color2: "rgba(252, 211, 77, 0.45)" },
|
|
5875
|
+
{ color1: "rgb(245, 158, 11)", color2: "rgb(245, 158, 11)" }
|
|
5876
|
+
]
|
|
5877
|
+
},
|
|
5878
|
+
light: {
|
|
5879
|
+
spikes: [
|
|
5880
|
+
{ color1: "rgb(180, 83, 9)", color2: "rgba(180, 83, 9, 0.8)" },
|
|
5881
|
+
{ color1: "rgba(202, 138, 4, 0.7)", color2: "rgba(202, 138, 4, 0.46)" },
|
|
5882
|
+
{ color1: "rgb(146, 64, 14)", color2: "rgba(146, 64, 14, 0.82)" },
|
|
5883
|
+
{ color1: "rgb(202, 138, 4)", color2: "rgba(202, 138, 4, 0.7)" },
|
|
5884
|
+
{ color1: "rgb(161, 98, 7)", color2: "rgba(161, 98, 7, 0.78)" }
|
|
5885
|
+
]
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5888
|
+
};
|
|
5889
|
+
function withAlpha(color, alpha) {
|
|
5890
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*[\d.]+\s*\)$/);
|
|
5891
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${alpha})`;
|
|
5892
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
5893
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${alpha})`;
|
|
5894
|
+
return color;
|
|
5895
|
+
}
|
|
5896
|
+
function attenuateSpike(color, factor) {
|
|
5897
|
+
const rgbaMatch = color.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
5898
|
+
if (rgbaMatch) return `rgba(${rgbaMatch[1]}, ${rgbaMatch[2]}, ${rgbaMatch[3]}, ${(parseFloat(rgbaMatch[4]) * factor).toFixed(2)})`;
|
|
5899
|
+
const rgbMatch = color.match(/^rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/);
|
|
5900
|
+
if (rgbMatch) return `rgba(${rgbMatch[1]}, ${rgbMatch[2]}, ${rgbMatch[3]}, ${factor.toFixed(2)})`;
|
|
5901
|
+
return color;
|
|
5902
|
+
}
|
|
5903
|
+
function getLineBloomGradients(colorVariant, isDark, id) {
|
|
5904
|
+
const spikeColors = getSpikeColors(colorVariant, isDark);
|
|
5905
|
+
const bloomData = lineBloomColors[colorVariant][isDark ? "dark" : "light"];
|
|
5906
|
+
const isMono = colorVariant === "mono";
|
|
5907
|
+
const att = isMono ? 0.14 : 1;
|
|
5908
|
+
const sc1 = isMono ? attenuateSpike(spikeColors.primary, 0.14) : spikeColors.primary;
|
|
5909
|
+
const sc1_mid = isMono ? attenuateSpike(spikeColors.primary, 0.09) : spikeColors.primary;
|
|
5910
|
+
const sc2 = isMono ? attenuateSpike(spikeColors.secondary, 0.12) : spikeColors.secondary;
|
|
5911
|
+
const sc2_mid = isMono ? withAlpha(spikeColors.secondary, 0.06) : withAlpha(spikeColors.secondary, 0.49);
|
|
5912
|
+
const spikes = bloomData.spikes.map(
|
|
5913
|
+
(s) => isMono ? { color1: attenuateSpike(s.color1, att), color2: attenuateSpike(s.color2, att * 0.7) } : s
|
|
5914
|
+
);
|
|
5915
|
+
const thinW1 = isMono ? "12px" : "0.8px";
|
|
5916
|
+
const thinW2 = isMono ? "14px" : "2px";
|
|
5917
|
+
const thinW3 = isMono ? "12px" : "1.2px";
|
|
5918
|
+
const thinW4 = isMono ? "10px" : "0.6px";
|
|
5919
|
+
const thinH1 = isMono ? "42px" : "92px";
|
|
5920
|
+
const thinH2 = isMono ? "38px" : "72px";
|
|
5921
|
+
const thinH3 = isMono ? "40px" : "85px";
|
|
5922
|
+
const thinH4 = isMono ? "32px" : "60px";
|
|
5923
|
+
const thinLW = isMono ? "12px" : "1px";
|
|
5924
|
+
const glowDotC = isMono ? "rgba(255, 255, 255, 0.5)" : "rgba(255, 255, 255, 1)";
|
|
5925
|
+
const glowDot20 = isMono ? "rgba(255, 255, 255, 0.45)" : "rgba(255, 255, 255, 0.9)";
|
|
5926
|
+
const glowDot50 = isMono ? "rgba(255, 255, 255, 0.25)" : "rgba(255, 255, 255, 0.5)";
|
|
5927
|
+
const glowAmbC = isMono ? "rgba(255, 255, 255, 0.15)" : "rgba(255, 255, 255, 0.3)";
|
|
5928
|
+
const glowAmb25 = isMono ? "rgba(255, 255, 255, 0.06)" : "rgba(255, 255, 255, 0.12)";
|
|
5929
|
+
const glowAmb55 = isMono ? "rgba(255, 255, 255, 0.015)" : "rgba(255, 255, 255, 0.03)";
|
|
5930
|
+
if (isDark) {
|
|
5931
|
+
return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_mid} 30%, transparent 88%),
|
|
5932
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_mid} 50%, transparent 95%),
|
|
5933
|
+
radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
5934
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
5935
|
+
radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
5936
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
5937
|
+
radial-gradient(ellipse calc(${thinW4} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
5938
|
+
radial-gradient(ellipse calc(21px * var(--beam-spike-${id})) calc(15px * var(--beam-spike2-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 1px), ${glowDotC} 0%, ${glowDot20} 20%, ${glowDot50} 50%, transparent 100%),
|
|
5939
|
+
radial-gradient(ellipse calc(42px * var(--beam-w-${id})) calc(40px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%, ${glowAmbC} 0%, ${glowAmb25} 25%, ${glowAmb55} 55%, transparent 80%)`;
|
|
5940
|
+
} else {
|
|
5941
|
+
const sc1_lt = isMono ? attenuateSpike(spikeColors.primary, 0.11) : withAlpha(spikeColors.primary, 0.85);
|
|
5942
|
+
const sc2_lt = isMono ? attenuateSpike(spikeColors.secondary, 0.09) : withAlpha(spikeColors.secondary, 0.7);
|
|
5943
|
+
return `radial-gradient(ellipse calc(${thinW1} * var(--beam-spike-${id})) calc(${thinH1} * var(--beam-h-${id})) at 8% calc(100% - 2px), ${sc1}, ${sc1_lt} 30%, transparent 88%),
|
|
5944
|
+
radial-gradient(ellipse calc(10px * var(--beam-spike2-${id})) calc(35px * var(--beam-h-${id})) at 22% calc(100% - 4px), ${sc2}, ${sc2_lt} 50%, transparent 95%),
|
|
5945
|
+
radial-gradient(ellipse calc(${thinW2} * (2 - var(--beam-spike-${id}))) calc(${thinH2} * var(--beam-h-${id})) at 36% calc(100% - 3px), ${spikes[0].color1}, ${spikes[0].color2} 40%, transparent 90%),
|
|
5946
|
+
radial-gradient(ellipse calc(14px * var(--beam-spike2-${id})) calc(28px * var(--beam-h-${id})) at 50% calc(100% - 2px), ${spikes[1].color1}, ${spikes[1].color2} 55%, transparent 96%),
|
|
5947
|
+
radial-gradient(ellipse calc(${thinW3} * (2 - var(--beam-spike2-${id}))) calc(${thinH3} * var(--beam-h-${id})) at 64% calc(100% - 4px), ${spikes[2].color1}, ${spikes[2].color2} 35%, transparent 89%),
|
|
5948
|
+
radial-gradient(ellipse calc(7px * var(--beam-spike-${id})) calc(45px * var(--beam-h-${id})) at 78% calc(100% - 2px), ${spikes[3].color1}, ${spikes[3].color2} 48%, transparent 94%),
|
|
5949
|
+
radial-gradient(ellipse calc(${thinLW} * (2 - var(--beam-spike-${id}))) calc(${thinH4} * var(--beam-h-${id})) at 92% calc(100% - 3px), ${spikes[4].color1}, ${spikes[4].color2} 42%, transparent 91%),
|
|
5950
|
+
radial-gradient(ellipse calc(50px * var(--beam-w-${id})) calc(32px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100%), rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.18) 30%, rgba(0, 0, 0, 0.03) 60%, transparent 85%)`;
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
var PULSE_RING_MAP = [
|
|
5954
|
+
{ region: 1, quad: "tl" },
|
|
5955
|
+
{ region: 2, quad: "tl" },
|
|
5956
|
+
{ region: 3, quad: "bl" },
|
|
5957
|
+
{ region: 1, quad: "bl" },
|
|
5958
|
+
{ region: 2, quad: "br" },
|
|
5959
|
+
{ region: 3, quad: "br" },
|
|
5960
|
+
{ region: 1, quad: "tr" },
|
|
5961
|
+
{ region: 2, quad: "tr" },
|
|
5962
|
+
{ region: 3, quad: "tr" }
|
|
5963
|
+
];
|
|
5964
|
+
var PULSE_INNER_SIZES = [
|
|
5965
|
+
[65, 35],
|
|
5966
|
+
[55, 30],
|
|
5967
|
+
[35, 65],
|
|
5968
|
+
[15, 30],
|
|
5969
|
+
[173, 28],
|
|
5970
|
+
[80, 22],
|
|
5971
|
+
[69, 28],
|
|
5972
|
+
[22, 38],
|
|
5973
|
+
[47, 44]
|
|
5974
|
+
];
|
|
5975
|
+
var PULSE_INNER_BLOOM = [
|
|
5976
|
+
{ ci: 0, region: 1, quad: "tl", w: 84, h: 48 },
|
|
5977
|
+
{ ci: 1, region: 2, quad: "tl", w: 72, h: 42 },
|
|
5978
|
+
{ ci: 2, region: 3, quad: "bl", w: 48, h: 84 },
|
|
5979
|
+
{ ci: 4, region: 2, quad: "br", w: 216, h: 38 },
|
|
5980
|
+
{ ci: 5, region: 3, quad: "br", w: 102, h: 31 },
|
|
5981
|
+
{ ci: 6, region: 1, quad: "tr", w: 89, h: 38 },
|
|
5982
|
+
{ ci: 8, region: 3, quad: "tr", w: 62, h: 58 }
|
|
5983
|
+
];
|
|
5984
|
+
var PULSE_OUTER_CORE = [
|
|
5985
|
+
{ ci: 0, region: 1, quad: "tl", w: 80, h: 19, x: "27%", y: "0%" },
|
|
5986
|
+
{ ci: 6, region: 2, quad: "tr", w: 74, h: 11, x: "73%", y: "-1%" },
|
|
5987
|
+
{ ci: 7, region: 3, quad: "tr", w: 15, h: 44, x: "100%", y: "33%" },
|
|
5988
|
+
{ ci: 8, region: 1, quad: "br", w: 19, h: 38, x: "101%", y: "72%" },
|
|
5989
|
+
{ ci: 4, region: 2, quad: "br", w: 84, h: 13, x: "67%", y: "100%" },
|
|
5990
|
+
{ ci: 1, region: 3, quad: "bl", w: 60, h: 21, x: "24%", y: "101%" },
|
|
5991
|
+
{ ci: 2, region: 1, quad: "bl", w: 17, h: 40, x: "0%", y: "60%" },
|
|
5992
|
+
{ ci: 3, region: 2, quad: "tl", w: 13, h: 32, x: "-1%", y: "28%" }
|
|
5993
|
+
];
|
|
5994
|
+
var PULSE_OUTER_BLOOM = [
|
|
5995
|
+
{ ci: 0, region: 1, quad: "tl", w: 110, h: 30, x: "27%", y: "3%" },
|
|
5996
|
+
{ ci: 6, region: 2, quad: "tr", w: 100, h: 20, x: "73%", y: "1%" },
|
|
5997
|
+
{ ci: 7, region: 3, quad: "tr", w: 26, h: 62, x: "100%", y: "33%" },
|
|
5998
|
+
{ ci: 8, region: 1, quad: "br", w: 30, h: 56, x: "101%", y: "72%" },
|
|
5999
|
+
{ ci: 4, region: 2, quad: "br", w: 120, h: 22, x: "67%", y: "99%" },
|
|
6000
|
+
{ ci: 1, region: 3, quad: "bl", w: 88, h: 32, x: "24%", y: "99%" },
|
|
6001
|
+
{ ci: 2, region: 1, quad: "bl", w: 28, h: 58, x: "0%", y: "60%" }
|
|
6002
|
+
];
|
|
6003
|
+
function withAlphaVar(color, quad, id) {
|
|
6004
|
+
const m = color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
6005
|
+
const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
|
|
6006
|
+
return `rgba(${rgb}, var(--bop-${quad}-${id}))`;
|
|
6007
|
+
}
|
|
6008
|
+
function pulseGrad(color, w, h, region, quad, x, y, id) {
|
|
6009
|
+
return `radial-gradient(ellipse calc(${w}px * var(--bw${region}-${id}) * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${h}px * var(--bh${region}-${id}) * var(--bgh-${id}) * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at calc(${x} + var(--bx${region}-${id})) calc(${y} + var(--by${region}-${id})), ${withAlphaVar(color, quad, id)}, transparent)`;
|
|
6010
|
+
}
|
|
6011
|
+
function pulseRingGradients(variant, id) {
|
|
6012
|
+
return colorPalettes[variant].border.map((c, i) => {
|
|
6013
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
6014
|
+
const [x, y] = c.pos.split(" ");
|
|
6015
|
+
const [w, h] = c.size.split(" ").map(parseFloat);
|
|
6016
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
6017
|
+
}).join(",\n ");
|
|
6018
|
+
}
|
|
6019
|
+
function pulseInnerGradients(variant, id, isDark) {
|
|
6020
|
+
const palette = colorPalettes[variant].border;
|
|
6021
|
+
const grads = palette.map((c, i) => {
|
|
6022
|
+
const { region, quad } = PULSE_RING_MAP[i];
|
|
6023
|
+
const [x, y] = c.pos.split(" ");
|
|
6024
|
+
const [w, h] = PULSE_INNER_SIZES[i];
|
|
6025
|
+
return pulseGrad(c.color, w, h, region, quad, x, y, id);
|
|
6026
|
+
});
|
|
6027
|
+
const cornerRGB = isDark ? "255, 255, 255" : "0, 0, 0";
|
|
6028
|
+
const cornerAlpha = isDark ? 0.18 : 0.08;
|
|
6029
|
+
const corners = [
|
|
6030
|
+
["0%", "0%", "tl"],
|
|
6031
|
+
["100%", "0%", "tr"],
|
|
6032
|
+
["0%", "100%", "bl"],
|
|
6033
|
+
["100%", "100%", "br"]
|
|
6034
|
+
];
|
|
6035
|
+
const cornerGrads = corners.map(
|
|
6036
|
+
([x, y, q]) => `radial-gradient(ellipse 60px 60px at ${x} ${y}, rgba(${cornerRGB}, calc(${cornerAlpha} * var(--bop-${q}-${id}))), transparent 70%)`
|
|
6037
|
+
);
|
|
6038
|
+
return [...grads, ...cornerGrads].join(",\n ");
|
|
6039
|
+
}
|
|
6040
|
+
function pulseTableGradients(table, variant, id) {
|
|
6041
|
+
const palette = colorPalettes[variant].border;
|
|
6042
|
+
return table.map((e) => {
|
|
6043
|
+
const c = palette[e.ci];
|
|
6044
|
+
const [px, py] = c.pos.split(" ");
|
|
6045
|
+
return pulseGrad(c.color, e.w, e.h, e.region, e.quad, e.x ?? px, e.y ?? py, id);
|
|
6046
|
+
}).join(",\n ");
|
|
6047
|
+
}
|
|
6048
|
+
function pulseTableGradientsStatic(table, variant, frozenAlpha) {
|
|
6049
|
+
const palette = colorPalettes[variant].border;
|
|
6050
|
+
const a = +frozenAlpha.toFixed(3);
|
|
6051
|
+
return table.map((e) => {
|
|
6052
|
+
const c = palette[e.ci];
|
|
6053
|
+
const [px, py] = c.pos.split(" ");
|
|
6054
|
+
const x = e.x ?? px;
|
|
6055
|
+
const y = e.y ?? py;
|
|
6056
|
+
const m = c.color.match(/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);
|
|
6057
|
+
const rgb = m ? `${m[1]}, ${m[2]}, ${m[3]}` : "255, 255, 255";
|
|
6058
|
+
return `radial-gradient(ellipse calc(${e.w}px * var(--pulse-glow-sx, 1) * var(--pulse-glow-boost, 1)) calc(${e.h}px * var(--pulse-glow-sy, 1) * var(--pulse-glow-boost, 1)) at ${x} ${y}, rgba(${rgb}, ${a}), transparent)`;
|
|
6059
|
+
}).join(",\n ");
|
|
6060
|
+
}
|
|
6061
|
+
function pausedAnimationsRule(id) {
|
|
6062
|
+
return `
|
|
6063
|
+
[data-beam="${id}"][data-paused],
|
|
6064
|
+
[data-beam="${id}"][data-paused]::after,
|
|
6065
|
+
[data-beam="${id}"][data-paused]::before,
|
|
6066
|
+
[data-beam="${id}"][data-paused] [data-beam-bloom] {
|
|
6067
|
+
animation-play-state: paused !important;
|
|
6068
|
+
}`;
|
|
6069
|
+
}
|
|
6070
|
+
function pulsePropertyRegs(id) {
|
|
6071
|
+
const numbers = ["bw1", "bh1", "bw2", "bh2", "bw3", "bh3", "bgh", "bop-tl", "bop-tr", "bop-bl", "bop-br"];
|
|
6072
|
+
const lengths = ["bx1", "by1", "bx2", "by2", "bx3", "by3"];
|
|
6073
|
+
const numReg = numbers.map(
|
|
6074
|
+
(n) => `@property --${n}-${id} {
|
|
6075
|
+
syntax: "<number>";
|
|
6076
|
+
initial-value: 1;
|
|
6077
|
+
inherits: true;
|
|
6078
|
+
}`
|
|
6079
|
+
).join("\n\n");
|
|
6080
|
+
const lenReg = lengths.map(
|
|
6081
|
+
(n) => `@property --${n}-${id} {
|
|
6082
|
+
syntax: "<length>";
|
|
6083
|
+
initial-value: 0px;
|
|
6084
|
+
inherits: true;
|
|
6085
|
+
}`
|
|
6086
|
+
).join("\n\n");
|
|
6087
|
+
return `${numReg}
|
|
6088
|
+
|
|
6089
|
+
${lenReg}
|
|
6090
|
+
|
|
6091
|
+
@property --beam-opacity-${id} {
|
|
6092
|
+
syntax: "<number>";
|
|
6093
|
+
initial-value: 0;
|
|
6094
|
+
inherits: true;
|
|
6095
|
+
}
|
|
6096
|
+
|
|
6097
|
+
@property --beam-hue-${id} {
|
|
6098
|
+
syntax: "<angle>";
|
|
6099
|
+
initial-value: 0deg;
|
|
6100
|
+
inherits: true;
|
|
6101
|
+
}`;
|
|
6102
|
+
}
|
|
6103
|
+
function pulseParams(size, theme, duration) {
|
|
6104
|
+
const isDark = theme === "dark";
|
|
6105
|
+
const durScale = duration / 2.3;
|
|
6106
|
+
if (size === "pulse-inner") {
|
|
6107
|
+
return {
|
|
6108
|
+
sp: 0.28,
|
|
6109
|
+
dr: isDark ? 33 : 40,
|
|
6110
|
+
op: isDark ? 0.48 : 0.45,
|
|
6111
|
+
gh: isDark ? 0.34 : 0.22,
|
|
6112
|
+
bs: (isDark ? 1.9 : 2.6) * durScale,
|
|
6113
|
+
ss: (isDark ? 2.6 : 4.6) * durScale,
|
|
6114
|
+
ghs: (isDark ? 2.4 : 5.5) * durScale,
|
|
6115
|
+
// Full hue revolution period (seconds) — colors continuously cycle.
|
|
6116
|
+
huePeriod: 16
|
|
6117
|
+
};
|
|
6118
|
+
}
|
|
6119
|
+
return {
|
|
6120
|
+
sp: isDark ? 0.28 : 0.36,
|
|
6121
|
+
dr: isDark ? 14 : 19,
|
|
6122
|
+
op: isDark ? 0.46 : 0,
|
|
6123
|
+
gh: isDark ? 0.16 : 0.58,
|
|
6124
|
+
bs: (isDark ? 2.3 : 3.7) * durScale,
|
|
6125
|
+
ss: (isDark ? 6.4 : 4.6) * durScale,
|
|
6126
|
+
ghs: (isDark ? 2.4 : 3.8) * durScale,
|
|
6127
|
+
// Full hue revolution period (seconds) — colors continuously cycle.
|
|
6128
|
+
huePeriod: 14
|
|
6129
|
+
};
|
|
6130
|
+
}
|
|
6131
|
+
function pulseOscillatorDefs(id, p) {
|
|
6132
|
+
const { sp, dr, op, gh, bs, ss, ghs } = p;
|
|
6133
|
+
return [
|
|
6134
|
+
{ prop: `--bw1-${id}`, a: 1 - sp, b: 1 + sp * 1.1, period: ss * 0.9, delay: 0, unit: "" },
|
|
6135
|
+
{ prop: `--bh1-${id}`, a: 1 + sp * 0.9, b: 1 - sp * 0.85, period: ss * 1.26, delay: 0, unit: "" },
|
|
6136
|
+
{ prop: `--bx1-${id}`, a: -dr, b: dr * 0.9, period: bs * 1.6, delay: 0, unit: "px" },
|
|
6137
|
+
{ prop: `--by1-${id}`, a: dr * 0.55, b: -dr * 0.7, period: bs * 1.6, delay: 0, unit: "px" },
|
|
6138
|
+
{ prop: `--bw2-${id}`, a: 1 + sp, b: 1 - sp * 0.85, period: ss * 1.1, delay: 0, unit: "" },
|
|
6139
|
+
{ prop: `--bh2-${id}`, a: 1 - sp * 0.8, b: 1 + sp * 1.05, period: ss * 0.81, delay: 0, unit: "" },
|
|
6140
|
+
{ prop: `--bx2-${id}`, a: dr * 0.8, b: -dr * 0.9, period: bs * 1.88, delay: 0, unit: "px" },
|
|
6141
|
+
{ prop: `--by2-${id}`, a: -dr, b: dr * 0.65, period: bs * 1.88, delay: 0, unit: "px" },
|
|
6142
|
+
{ prop: `--bw3-${id}`, a: 1 - sp * 0.6, b: 1 + sp * 1.15, period: ss * 0.98, delay: 0, unit: "" },
|
|
6143
|
+
{ prop: `--bh3-${id}`, a: 1 + sp * 0.75, b: 1 - sp, period: ss * 1.4, delay: 0, unit: "" },
|
|
6144
|
+
{ prop: `--bx3-${id}`, a: -dr * 0.6, b: dr, period: bs * 1.45, delay: 0, unit: "px" },
|
|
6145
|
+
{ prop: `--by3-${id}`, a: -dr * 0.85, b: dr * 0.45, period: bs * 1.45, delay: 0, unit: "px" },
|
|
6146
|
+
{ prop: `--bgh-${id}`, a: 1 - gh, b: 1 + gh, period: ghs, delay: 0, unit: "" },
|
|
6147
|
+
{ prop: `--bop-tl-${id}`, a: 1 - op, b: 1, period: bs, delay: 0, unit: "" },
|
|
6148
|
+
{ prop: `--bop-tr-${id}`, a: 1 - op, b: 1, period: bs * 1.32, delay: bs * 0.28, unit: "" },
|
|
6149
|
+
{ prop: `--bop-bl-${id}`, a: 1 - op, b: 1, period: bs * 0.84, delay: bs * 0.55, unit: "" },
|
|
6150
|
+
{ prop: `--bop-br-${id}`, a: 1 - op, b: 1, period: bs * 1.58, delay: bs * 0.83, unit: "" }
|
|
6151
|
+
];
|
|
6152
|
+
}
|
|
6153
|
+
function getPulseDriverConfig(size, theme, duration, _hueRange, staticColors, id) {
|
|
6154
|
+
if (size !== "pulse-inner" && size !== "pulse-outside") return null;
|
|
6155
|
+
const p = pulseParams(size, theme, duration);
|
|
6156
|
+
return {
|
|
6157
|
+
oscillators: pulseOscillatorDefs(id, p),
|
|
6158
|
+
// Pulse colors continuously rotate a full hue circle so the palette is never
|
|
6159
|
+
// pinned to fixed edges (no more "always red top-right / green left").
|
|
6160
|
+
hue: staticColors ? null : { prop: `--beam-hue-${id}`, range: 360, period: p.huePeriod, continuous: true }
|
|
6161
|
+
};
|
|
6162
|
+
}
|
|
6163
|
+
function pulseWrapperAnimation(id, fadeName, fadeDur) {
|
|
6164
|
+
return ` animation: ${fadeName}-${id} ${fadeDur}s ease forwards;`;
|
|
6165
|
+
}
|
|
6166
|
+
function generateBeamCSS(options) {
|
|
6167
|
+
const { size } = options;
|
|
6168
|
+
if (size === "line") {
|
|
6169
|
+
return generateLineVariantCSS(options);
|
|
6170
|
+
}
|
|
6171
|
+
if (size === "sm") {
|
|
6172
|
+
return generateSmallVariantCSS(options);
|
|
6173
|
+
}
|
|
6174
|
+
if (size === "pulse-inner") {
|
|
6175
|
+
return generatePulseInnerVariantCSS(options);
|
|
6176
|
+
}
|
|
6177
|
+
if (size === "pulse-outside") {
|
|
6178
|
+
return generatePulseOuterVariantCSS(options);
|
|
6179
|
+
}
|
|
6180
|
+
return generateBorderVariantCSS(options);
|
|
6181
|
+
}
|
|
6182
|
+
function generateSmallVariantCSS(options) {
|
|
6183
|
+
const {
|
|
6184
|
+
id,
|
|
6185
|
+
borderRadius,
|
|
6186
|
+
borderWidth,
|
|
6187
|
+
duration,
|
|
6188
|
+
strokeOpacity,
|
|
6189
|
+
innerOpacity,
|
|
6190
|
+
bloomOpacity,
|
|
6191
|
+
innerShadow,
|
|
6192
|
+
colorVariant,
|
|
6193
|
+
staticColors,
|
|
6194
|
+
brightness,
|
|
6195
|
+
saturation,
|
|
6196
|
+
hueRange,
|
|
6197
|
+
theme
|
|
6198
|
+
} = options;
|
|
6199
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
6200
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
|
|
6201
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
6202
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
6203
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
6204
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
6205
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
6206
|
+
@keyframes beam-hue-shift-${id} {
|
|
6207
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6208
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6209
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6210
|
+
}`;
|
|
6211
|
+
const isDark = theme === "dark";
|
|
6212
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
6213
|
+
from var(--beam-angle-${id}),
|
|
6214
|
+
transparent 0%, transparent 54%,
|
|
6215
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
6216
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
6217
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
6218
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
6219
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
6220
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
6221
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
6222
|
+
transparent 78%, transparent 100%
|
|
6223
|
+
)` : `conic-gradient(
|
|
6224
|
+
from var(--beam-angle-${id}),
|
|
6225
|
+
transparent 0%, transparent 54%,
|
|
6226
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
6227
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
6228
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
6229
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
6230
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
6231
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
6232
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
6233
|
+
transparent 78%, transparent 100%
|
|
6234
|
+
)`;
|
|
6235
|
+
const colorGradients = getSmallColorGradients(colorVariant);
|
|
6236
|
+
const innerGradients = getSmallInnerGradients(colorVariant);
|
|
6237
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
6238
|
+
from var(--beam-angle-${id}),
|
|
6239
|
+
transparent 0%, transparent 58%,
|
|
6240
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
6241
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
6242
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
6243
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
6244
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
6245
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
6246
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
6247
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
6248
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
6249
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
6250
|
+
transparent 82%
|
|
6251
|
+
)` : `conic-gradient(
|
|
6252
|
+
from var(--beam-angle-${id}),
|
|
6253
|
+
transparent 0%, transparent 58%,
|
|
6254
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
6255
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
6256
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
6257
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
6258
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
6259
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
6260
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
6261
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
6262
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
6263
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
6264
|
+
transparent 82%
|
|
6265
|
+
)`;
|
|
6266
|
+
const smallMask = `conic-gradient(
|
|
6267
|
+
from var(--beam-angle-${id}),
|
|
6268
|
+
transparent 0%, transparent 22%,
|
|
6269
|
+
rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0.4) 36%,
|
|
6270
|
+
white 46%, white 82%,
|
|
6271
|
+
rgba(255, 255, 255, 0.4) 88%, rgba(255, 255, 255, 0.12) 94%,
|
|
6272
|
+
transparent 97%, transparent 100%
|
|
6273
|
+
)`;
|
|
6274
|
+
return `
|
|
6275
|
+
@property --beam-angle-${id} {
|
|
6276
|
+
syntax: "<angle>";
|
|
6277
|
+
initial-value: 0deg;
|
|
6278
|
+
inherits: true;
|
|
6279
|
+
}
|
|
6280
|
+
|
|
6281
|
+
@property --beam-opacity-${id} {
|
|
6282
|
+
syntax: "<number>";
|
|
6283
|
+
initial-value: 0;
|
|
6284
|
+
inherits: true;
|
|
6285
|
+
}
|
|
6286
|
+
|
|
6287
|
+
[data-beam="${id}"] {
|
|
6288
|
+
position: relative;
|
|
6289
|
+
border-radius: ${borderRadius}px;
|
|
6290
|
+
overflow: hidden;
|
|
6291
|
+
}
|
|
6292
|
+
|
|
6293
|
+
[data-beam="${id}"][data-active] {
|
|
6294
|
+
animation:
|
|
6295
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
6296
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
6297
|
+
}
|
|
6298
|
+
|
|
6299
|
+
[data-beam="${id}"][data-fading] {
|
|
6300
|
+
animation:
|
|
6301
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
6302
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
6303
|
+
}
|
|
6304
|
+
|
|
6305
|
+
[data-beam="${id}"][data-active]::after,
|
|
6306
|
+
[data-beam="${id}"][data-fading]::after {
|
|
6307
|
+
content: "";
|
|
6308
|
+
position: absolute;
|
|
6309
|
+
inset: 0;
|
|
6310
|
+
border-radius: ${innerRadius}px;
|
|
6311
|
+
padding: ${borderWidth}px;
|
|
6312
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6313
|
+
background: ${whiteGradient},${colorGradients};
|
|
6314
|
+
-webkit-mask:
|
|
6315
|
+
conic-gradient(
|
|
6316
|
+
from var(--beam-angle-${id}),
|
|
6317
|
+
transparent 0%, transparent 30%,
|
|
6318
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6319
|
+
white 52%, white 80%,
|
|
6320
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6321
|
+
transparent 95%, transparent 100%
|
|
6322
|
+
),
|
|
6323
|
+
linear-gradient(#fff 0 0) content-box,
|
|
6324
|
+
linear-gradient(#fff 0 0);
|
|
6325
|
+
-webkit-mask-composite: source-in, xor;
|
|
6326
|
+
mask:
|
|
6327
|
+
conic-gradient(
|
|
6328
|
+
from var(--beam-angle-${id}),
|
|
6329
|
+
transparent 0%, transparent 30%,
|
|
6330
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6331
|
+
white 52%, white 80%,
|
|
6332
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6333
|
+
transparent 95%, transparent 100%
|
|
6334
|
+
),
|
|
6335
|
+
linear-gradient(#fff 0 0) content-box,
|
|
6336
|
+
linear-gradient(#fff 0 0);
|
|
6337
|
+
mask-composite: intersect, exclude;
|
|
6338
|
+
pointer-events: none;
|
|
6339
|
+
z-index: 2;
|
|
6340
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
6341
|
+
${hueShiftAnimation}
|
|
6342
|
+
}
|
|
6343
|
+
|
|
6344
|
+
[data-beam="${id}"][data-active]::before,
|
|
6345
|
+
[data-beam="${id}"][data-fading]::before {
|
|
6346
|
+
content: "";
|
|
6347
|
+
position: absolute;
|
|
6348
|
+
inset: 0;
|
|
6349
|
+
border-radius: ${borderRadius}px;
|
|
6350
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6351
|
+
background: ${innerGradients};
|
|
6352
|
+
box-shadow: inset 0 0 5px 1px ${innerShadow};
|
|
6353
|
+
-webkit-mask-image: ${smallMask};
|
|
6354
|
+
-webkit-mask-composite: source-over;
|
|
6355
|
+
mask-image: ${smallMask};
|
|
6356
|
+
mask-composite: add;
|
|
6357
|
+
pointer-events: none;
|
|
6358
|
+
z-index: 1;
|
|
6359
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
6360
|
+
${hueShiftAnimation}
|
|
6361
|
+
}
|
|
6362
|
+
|
|
6363
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
6364
|
+
display: none;
|
|
6365
|
+
position: absolute;
|
|
6366
|
+
inset: 0;
|
|
6367
|
+
border-radius: ${innerRadius}px;
|
|
6368
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6369
|
+
background: ${bloomGradient};
|
|
6370
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6371
|
+
-webkit-mask-composite: xor;
|
|
6372
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6373
|
+
mask-composite: exclude;
|
|
6374
|
+
padding: ${borderWidth}px;
|
|
6375
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
6376
|
+
pointer-events: none;
|
|
6377
|
+
z-index: 3;
|
|
6378
|
+
opacity: 0;
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6382
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6383
|
+
display: block;
|
|
6384
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
6385
|
+
}
|
|
6386
|
+
|
|
6387
|
+
@keyframes beam-spin-${id} {
|
|
6388
|
+
to { --beam-angle-${id}: 360deg; }
|
|
6389
|
+
}
|
|
6390
|
+
|
|
6391
|
+
@keyframes beam-fade-in-${id} {
|
|
6392
|
+
to { --beam-opacity-${id}: 1; }
|
|
6393
|
+
}
|
|
6394
|
+
|
|
6395
|
+
@keyframes beam-fade-out-${id} {
|
|
6396
|
+
from { --beam-opacity-${id}: 1; }
|
|
6397
|
+
to { --beam-opacity-${id}: 0; }
|
|
6398
|
+
}
|
|
6399
|
+
${hueShiftKeyframes}
|
|
6400
|
+
${pausedAnimationsRule(id)}
|
|
6401
|
+
`;
|
|
6402
|
+
}
|
|
6403
|
+
function generateBorderVariantCSS(options) {
|
|
6404
|
+
const {
|
|
6405
|
+
id,
|
|
6406
|
+
borderRadius,
|
|
6407
|
+
borderWidth,
|
|
6408
|
+
duration,
|
|
6409
|
+
strokeOpacity,
|
|
6410
|
+
innerOpacity,
|
|
6411
|
+
bloomOpacity,
|
|
6412
|
+
innerShadow,
|
|
6413
|
+
colorVariant,
|
|
6414
|
+
staticColors,
|
|
6415
|
+
brightness,
|
|
6416
|
+
saturation,
|
|
6417
|
+
hueRange,
|
|
6418
|
+
theme
|
|
6419
|
+
} = options;
|
|
6420
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
6421
|
+
const monoOpacityMultiplier = colorVariant === "mono" ? 0.5 : 1;
|
|
6422
|
+
const finalStrokeOpacity = strokeOpacity * monoOpacityMultiplier;
|
|
6423
|
+
const finalInnerOpacity = innerOpacity * monoOpacityMultiplier;
|
|
6424
|
+
const finalBloomOpacity = bloomOpacity * monoOpacityMultiplier;
|
|
6425
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
6426
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
6427
|
+
@keyframes beam-hue-shift-${id} {
|
|
6428
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6429
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6430
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6431
|
+
}`;
|
|
6432
|
+
const isDark = theme === "dark";
|
|
6433
|
+
const whiteGradient = isDark ? `conic-gradient(
|
|
6434
|
+
from var(--beam-angle-${id}),
|
|
6435
|
+
transparent 0%, transparent 54%,
|
|
6436
|
+
rgba(255, 255, 255, 0.1) 57%,
|
|
6437
|
+
rgba(255, 255, 255, 0.3) 60%,
|
|
6438
|
+
rgba(255, 255, 255, 0.6) 63%,
|
|
6439
|
+
rgba(255, 255, 255, 0.75) 66%,
|
|
6440
|
+
rgba(255, 255, 255, 0.6) 69%,
|
|
6441
|
+
rgba(255, 255, 255, 0.3) 72%,
|
|
6442
|
+
rgba(255, 255, 255, 0.1) 75%,
|
|
6443
|
+
transparent 78%, transparent 100%
|
|
6444
|
+
)` : `conic-gradient(
|
|
6445
|
+
from var(--beam-angle-${id}),
|
|
6446
|
+
transparent 0%, transparent 54%,
|
|
6447
|
+
rgba(0, 0, 0, 0.08) 57%,
|
|
6448
|
+
rgba(0, 0, 0, 0.2) 60%,
|
|
6449
|
+
rgba(0, 0, 0, 0.4) 63%,
|
|
6450
|
+
rgba(0, 0, 0, 0.55) 66%,
|
|
6451
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
6452
|
+
rgba(0, 0, 0, 0.2) 72%,
|
|
6453
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
6454
|
+
transparent 78%, transparent 100%
|
|
6455
|
+
)`;
|
|
6456
|
+
const colorGradients = getColorGradients(colorVariant);
|
|
6457
|
+
const innerGradients = getInnerGradients(colorVariant);
|
|
6458
|
+
const bloomGradient = isDark ? `conic-gradient(
|
|
6459
|
+
from var(--beam-angle-${id}),
|
|
6460
|
+
transparent 0%, transparent 58%,
|
|
6461
|
+
rgba(255, 255, 255, 0.03) 62%,
|
|
6462
|
+
rgba(255, 255, 255, 0.08) 65%,
|
|
6463
|
+
rgba(255, 255, 255, 0.2) 67%,
|
|
6464
|
+
rgba(255, 255, 255, 0.45) 69%,
|
|
6465
|
+
rgba(255, 255, 255, 0.85) 70%,
|
|
6466
|
+
rgba(255, 255, 255, 0.85) 70.5%,
|
|
6467
|
+
rgba(255, 255, 255, 0.45) 71.5%,
|
|
6468
|
+
rgba(255, 255, 255, 0.2) 73%,
|
|
6469
|
+
rgba(255, 255, 255, 0.08) 75%,
|
|
6470
|
+
rgba(255, 255, 255, 0.03) 78%,
|
|
6471
|
+
transparent 82%
|
|
6472
|
+
)` : `conic-gradient(
|
|
6473
|
+
from var(--beam-angle-${id}),
|
|
6474
|
+
transparent 0%, transparent 58%,
|
|
6475
|
+
rgba(0, 0, 0, 0.02) 62%,
|
|
6476
|
+
rgba(0, 0, 0, 0.08) 65%,
|
|
6477
|
+
rgba(0, 0, 0, 0.2) 67%,
|
|
6478
|
+
rgba(0, 0, 0, 0.4) 69%,
|
|
6479
|
+
rgba(0, 0, 0, 0.6) 70%,
|
|
6480
|
+
rgba(0, 0, 0, 0.6) 70.5%,
|
|
6481
|
+
rgba(0, 0, 0, 0.4) 71.5%,
|
|
6482
|
+
rgba(0, 0, 0, 0.2) 73%,
|
|
6483
|
+
rgba(0, 0, 0, 0.08) 75%,
|
|
6484
|
+
rgba(0, 0, 0, 0.02) 78%,
|
|
6485
|
+
transparent 82%
|
|
6486
|
+
)`;
|
|
6487
|
+
return `
|
|
6488
|
+
@property --beam-angle-${id} {
|
|
6489
|
+
syntax: "<angle>";
|
|
6490
|
+
initial-value: 0deg;
|
|
6491
|
+
inherits: true;
|
|
6492
|
+
}
|
|
6493
|
+
|
|
6494
|
+
@property --beam-opacity-${id} {
|
|
6495
|
+
syntax: "<number>";
|
|
6496
|
+
initial-value: 0;
|
|
6497
|
+
inherits: true;
|
|
6498
|
+
}
|
|
6499
|
+
|
|
6500
|
+
[data-beam="${id}"] {
|
|
6501
|
+
position: relative;
|
|
6502
|
+
border-radius: ${borderRadius}px;
|
|
6503
|
+
overflow: hidden;
|
|
6504
|
+
}
|
|
6505
|
+
|
|
6506
|
+
[data-beam="${id}"][data-active] {
|
|
6507
|
+
animation:
|
|
6508
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
6509
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
6510
|
+
}
|
|
6511
|
+
|
|
6512
|
+
[data-beam="${id}"][data-fading] {
|
|
6513
|
+
animation:
|
|
6514
|
+
beam-spin-${id} ${duration}s linear infinite,
|
|
6515
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
6516
|
+
}
|
|
6517
|
+
|
|
6518
|
+
[data-beam="${id}"][data-active]::after,
|
|
6519
|
+
[data-beam="${id}"][data-fading]::after {
|
|
6520
|
+
content: "";
|
|
6521
|
+
position: absolute;
|
|
6522
|
+
inset: 0;
|
|
6523
|
+
border-radius: ${innerRadius}px;
|
|
6524
|
+
padding: ${borderWidth}px;
|
|
6525
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6526
|
+
background: ${whiteGradient},${colorGradients};
|
|
6527
|
+
-webkit-mask:
|
|
6528
|
+
conic-gradient(
|
|
6529
|
+
from var(--beam-angle-${id}),
|
|
6530
|
+
transparent 0%, transparent 30%,
|
|
6531
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6532
|
+
white 52%, white 80%,
|
|
6533
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6534
|
+
transparent 95%, transparent 100%
|
|
6535
|
+
),
|
|
6536
|
+
linear-gradient(#fff 0 0) content-box,
|
|
6537
|
+
linear-gradient(#fff 0 0);
|
|
6538
|
+
-webkit-mask-composite: source-in, xor;
|
|
6539
|
+
mask:
|
|
6540
|
+
conic-gradient(
|
|
6541
|
+
from var(--beam-angle-${id}),
|
|
6542
|
+
transparent 0%, transparent 30%,
|
|
6543
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6544
|
+
white 52%, white 80%,
|
|
6545
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6546
|
+
transparent 95%, transparent 100%
|
|
6547
|
+
),
|
|
6548
|
+
linear-gradient(#fff 0 0) content-box,
|
|
6549
|
+
linear-gradient(#fff 0 0);
|
|
6550
|
+
mask-composite: intersect, exclude;
|
|
6551
|
+
pointer-events: none;
|
|
6552
|
+
z-index: 2;
|
|
6553
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
6554
|
+
${hueShiftAnimation}
|
|
6555
|
+
}
|
|
6556
|
+
|
|
6557
|
+
[data-beam="${id}"][data-active]::before,
|
|
6558
|
+
[data-beam="${id}"][data-fading]::before {
|
|
6559
|
+
content: "";
|
|
6560
|
+
position: absolute;
|
|
6561
|
+
inset: 0;
|
|
6562
|
+
border-radius: ${borderRadius}px;
|
|
6563
|
+
background: ${innerGradients};
|
|
6564
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
6565
|
+
-webkit-mask-image:
|
|
6566
|
+
conic-gradient(
|
|
6567
|
+
from var(--beam-angle-${id}),
|
|
6568
|
+
transparent 0%, transparent 30%,
|
|
6569
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6570
|
+
white 52%, white 80%,
|
|
6571
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6572
|
+
transparent 95%, transparent 100%
|
|
6573
|
+
),
|
|
6574
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
6575
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
6576
|
+
-webkit-mask-composite: source-in, source-over;
|
|
6577
|
+
mask-image:
|
|
6578
|
+
conic-gradient(
|
|
6579
|
+
from var(--beam-angle-${id}),
|
|
6580
|
+
transparent 0%, transparent 30%,
|
|
6581
|
+
rgba(255, 255, 255, 0.1) 36%, rgba(255, 255, 255, 0.35) 44%,
|
|
6582
|
+
white 52%, white 80%,
|
|
6583
|
+
rgba(255, 255, 255, 0.35) 86%, rgba(255, 255, 255, 0.1) 92%,
|
|
6584
|
+
transparent 95%, transparent 100%
|
|
6585
|
+
),
|
|
6586
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
6587
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
6588
|
+
mask-composite: intersect, add;
|
|
6589
|
+
pointer-events: none;
|
|
6590
|
+
z-index: 1;
|
|
6591
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
6592
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6593
|
+
${hueShiftAnimation}
|
|
6594
|
+
}
|
|
6595
|
+
|
|
6596
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
6597
|
+
display: none;
|
|
6598
|
+
position: absolute;
|
|
6599
|
+
inset: 0;
|
|
6600
|
+
border-radius: ${innerRadius}px;
|
|
6601
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6602
|
+
background: ${bloomGradient};
|
|
6603
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6604
|
+
-webkit-mask-composite: xor;
|
|
6605
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6606
|
+
mask-composite: exclude;
|
|
6607
|
+
padding: ${borderWidth}px;
|
|
6608
|
+
filter: blur(8px) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)});
|
|
6609
|
+
pointer-events: none;
|
|
6610
|
+
z-index: 3;
|
|
6611
|
+
opacity: 0;
|
|
6612
|
+
}
|
|
6613
|
+
|
|
6614
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6615
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6616
|
+
display: block;
|
|
6617
|
+
opacity: calc(var(--beam-opacity-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
6618
|
+
}
|
|
6619
|
+
|
|
6620
|
+
@keyframes beam-spin-${id} {
|
|
6621
|
+
to { --beam-angle-${id}: 360deg; }
|
|
6622
|
+
}
|
|
6623
|
+
|
|
6624
|
+
@keyframes beam-fade-in-${id} {
|
|
6625
|
+
to { --beam-opacity-${id}: 1; }
|
|
6626
|
+
}
|
|
6627
|
+
|
|
6628
|
+
@keyframes beam-fade-out-${id} {
|
|
6629
|
+
from { --beam-opacity-${id}: 1; }
|
|
6630
|
+
to { --beam-opacity-${id}: 0; }
|
|
6631
|
+
}
|
|
6632
|
+
${hueShiftKeyframes}
|
|
6633
|
+
${pausedAnimationsRule(id)}
|
|
6634
|
+
`;
|
|
6635
|
+
}
|
|
6636
|
+
function generatePulseInnerVariantCSS(options) {
|
|
6637
|
+
const {
|
|
6638
|
+
id,
|
|
6639
|
+
borderRadius,
|
|
6640
|
+
borderWidth,
|
|
6641
|
+
duration,
|
|
6642
|
+
strokeOpacity,
|
|
6643
|
+
innerOpacity,
|
|
6644
|
+
bloomOpacity,
|
|
6645
|
+
colorVariant,
|
|
6646
|
+
staticColors,
|
|
6647
|
+
brightness,
|
|
6648
|
+
saturation,
|
|
6649
|
+
theme
|
|
6650
|
+
} = options;
|
|
6651
|
+
const isDark = theme === "dark";
|
|
6652
|
+
const monoMul = colorVariant === "mono" ? 0.5 : 1;
|
|
6653
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
6654
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
6655
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
6656
|
+
const { op } = pulseParams("pulse-inner", theme, duration);
|
|
6657
|
+
const bloomBlur = 8;
|
|
6658
|
+
const b = brightness.toFixed(2);
|
|
6659
|
+
const s = saturation.toFixed(2);
|
|
6660
|
+
const ringAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
6661
|
+
const bloomAnim = staticColors ? `filter: blur(${bloomBlur}px) brightness(${b}) saturate(${s});` : `filter: blur(${bloomBlur}px) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
6662
|
+
const ringGradients = pulseRingGradients(colorVariant, id);
|
|
6663
|
+
const innerGradients = pulseInnerGradients(colorVariant, id, isDark);
|
|
6664
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_INNER_BLOOM, colorVariant, 1 - op * 0.5);
|
|
6665
|
+
return `
|
|
6666
|
+
${pulsePropertyRegs(id)}
|
|
6667
|
+
|
|
6668
|
+
[data-beam="${id}"] {
|
|
6669
|
+
position: relative;
|
|
6670
|
+
border-radius: ${borderRadius}px;
|
|
6671
|
+
overflow: hidden;
|
|
6672
|
+
isolation: isolate;
|
|
6673
|
+
}
|
|
6674
|
+
|
|
6675
|
+
[data-beam="${id}"][data-active] {
|
|
6676
|
+
${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
|
|
6677
|
+
}
|
|
6678
|
+
|
|
6679
|
+
[data-beam="${id}"][data-fading] {
|
|
6680
|
+
${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
|
|
6681
|
+
}
|
|
6682
|
+
|
|
6683
|
+
[data-beam="${id}"][data-active]::after,
|
|
6684
|
+
[data-beam="${id}"][data-fading]::after {
|
|
6685
|
+
content: "";
|
|
6686
|
+
position: absolute;
|
|
6687
|
+
inset: 0;
|
|
6688
|
+
border-radius: ${borderRadius}px;
|
|
6689
|
+
padding: ${borderWidth}px;
|
|
6690
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6691
|
+
background: ${ringGradients};
|
|
6692
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6693
|
+
-webkit-mask-composite: xor;
|
|
6694
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6695
|
+
mask-composite: exclude;
|
|
6696
|
+
pointer-events: none;
|
|
6697
|
+
z-index: 2;
|
|
6698
|
+
will-change: opacity, filter;
|
|
6699
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
6700
|
+
${ringAnim}
|
|
6701
|
+
}
|
|
6702
|
+
|
|
6703
|
+
[data-beam="${id}"][data-active]::before,
|
|
6704
|
+
[data-beam="${id}"][data-fading]::before {
|
|
6705
|
+
content: "";
|
|
6706
|
+
position: absolute;
|
|
6707
|
+
inset: 0;
|
|
6708
|
+
border-radius: ${borderRadius}px;
|
|
6709
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6710
|
+
background: ${innerGradients};
|
|
6711
|
+
-webkit-mask-image:
|
|
6712
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
6713
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
6714
|
+
-webkit-mask-composite: source-over;
|
|
6715
|
+
mask-image:
|
|
6716
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
6717
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
6718
|
+
mask-composite: add;
|
|
6719
|
+
pointer-events: none;
|
|
6720
|
+
z-index: 1;
|
|
6721
|
+
will-change: opacity, filter;
|
|
6722
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
6723
|
+
${ringAnim}
|
|
6724
|
+
}
|
|
6725
|
+
|
|
6726
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
6727
|
+
display: none;
|
|
6728
|
+
position: absolute;
|
|
6729
|
+
inset: 0;
|
|
6730
|
+
border-radius: ${borderRadius}px;
|
|
6731
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6732
|
+
background: ${bloomGradients};
|
|
6733
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6734
|
+
-webkit-mask-composite: xor;
|
|
6735
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6736
|
+
mask-composite: exclude;
|
|
6737
|
+
padding: ${borderWidth}px;
|
|
6738
|
+
pointer-events: none;
|
|
6739
|
+
z-index: 3;
|
|
6740
|
+
will-change: opacity;
|
|
6741
|
+
opacity: 0;
|
|
6742
|
+
}
|
|
6743
|
+
|
|
6744
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6745
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6746
|
+
display: block;
|
|
6747
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
6748
|
+
${bloomAnim}
|
|
6749
|
+
}
|
|
6750
|
+
|
|
6751
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
6752
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
6753
|
+
${pausedAnimationsRule(id)}
|
|
6754
|
+
|
|
6755
|
+
@media (prefers-reduced-motion: reduce) {
|
|
6756
|
+
[data-beam="${id}"][data-active],
|
|
6757
|
+
[data-beam="${id}"][data-fading],
|
|
6758
|
+
[data-beam="${id}"][data-active]::after,
|
|
6759
|
+
[data-beam="${id}"][data-fading]::after,
|
|
6760
|
+
[data-beam="${id}"][data-active]::before,
|
|
6761
|
+
[data-beam="${id}"][data-fading]::before,
|
|
6762
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6763
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6764
|
+
animation: none !important;
|
|
6765
|
+
}
|
|
6766
|
+
}
|
|
6767
|
+
`;
|
|
6768
|
+
}
|
|
6769
|
+
function generatePulseOuterVariantCSS(options) {
|
|
6770
|
+
const {
|
|
6771
|
+
id,
|
|
6772
|
+
borderRadius,
|
|
6773
|
+
duration,
|
|
6774
|
+
strokeOpacity,
|
|
6775
|
+
innerOpacity,
|
|
6776
|
+
bloomOpacity,
|
|
6777
|
+
colorVariant,
|
|
6778
|
+
staticColors,
|
|
6779
|
+
brightness,
|
|
6780
|
+
saturation,
|
|
6781
|
+
theme,
|
|
6782
|
+
hairlineOpacity = 0
|
|
6783
|
+
} = options;
|
|
6784
|
+
const isDark = theme === "dark";
|
|
6785
|
+
const monoMul = colorVariant === "mono" ? 0.5 : 1;
|
|
6786
|
+
const sStroke = (strokeOpacity * monoMul).toFixed(2);
|
|
6787
|
+
const sInner = (innerOpacity * monoMul).toFixed(2);
|
|
6788
|
+
const sBloom = (bloomOpacity * monoMul).toFixed(2);
|
|
6789
|
+
const hairRGB = isDark ? "70, 70, 70" : "0, 0, 0";
|
|
6790
|
+
const hairOp = hairlineOpacity.toFixed(2);
|
|
6791
|
+
const hairlineLine = `linear-gradient(rgba(${hairRGB}, ${hairOp}), rgba(${hairRGB}, ${hairOp}))`;
|
|
6792
|
+
const { op } = pulseParams("pulse-outside", theme, duration);
|
|
6793
|
+
const sw = 0.95;
|
|
6794
|
+
const sh = 0.9;
|
|
6795
|
+
const glowBlur = isDark ? 3 : 6;
|
|
6796
|
+
const bloomBlur = isDark ? 22.5 : 15;
|
|
6797
|
+
const b = brightness.toFixed(2);
|
|
6798
|
+
const s = saturation.toFixed(2);
|
|
6799
|
+
const strokeAnim = staticColors ? `filter: brightness(${b}) saturate(${s});` : `filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) brightness(${b}) saturate(${s});`;
|
|
6800
|
+
const glowBright = `brightness(var(--beam-glow-brightness, ${b})) saturate(var(--beam-glow-saturate, ${s}))`;
|
|
6801
|
+
const coreAnim = staticColors ? `filter: blur(var(--beam-core-blur, ${glowBlur}px)) ${glowBright};` : `filter: blur(var(--beam-core-blur, ${glowBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
|
|
6802
|
+
const bloomAnim = staticColors ? `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) ${glowBright};` : `filter: blur(var(--beam-bloom-blur, ${bloomBlur}px)) hue-rotate(calc(var(--beam-hue-base, 0deg) + var(--beam-hue-${id}))) ${glowBright};`;
|
|
6803
|
+
const strokeGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
6804
|
+
const coreGradients = pulseTableGradients(PULSE_OUTER_CORE, colorVariant, id);
|
|
6805
|
+
const bloomGradients = pulseTableGradientsStatic(PULSE_OUTER_BLOOM, colorVariant, 1 - op * 0.5);
|
|
6806
|
+
const strokeBackground = hairlineOpacity > 0 ? `${strokeGradients},
|
|
6807
|
+
${hairlineLine}` : strokeGradients;
|
|
6808
|
+
return `
|
|
6809
|
+
${pulsePropertyRegs(id)}
|
|
6810
|
+
|
|
6811
|
+
[data-beam="${id}"] {
|
|
6812
|
+
position: relative;
|
|
6813
|
+
border-radius: ${borderRadius}px;
|
|
6814
|
+
overflow: visible;
|
|
6815
|
+
isolation: isolate;
|
|
6816
|
+
}
|
|
6817
|
+
|
|
6818
|
+
[data-beam="${id}"][data-active] {
|
|
6819
|
+
${pulseWrapperAnimation(id, "beam-fade-in", 0.6)}
|
|
6820
|
+
}
|
|
6821
|
+
|
|
6822
|
+
[data-beam="${id}"][data-fading] {
|
|
6823
|
+
${pulseWrapperAnimation(id, "beam-fade-out", 0.5)}
|
|
6824
|
+
}
|
|
6825
|
+
${hairlineOpacity > 0 ? `
|
|
6826
|
+
/* Idle hairline \u2014 painted above the (opaque) child in the inner 1px edge ring so
|
|
6827
|
+
it overlaps a standard inset component border exactly. */
|
|
6828
|
+
[data-beam="${id}"]::after {
|
|
6829
|
+
content: "";
|
|
6830
|
+
position: absolute;
|
|
6831
|
+
inset: 0;
|
|
6832
|
+
border-radius: ${borderRadius}px;
|
|
6833
|
+
padding: 1px;
|
|
6834
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6835
|
+
background: ${hairlineLine};
|
|
6836
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6837
|
+
-webkit-mask-composite: xor;
|
|
6838
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6839
|
+
mask-composite: exclude;
|
|
6840
|
+
pointer-events: none;
|
|
6841
|
+
z-index: 2;
|
|
6842
|
+
}
|
|
6843
|
+
` : ""}
|
|
6844
|
+
[data-beam="${id}"][data-active]::after,
|
|
6845
|
+
[data-beam="${id}"][data-fading]::after {
|
|
6846
|
+
content: "";
|
|
6847
|
+
position: absolute;
|
|
6848
|
+
inset: 0;
|
|
6849
|
+
border-radius: ${borderRadius}px;
|
|
6850
|
+
padding: 1px;
|
|
6851
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
6852
|
+
background: ${strokeBackground};
|
|
6853
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6854
|
+
-webkit-mask-composite: xor;
|
|
6855
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
6856
|
+
mask-composite: exclude;
|
|
6857
|
+
pointer-events: none;
|
|
6858
|
+
z-index: 2;
|
|
6859
|
+
will-change: opacity, filter;
|
|
6860
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sStroke} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
6861
|
+
${strokeAnim}
|
|
6862
|
+
}
|
|
6863
|
+
|
|
6864
|
+
[data-beam="${id}"][data-active]::before,
|
|
6865
|
+
[data-beam="${id}"][data-fading]::before {
|
|
6866
|
+
content: "";
|
|
6867
|
+
position: absolute;
|
|
6868
|
+
inset: -10px;
|
|
6869
|
+
z-index: -1;
|
|
6870
|
+
border-radius: ${borderRadius + 10}px;
|
|
6871
|
+
background: ${coreGradients};
|
|
6872
|
+
transform: scale(${sw}, ${sh});
|
|
6873
|
+
pointer-events: none;
|
|
6874
|
+
will-change: opacity, filter;
|
|
6875
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sInner} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
6876
|
+
${coreAnim}
|
|
6877
|
+
}
|
|
6878
|
+
|
|
6879
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
6880
|
+
display: none;
|
|
6881
|
+
position: absolute;
|
|
6882
|
+
inset: -30px;
|
|
6883
|
+
z-index: -1;
|
|
6884
|
+
border-radius: ${borderRadius + 30}px;
|
|
6885
|
+
background: ${bloomGradients};
|
|
6886
|
+
transform: scale(${sw}, ${sh});
|
|
6887
|
+
pointer-events: none;
|
|
6888
|
+
will-change: transform;
|
|
6889
|
+
opacity: 0;
|
|
6890
|
+
}
|
|
6891
|
+
|
|
6892
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6893
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6894
|
+
display: block;
|
|
6895
|
+
opacity: calc(var(--beam-opacity-${id}) * ${sBloom} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
6896
|
+
${bloomAnim}
|
|
6897
|
+
}
|
|
6898
|
+
|
|
6899
|
+
@keyframes beam-fade-in-${id} { to { --beam-opacity-${id}: 1; } }
|
|
6900
|
+
@keyframes beam-fade-out-${id} { from { --beam-opacity-${id}: 1; } to { --beam-opacity-${id}: 0; } }
|
|
6901
|
+
${pausedAnimationsRule(id)}
|
|
6902
|
+
|
|
6903
|
+
@media (prefers-reduced-motion: reduce) {
|
|
6904
|
+
[data-beam="${id}"][data-active],
|
|
6905
|
+
[data-beam="${id}"][data-fading],
|
|
6906
|
+
[data-beam="${id}"][data-active]::after,
|
|
6907
|
+
[data-beam="${id}"][data-fading]::after,
|
|
6908
|
+
[data-beam="${id}"][data-active]::before,
|
|
6909
|
+
[data-beam="${id}"][data-fading]::before,
|
|
6910
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
6911
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
6912
|
+
animation: none !important;
|
|
6913
|
+
}
|
|
6914
|
+
}
|
|
6915
|
+
`;
|
|
6916
|
+
}
|
|
6917
|
+
function generateLineVariantCSS(options) {
|
|
6918
|
+
const {
|
|
6919
|
+
id,
|
|
6920
|
+
borderRadius,
|
|
6921
|
+
borderWidth,
|
|
6922
|
+
duration,
|
|
6923
|
+
strokeOpacity,
|
|
6924
|
+
innerOpacity,
|
|
6925
|
+
bloomOpacity,
|
|
6926
|
+
innerShadow,
|
|
6927
|
+
colorVariant,
|
|
6928
|
+
staticColors,
|
|
6929
|
+
brightness,
|
|
6930
|
+
saturation,
|
|
6931
|
+
hueRange,
|
|
6932
|
+
theme
|
|
6933
|
+
} = options;
|
|
6934
|
+
const innerRadius = Math.max(0, borderRadius - borderWidth);
|
|
6935
|
+
const isDark = theme === "dark";
|
|
6936
|
+
const finalStrokeOpacity = strokeOpacity;
|
|
6937
|
+
const finalInnerOpacity = innerOpacity;
|
|
6938
|
+
const finalBloomOpacity = bloomOpacity;
|
|
6939
|
+
const hueShiftAnimation = staticColors ? "" : `animation: beam-hue-shift-${id} 12s ease-in-out infinite;`;
|
|
6940
|
+
const hueShiftBloomAnimation = staticColors ? "" : `animation: beam-hue-shift-bloom-${id} 8s ease-in-out infinite;`;
|
|
6941
|
+
const hueShiftKeyframes = staticColors ? "" : `
|
|
6942
|
+
@keyframes beam-hue-shift-${id} {
|
|
6943
|
+
0% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6944
|
+
50% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6945
|
+
100% { filter: hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6946
|
+
}
|
|
6947
|
+
|
|
6948
|
+
@keyframes beam-hue-shift-bloom-${id} {
|
|
6949
|
+
0% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6950
|
+
50% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) + ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6951
|
+
100% { filter: blur(8px) hue-rotate(calc(var(--beam-hue-base, 0deg) - ${hueRange + 10}deg)) brightness(${brightness.toFixed(2)}) saturate(${saturation.toFixed(2)}); }
|
|
6952
|
+
}`;
|
|
6953
|
+
const whiteHighlight = isDark ? `radial-gradient(
|
|
6954
|
+
ellipse calc(24px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
6955
|
+
rgba(255, 255, 255, 0.38) 0%,
|
|
6956
|
+
rgba(255, 255, 255, 0.12) 30%,
|
|
6957
|
+
transparent 65%
|
|
6958
|
+
)` : `radial-gradient(
|
|
6959
|
+
ellipse calc(35px * var(--beam-w-${id})) calc(28px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) calc(100% + 2px),
|
|
6960
|
+
rgba(0, 0, 0, 0.6) 0%,
|
|
6961
|
+
rgba(0, 0, 0, 0.25) 35%,
|
|
6962
|
+
transparent 70%
|
|
6963
|
+
)`;
|
|
6964
|
+
const colorGradients = getLineColorGradients(colorVariant, isDark, id);
|
|
6965
|
+
const innerGradients = getLineInnerGradients(colorVariant, id);
|
|
6966
|
+
const bloomGradients = getLineBloomGradients(colorVariant, isDark, id);
|
|
6967
|
+
const monoBloomBlur = colorVariant === "mono" ? "filter: blur(6px);" : "";
|
|
6968
|
+
return `
|
|
6969
|
+
@property --beam-x-${id} {
|
|
6970
|
+
syntax: "<number>";
|
|
6971
|
+
initial-value: 0;
|
|
6972
|
+
inherits: true;
|
|
6973
|
+
}
|
|
6974
|
+
|
|
6975
|
+
@property --beam-w-${id} {
|
|
6976
|
+
syntax: "<number>";
|
|
6977
|
+
initial-value: 1;
|
|
6978
|
+
inherits: true;
|
|
6979
|
+
}
|
|
6980
|
+
|
|
6981
|
+
@property --beam-h-${id} {
|
|
6982
|
+
syntax: "<number>";
|
|
6983
|
+
initial-value: 1;
|
|
6984
|
+
inherits: true;
|
|
6985
|
+
}
|
|
6986
|
+
|
|
6987
|
+
@property --beam-spike-${id} {
|
|
6988
|
+
syntax: "<number>";
|
|
6989
|
+
initial-value: 1;
|
|
6990
|
+
inherits: true;
|
|
6991
|
+
}
|
|
6992
|
+
|
|
6993
|
+
@property --beam-spike2-${id} {
|
|
6994
|
+
syntax: "<number>";
|
|
6995
|
+
initial-value: 1;
|
|
6996
|
+
inherits: true;
|
|
6997
|
+
}
|
|
6998
|
+
|
|
6999
|
+
@property --beam-edge-${id} {
|
|
7000
|
+
syntax: "<number>";
|
|
7001
|
+
initial-value: 1;
|
|
7002
|
+
inherits: true;
|
|
7003
|
+
}
|
|
7004
|
+
|
|
7005
|
+
@property --beam-opacity-${id} {
|
|
7006
|
+
syntax: "<number>";
|
|
7007
|
+
initial-value: 0;
|
|
7008
|
+
inherits: true;
|
|
7009
|
+
}
|
|
7010
|
+
|
|
7011
|
+
[data-beam="${id}"] {
|
|
7012
|
+
position: relative;
|
|
7013
|
+
border-radius: ${borderRadius}px;
|
|
7014
|
+
overflow: hidden;
|
|
7015
|
+
}
|
|
7016
|
+
|
|
7017
|
+
[data-beam="${id}"][data-active] {
|
|
7018
|
+
animation:
|
|
7019
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
7020
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
7021
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
7022
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
7023
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
7024
|
+
beam-fade-in-${id} 0.6s ease forwards;
|
|
7025
|
+
}
|
|
7026
|
+
|
|
7027
|
+
[data-beam="${id}"][data-fading] {
|
|
7028
|
+
animation:
|
|
7029
|
+
beam-travel-${id} ${duration}s linear infinite,
|
|
7030
|
+
beam-edge-fade-${id} ${duration}s linear infinite,
|
|
7031
|
+
beam-breathe-${id} ${(duration * 1.3).toFixed(1)}s ease-in-out infinite,
|
|
7032
|
+
beam-spike-${id} ${(duration * 1.33).toFixed(1)}s ease-in-out infinite,
|
|
7033
|
+
beam-spike2-${id} ${(duration * 1.7).toFixed(1)}s ease-in-out infinite,
|
|
7034
|
+
beam-fade-out-${id} 0.5s ease forwards;
|
|
7035
|
+
}
|
|
7036
|
+
|
|
7037
|
+
[data-beam="${id}"][data-active]::after,
|
|
7038
|
+
[data-beam="${id}"][data-fading]::after {
|
|
7039
|
+
content: "";
|
|
7040
|
+
position: absolute;
|
|
7041
|
+
inset: 0;
|
|
7042
|
+
border-radius: ${innerRadius}px;
|
|
7043
|
+
padding: ${borderWidth}px;
|
|
7044
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
7045
|
+
background: ${whiteHighlight}, ${colorGradients};
|
|
7046
|
+
-webkit-mask:
|
|
7047
|
+
radial-gradient(
|
|
7048
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7049
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
7050
|
+
),
|
|
7051
|
+
linear-gradient(#fff 0 0) content-box,
|
|
7052
|
+
linear-gradient(#fff 0 0);
|
|
7053
|
+
-webkit-mask-composite: source-in, xor;
|
|
7054
|
+
mask:
|
|
7055
|
+
radial-gradient(
|
|
7056
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7057
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
7058
|
+
),
|
|
7059
|
+
linear-gradient(#fff 0 0) content-box,
|
|
7060
|
+
linear-gradient(#fff 0 0);
|
|
7061
|
+
mask-composite: intersect, exclude;
|
|
7062
|
+
pointer-events: none;
|
|
7063
|
+
z-index: 2;
|
|
7064
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalStrokeOpacity.toFixed(2)} * var(--beam-stroke-opacity, 1) * var(--beam-strength, 1));
|
|
7065
|
+
${hueShiftAnimation}
|
|
7066
|
+
}
|
|
7067
|
+
|
|
7068
|
+
[data-beam="${id}"][data-active]::before,
|
|
7069
|
+
[data-beam="${id}"][data-fading]::before {
|
|
7070
|
+
content: "";
|
|
7071
|
+
position: absolute;
|
|
7072
|
+
inset: 0;
|
|
7073
|
+
border-radius: ${borderRadius}px;
|
|
7074
|
+
background: ${innerGradients};
|
|
7075
|
+
box-shadow: inset 0 0 9px 1px ${innerShadow};
|
|
7076
|
+
-webkit-mask-image:
|
|
7077
|
+
radial-gradient(
|
|
7078
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7079
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
7080
|
+
),
|
|
7081
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
7082
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
7083
|
+
-webkit-mask-composite: source-in, source-over;
|
|
7084
|
+
mask-image:
|
|
7085
|
+
radial-gradient(
|
|
7086
|
+
ellipse calc(78px * var(--beam-w-${id})) calc(60px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7087
|
+
white 0%, rgba(255, 255, 255, 0.5) 45%, transparent 100%
|
|
7088
|
+
),
|
|
7089
|
+
linear-gradient(white, transparent 28px, transparent calc(100% - 28px), white),
|
|
7090
|
+
linear-gradient(to right, white, transparent 28px, transparent calc(100% - 28px), white);
|
|
7091
|
+
mask-composite: intersect, add;
|
|
7092
|
+
pointer-events: none;
|
|
7093
|
+
z-index: 1;
|
|
7094
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalInnerOpacity.toFixed(2)} * var(--beam-inner-opacity, 1) * var(--beam-strength, 1));
|
|
7095
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
7096
|
+
${hueShiftAnimation}
|
|
7097
|
+
}
|
|
7098
|
+
|
|
7099
|
+
[data-beam="${id}"] [data-beam-bloom] {
|
|
7100
|
+
display: none;
|
|
7101
|
+
position: absolute;
|
|
7102
|
+
inset: 0;
|
|
7103
|
+
border-radius: ${innerRadius}px;
|
|
7104
|
+
clip-path: inset(0 round ${borderRadius}px);
|
|
7105
|
+
padding: 0;
|
|
7106
|
+
-webkit-mask: radial-gradient(
|
|
7107
|
+
ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7108
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
7109
|
+
);
|
|
7110
|
+
-webkit-mask-composite: source-over;
|
|
7111
|
+
mask: radial-gradient(
|
|
7112
|
+
ellipse calc(84px * var(--beam-w-${id})) calc(110px * var(--beam-h-${id})) at calc(var(--beam-x-${id}) * 100%) 100%,
|
|
7113
|
+
white 0%, rgba(255, 255, 255, 0.5) 35%, transparent 100%
|
|
7114
|
+
);
|
|
7115
|
+
mask-composite: add;
|
|
7116
|
+
background: ${bloomGradients};
|
|
7117
|
+
${monoBloomBlur}
|
|
7118
|
+
pointer-events: none;
|
|
7119
|
+
z-index: 3;
|
|
7120
|
+
opacity: 0;
|
|
7121
|
+
}
|
|
7122
|
+
|
|
7123
|
+
[data-beam="${id}"][data-active] [data-beam-bloom],
|
|
7124
|
+
[data-beam="${id}"][data-fading] [data-beam-bloom] {
|
|
7125
|
+
display: block;
|
|
7126
|
+
opacity: calc(var(--beam-opacity-${id}) * var(--beam-edge-${id}) * ${finalBloomOpacity.toFixed(2)} * var(--beam-bloom-opacity, 1) * var(--beam-strength, 1));
|
|
7127
|
+
${hueShiftBloomAnimation}
|
|
7128
|
+
}
|
|
7129
|
+
|
|
7130
|
+
@keyframes beam-travel-${id} {
|
|
7131
|
+
0% { --beam-x-${id}: 0.06; --beam-w-${id}: 0.5; }
|
|
7132
|
+
10% { --beam-x-${id}: 0.15; --beam-w-${id}: 0.8; }
|
|
7133
|
+
20% { --beam-x-${id}: 0.25; --beam-w-${id}: 1.1; }
|
|
7134
|
+
30% { --beam-x-${id}: 0.35; --beam-w-${id}: 1.3; }
|
|
7135
|
+
40% { --beam-x-${id}: 0.44; --beam-w-${id}: 1.45; }
|
|
7136
|
+
50% { --beam-x-${id}: 0.5; --beam-w-${id}: 1.5; }
|
|
7137
|
+
60% { --beam-x-${id}: 0.56; --beam-w-${id}: 1.45; }
|
|
7138
|
+
70% { --beam-x-${id}: 0.65; --beam-w-${id}: 1.3; }
|
|
7139
|
+
80% { --beam-x-${id}: 0.75; --beam-w-${id}: 1.1; }
|
|
7140
|
+
90% { --beam-x-${id}: 0.85; --beam-w-${id}: 0.8; }
|
|
7141
|
+
100% { --beam-x-${id}: 0.94; --beam-w-${id}: 0.5; }
|
|
7142
|
+
}
|
|
7143
|
+
|
|
7144
|
+
@keyframes beam-edge-fade-${id} {
|
|
7145
|
+
0% { --beam-edge-${id}: 0; }
|
|
7146
|
+
12.5% { --beam-edge-${id}: 0; }
|
|
7147
|
+
32.5% { --beam-edge-${id}: 1; }
|
|
7148
|
+
67.5% { --beam-edge-${id}: 1; }
|
|
7149
|
+
87.5% { --beam-edge-${id}: 0; }
|
|
7150
|
+
100% { --beam-edge-${id}: 0; }
|
|
7151
|
+
}
|
|
7152
|
+
|
|
7153
|
+
@keyframes beam-breathe-${id} {
|
|
7154
|
+
0%, 100% { --beam-h-${id}: 0.8; }
|
|
7155
|
+
25% { --beam-h-${id}: 1.25; }
|
|
7156
|
+
55% { --beam-h-${id}: 0.85; }
|
|
7157
|
+
80% { --beam-h-${id}: 1.3; }
|
|
7158
|
+
}
|
|
7159
|
+
|
|
7160
|
+
@keyframes beam-spike-${id} {
|
|
7161
|
+
0% { --beam-spike-${id}: 0.8; }
|
|
7162
|
+
25% { --beam-spike-${id}: 1.3; }
|
|
7163
|
+
50% { --beam-spike-${id}: 0.9; }
|
|
7164
|
+
75% { --beam-spike-${id}: 1.4; }
|
|
7165
|
+
100% { --beam-spike-${id}: 0.8; }
|
|
7166
|
+
}
|
|
7167
|
+
|
|
7168
|
+
@keyframes beam-spike2-${id} {
|
|
7169
|
+
0% { --beam-spike2-${id}: 1.2; }
|
|
7170
|
+
25% { --beam-spike2-${id}: 0.7; }
|
|
7171
|
+
50% { --beam-spike2-${id}: 1.4; }
|
|
7172
|
+
75% { --beam-spike2-${id}: 0.8; }
|
|
7173
|
+
100% { --beam-spike2-${id}: 1.2; }
|
|
7174
|
+
}
|
|
7175
|
+
|
|
7176
|
+
@keyframes beam-fade-in-${id} {
|
|
7177
|
+
to { --beam-opacity-${id}: 1; }
|
|
7178
|
+
}
|
|
7179
|
+
|
|
7180
|
+
@keyframes beam-fade-out-${id} {
|
|
7181
|
+
from { --beam-opacity-${id}: 1; }
|
|
7182
|
+
to { --beam-opacity-${id}: 0; }
|
|
7183
|
+
}
|
|
7184
|
+
${hueShiftKeyframes}
|
|
7185
|
+
${pausedAnimationsRule(id)}
|
|
7186
|
+
`;
|
|
7187
|
+
}
|
|
7188
|
+
|
|
7189
|
+
// src/components/ui/border-beam/pulseDriver.ts
|
|
7190
|
+
var instances = /* @__PURE__ */ new Set();
|
|
7191
|
+
var rafId = null;
|
|
7192
|
+
var lastFrame = 0;
|
|
7193
|
+
var FRAME_INTERVAL = 1e3 / 30 - 2;
|
|
7194
|
+
var TWO_PI = Math.PI * 2;
|
|
7195
|
+
function pingPong(phase) {
|
|
7196
|
+
return (1 - Math.cos(TWO_PI * phase)) / 2;
|
|
7197
|
+
}
|
|
7198
|
+
function frame(ts) {
|
|
7199
|
+
rafId = requestAnimationFrame(frame);
|
|
7200
|
+
if (ts - lastFrame < FRAME_INTERVAL) return;
|
|
7201
|
+
lastFrame = ts;
|
|
7202
|
+
const tSec = ts / 1e3;
|
|
7203
|
+
instances.forEach(({ el, config }) => {
|
|
7204
|
+
for (const osc of config.oscillators) {
|
|
7205
|
+
const phase = (tSec - osc.delay) / osc.period;
|
|
7206
|
+
const value = osc.a + (osc.b - osc.a) * pingPong(phase);
|
|
7207
|
+
el.style.setProperty(
|
|
7208
|
+
osc.prop,
|
|
7209
|
+
osc.unit === "px" ? `${value.toFixed(2)}px` : value.toFixed(4)
|
|
7210
|
+
);
|
|
7211
|
+
}
|
|
7212
|
+
if (config.hue) {
|
|
7213
|
+
const { prop, range, period, continuous } = config.hue;
|
|
7214
|
+
const value = continuous ? tSec / period % 1 * range : -range + 2 * range * pingPong(tSec / period);
|
|
7215
|
+
el.style.setProperty(prop, `${value.toFixed(2)}deg`);
|
|
7216
|
+
}
|
|
7217
|
+
});
|
|
7218
|
+
}
|
|
7219
|
+
function startLoop() {
|
|
7220
|
+
if (rafId == null) {
|
|
7221
|
+
lastFrame = 0;
|
|
7222
|
+
rafId = requestAnimationFrame(frame);
|
|
7223
|
+
}
|
|
7224
|
+
}
|
|
7225
|
+
function stopLoopIfIdle() {
|
|
7226
|
+
if (instances.size === 0 && rafId != null) {
|
|
7227
|
+
cancelAnimationFrame(rafId);
|
|
7228
|
+
rafId = null;
|
|
7229
|
+
}
|
|
7230
|
+
}
|
|
7231
|
+
function registerPulseInstance(el, config) {
|
|
7232
|
+
const instance = { el, config };
|
|
7233
|
+
instances.add(instance);
|
|
7234
|
+
startLoop();
|
|
7235
|
+
return () => {
|
|
7236
|
+
instances.delete(instance);
|
|
7237
|
+
stopLoopIfIdle();
|
|
7238
|
+
};
|
|
7239
|
+
}
|
|
7240
|
+
function documentTheme() {
|
|
7241
|
+
if (typeof document === "undefined") return null;
|
|
7242
|
+
const root = document.documentElement;
|
|
7243
|
+
const attr = root.getAttribute("data-theme");
|
|
7244
|
+
if (attr === "dark" || attr === "light") return attr;
|
|
7245
|
+
if (root.classList.contains("dark")) return "dark";
|
|
7246
|
+
if (root.classList.contains("light")) return "light";
|
|
7247
|
+
return null;
|
|
7248
|
+
}
|
|
7249
|
+
function useSystemTheme(enabled) {
|
|
7250
|
+
const [theme, setTheme] = useState(() => {
|
|
7251
|
+
const fromDocument = documentTheme();
|
|
7252
|
+
if (fromDocument) return fromDocument;
|
|
7253
|
+
if (typeof window === "undefined") return "dark";
|
|
7254
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
7255
|
+
});
|
|
7256
|
+
useEffect(() => {
|
|
7257
|
+
if (!enabled || typeof window === "undefined") return;
|
|
7258
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
7259
|
+
const resolve = () => {
|
|
7260
|
+
setTheme(documentTheme() ?? (mediaQuery.matches ? "dark" : "light"));
|
|
7261
|
+
};
|
|
7262
|
+
resolve();
|
|
7263
|
+
mediaQuery.addEventListener("change", resolve);
|
|
7264
|
+
const observer = typeof MutationObserver !== "undefined" ? new MutationObserver(resolve) : null;
|
|
7265
|
+
observer?.observe(document.documentElement, {
|
|
7266
|
+
attributes: true,
|
|
7267
|
+
attributeFilter: ["class", "data-theme"]
|
|
7268
|
+
});
|
|
7269
|
+
return () => {
|
|
7270
|
+
mediaQuery.removeEventListener("change", resolve);
|
|
7271
|
+
observer?.disconnect();
|
|
7272
|
+
};
|
|
7273
|
+
}, [enabled]);
|
|
7274
|
+
return theme;
|
|
7275
|
+
}
|
|
7276
|
+
function resolveTheme(theme, systemTheme) {
|
|
7277
|
+
return theme === "auto" ? systemTheme : theme;
|
|
7278
|
+
}
|
|
7279
|
+
var BorderBeam = forwardRef(
|
|
7280
|
+
function BorderBeam2({
|
|
7281
|
+
children,
|
|
7282
|
+
size = "md",
|
|
7283
|
+
colorVariant = "colorful",
|
|
7284
|
+
theme = "dark",
|
|
7285
|
+
staticColors = false,
|
|
7286
|
+
duration,
|
|
7287
|
+
active = true,
|
|
7288
|
+
borderRadius: customBorderRadius,
|
|
7289
|
+
brightness: brightnessProp,
|
|
7290
|
+
saturation,
|
|
7291
|
+
hueRange = 30,
|
|
7292
|
+
strength = 1,
|
|
7293
|
+
className,
|
|
7294
|
+
style,
|
|
7295
|
+
onActivate,
|
|
7296
|
+
onDeactivate,
|
|
7297
|
+
onAnimationEnd: consumerOnAnimationEnd,
|
|
7298
|
+
...props
|
|
7299
|
+
}, ref) {
|
|
7300
|
+
const baseId = useId();
|
|
7301
|
+
const id = baseId.replace(/:/g, "-");
|
|
7302
|
+
const internalRef = useRef(null);
|
|
7303
|
+
const [isActive, setIsActive] = useState(active);
|
|
7304
|
+
const [isFading, setIsFading] = useState(false);
|
|
7305
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
7306
|
+
const [detectedRadius, setDetectedRadius] = useState(null);
|
|
7307
|
+
const [pulseGlowScale, setPulseGlowScale] = useState({ x: 1, y: 1 });
|
|
7308
|
+
const effectsOn = isActive || isFading;
|
|
7309
|
+
const systemTheme = useSystemTheme(effectsOn);
|
|
7310
|
+
useEffect(() => {
|
|
7311
|
+
if (!effectsOn || customBorderRadius != null) return;
|
|
7312
|
+
const el = internalRef.current;
|
|
7313
|
+
if (!el) return;
|
|
7314
|
+
const detect = () => {
|
|
7315
|
+
const child = el.firstElementChild;
|
|
7316
|
+
if (!child) return;
|
|
7317
|
+
const computed = getComputedStyle(child);
|
|
7318
|
+
const raw = parseFloat(computed.borderTopLeftRadius);
|
|
7319
|
+
if (!isNaN(raw) && raw > 0) {
|
|
7320
|
+
setDetectedRadius(raw);
|
|
7321
|
+
}
|
|
7322
|
+
};
|
|
7323
|
+
detect();
|
|
7324
|
+
const observer = new MutationObserver(detect);
|
|
7325
|
+
observer.observe(el, { childList: true, subtree: false });
|
|
7326
|
+
return () => observer.disconnect();
|
|
7327
|
+
}, [effectsOn, customBorderRadius, children]);
|
|
7328
|
+
useEffect(() => {
|
|
7329
|
+
if (active && !isActive && !isFading) {
|
|
7330
|
+
setIsActive(true);
|
|
7331
|
+
} else if (!active && isActive && !isFading) {
|
|
7332
|
+
setIsFading(true);
|
|
7333
|
+
}
|
|
7334
|
+
}, [active, isActive, isFading]);
|
|
7335
|
+
useEffect(() => {
|
|
7336
|
+
if (!effectsOn) return;
|
|
7337
|
+
const el = internalRef.current;
|
|
7338
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
7339
|
+
const observer = new IntersectionObserver(
|
|
7340
|
+
(entries) => {
|
|
7341
|
+
for (const entry of entries) setIsVisible(entry.isIntersecting);
|
|
7342
|
+
},
|
|
7343
|
+
// Start animating slightly before the element scrolls into view.
|
|
7344
|
+
{ rootMargin: "256px" }
|
|
7345
|
+
);
|
|
7346
|
+
observer.observe(el);
|
|
7347
|
+
return () => observer.disconnect();
|
|
7348
|
+
}, [effectsOn]);
|
|
7349
|
+
useEffect(() => {
|
|
7350
|
+
if (!effectsOn || size !== "pulse-outside") {
|
|
7351
|
+
setPulseGlowScale({ x: 1, y: 1 });
|
|
7352
|
+
return;
|
|
7353
|
+
}
|
|
7354
|
+
const el = internalRef.current;
|
|
7355
|
+
if (!el) return;
|
|
7356
|
+
const REF_WIDTH = 350;
|
|
7357
|
+
const REF_HEIGHT = 140;
|
|
7358
|
+
const MIN_SCALE = 0.35;
|
|
7359
|
+
const MAX_SCALE = 4;
|
|
7360
|
+
const clamp = (value) => Math.max(MIN_SCALE, Math.min(MAX_SCALE, value));
|
|
7361
|
+
const measure = () => {
|
|
7362
|
+
const child2 = el.firstElementChild;
|
|
7363
|
+
if (!child2) return;
|
|
7364
|
+
const rect = child2.getBoundingClientRect();
|
|
7365
|
+
if (!rect.width || !rect.height) return;
|
|
7366
|
+
const x = +clamp(rect.width / REF_WIDTH).toFixed(3);
|
|
7367
|
+
const y = +clamp(rect.height / REF_HEIGHT).toFixed(3);
|
|
7368
|
+
setPulseGlowScale((prev) => prev.x === x && prev.y === y ? prev : { x, y });
|
|
7369
|
+
};
|
|
7370
|
+
measure();
|
|
7371
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
7372
|
+
const child = el.firstElementChild;
|
|
7373
|
+
if (!child) return;
|
|
7374
|
+
const resizeObserver = new ResizeObserver(measure);
|
|
7375
|
+
resizeObserver.observe(child);
|
|
7376
|
+
return () => resizeObserver.disconnect();
|
|
7377
|
+
}, [effectsOn, size, children]);
|
|
7378
|
+
const handleAnimationEnd = useCallback(
|
|
7379
|
+
(e) => {
|
|
7380
|
+
const animationName = e.animationName;
|
|
7381
|
+
if (animationName.includes("fade-out")) {
|
|
7382
|
+
setIsActive(false);
|
|
7383
|
+
setIsFading(false);
|
|
7384
|
+
onDeactivate?.();
|
|
7385
|
+
} else if (animationName.includes("fade-in")) {
|
|
7386
|
+
onActivate?.();
|
|
7387
|
+
}
|
|
7388
|
+
consumerOnAnimationEnd?.(e);
|
|
7389
|
+
},
|
|
7390
|
+
[onActivate, onDeactivate, consumerOnAnimationEnd]
|
|
7391
|
+
);
|
|
7392
|
+
const resolvedTheme = resolveTheme(theme, systemTheme);
|
|
7393
|
+
const themeConfig = sizeThemePresets[size][resolvedTheme];
|
|
7394
|
+
const sizeConfig = sizePresets[size];
|
|
7395
|
+
const isPulse = size === "pulse-inner" || size === "pulse-outside";
|
|
7396
|
+
const finalBorderRadius = customBorderRadius ?? detectedRadius ?? sizeConfig.borderRadius;
|
|
7397
|
+
const finalDuration = duration ?? (size === "line" ? 3.1 : isPulse ? 2.3 : 1.96);
|
|
7398
|
+
const finalSaturation = saturation ?? themeConfig.saturation;
|
|
7399
|
+
const finalBrightness = brightnessProp ?? themeConfig.brightness ?? 1.3;
|
|
7400
|
+
const finalHueRange = size === "line" ? Math.min(hueRange, 13) : hueRange;
|
|
7401
|
+
const finalStaticColors = colorVariant === "mono" ? true : staticColors;
|
|
7402
|
+
const cssStyles = useMemo(
|
|
7403
|
+
() => !effectsOn ? "" : generateBeamCSS({
|
|
7404
|
+
id,
|
|
7405
|
+
borderRadius: finalBorderRadius,
|
|
7406
|
+
borderWidth: sizeConfig.borderWidth,
|
|
7407
|
+
duration: finalDuration,
|
|
7408
|
+
strokeOpacity: themeConfig.strokeOpacity,
|
|
7409
|
+
innerOpacity: themeConfig.innerOpacity,
|
|
7410
|
+
bloomOpacity: themeConfig.bloomOpacity,
|
|
7411
|
+
innerShadow: themeConfig.innerShadow,
|
|
7412
|
+
size,
|
|
7413
|
+
colorVariant,
|
|
7414
|
+
staticColors: finalStaticColors,
|
|
7415
|
+
brightness: finalBrightness,
|
|
7416
|
+
saturation: finalSaturation,
|
|
7417
|
+
hueRange: finalHueRange,
|
|
7418
|
+
theme: resolvedTheme,
|
|
7419
|
+
hairlineOpacity: themeConfig.hairlineOpacity
|
|
7420
|
+
}),
|
|
7421
|
+
[
|
|
7422
|
+
effectsOn,
|
|
7423
|
+
id,
|
|
7424
|
+
finalBorderRadius,
|
|
7425
|
+
sizeConfig.borderWidth,
|
|
7426
|
+
finalDuration,
|
|
7427
|
+
themeConfig.strokeOpacity,
|
|
7428
|
+
themeConfig.innerOpacity,
|
|
7429
|
+
themeConfig.bloomOpacity,
|
|
7430
|
+
themeConfig.innerShadow,
|
|
7431
|
+
themeConfig.hairlineOpacity,
|
|
7432
|
+
size,
|
|
7433
|
+
colorVariant,
|
|
7434
|
+
finalStaticColors,
|
|
7435
|
+
finalBrightness,
|
|
7436
|
+
finalSaturation,
|
|
7437
|
+
finalHueRange,
|
|
7438
|
+
resolvedTheme
|
|
7439
|
+
]
|
|
7440
|
+
);
|
|
7441
|
+
const driverConfig = useMemo(
|
|
7442
|
+
() => isPulse ? getPulseDriverConfig(size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id) : null,
|
|
7443
|
+
[isPulse, size, resolvedTheme, finalDuration, finalHueRange, finalStaticColors, id]
|
|
7444
|
+
);
|
|
7445
|
+
useEffect(() => {
|
|
7446
|
+
if (!driverConfig) return;
|
|
7447
|
+
if (!(isActive || isFading) || !isVisible) return;
|
|
7448
|
+
const el = internalRef.current;
|
|
7449
|
+
if (!el) return;
|
|
7450
|
+
if (typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
7451
|
+
return;
|
|
7452
|
+
}
|
|
7453
|
+
return registerPulseInstance(el, driverConfig);
|
|
7454
|
+
}, [driverConfig, isActive, isFading, isVisible]);
|
|
7455
|
+
const setRefs = useCallback(
|
|
7456
|
+
(node) => {
|
|
7457
|
+
internalRef.current = node;
|
|
7458
|
+
if (typeof ref === "function") {
|
|
7459
|
+
ref(node);
|
|
7460
|
+
} else if (ref) {
|
|
7461
|
+
ref.current = node;
|
|
7462
|
+
}
|
|
7463
|
+
},
|
|
7464
|
+
[ref]
|
|
7465
|
+
);
|
|
7466
|
+
const mergedStyle = {
|
|
7467
|
+
...style ?? {},
|
|
7468
|
+
"--beam-strength": Math.max(0, Math.min(1, strength)),
|
|
7469
|
+
...size === "pulse-outside" ? { "--pulse-glow-sx": pulseGlowScale.x, "--pulse-glow-sy": pulseGlowScale.y } : {}
|
|
7470
|
+
};
|
|
7471
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7472
|
+
effectsOn && /* @__PURE__ */ jsx("style", { children: cssStyles }),
|
|
7473
|
+
/* @__PURE__ */ jsxs(
|
|
7474
|
+
"div",
|
|
7475
|
+
{
|
|
7476
|
+
...props,
|
|
7477
|
+
ref: setRefs,
|
|
7478
|
+
"data-beam": id,
|
|
7479
|
+
"data-active": isActive && !isFading ? "" : void 0,
|
|
7480
|
+
"data-fading": isFading ? "" : void 0,
|
|
7481
|
+
"data-paused": isActive && !isFading && !isVisible ? "" : void 0,
|
|
7482
|
+
className,
|
|
7483
|
+
style: mergedStyle,
|
|
7484
|
+
onAnimationEnd: handleAnimationEnd,
|
|
7485
|
+
children: [
|
|
7486
|
+
children,
|
|
7487
|
+
/* @__PURE__ */ jsx("div", { "data-beam-bloom": true })
|
|
7488
|
+
]
|
|
7489
|
+
}
|
|
7490
|
+
)
|
|
7491
|
+
] });
|
|
7492
|
+
}
|
|
7493
|
+
);
|
|
7494
|
+
var ROTATE_SIZES = /* @__PURE__ */ new Set(["sm", "md", "line"]);
|
|
7495
|
+
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
7496
|
+
function subscribeReducedMotion(onChange) {
|
|
7497
|
+
if (typeof window === "undefined" || !window.matchMedia) return () => {
|
|
7498
|
+
};
|
|
7499
|
+
const mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);
|
|
7500
|
+
mediaQuery.addEventListener("change", onChange);
|
|
7501
|
+
return () => mediaQuery.removeEventListener("change", onChange);
|
|
7502
|
+
}
|
|
7503
|
+
function readReducedMotion() {
|
|
7504
|
+
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
7505
|
+
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
7506
|
+
}
|
|
7507
|
+
function readReducedMotionServer() {
|
|
7508
|
+
return false;
|
|
7509
|
+
}
|
|
7510
|
+
function BrandBeam({
|
|
7511
|
+
children,
|
|
7512
|
+
size = "md",
|
|
7513
|
+
active = true,
|
|
7514
|
+
strength,
|
|
7515
|
+
borderRadius,
|
|
7516
|
+
className
|
|
7517
|
+
}) {
|
|
7518
|
+
const reducedMotion = useSyncExternalStore(
|
|
7519
|
+
subscribeReducedMotion,
|
|
7520
|
+
readReducedMotion,
|
|
7521
|
+
readReducedMotionServer
|
|
7522
|
+
);
|
|
7523
|
+
const effectiveActive = active && !(reducedMotion && ROTATE_SIZES.has(size));
|
|
7524
|
+
return /* @__PURE__ */ jsx(
|
|
7525
|
+
BorderBeam,
|
|
7526
|
+
{
|
|
7527
|
+
size,
|
|
7528
|
+
colorVariant: "brand",
|
|
7529
|
+
theme: "auto",
|
|
7530
|
+
active: effectiveActive,
|
|
7531
|
+
strength,
|
|
7532
|
+
borderRadius,
|
|
7533
|
+
className,
|
|
7534
|
+
children
|
|
7535
|
+
}
|
|
7536
|
+
);
|
|
7537
|
+
}
|
|
5063
7538
|
var convertBlobUrlToDataUrl = async (url) => {
|
|
5064
7539
|
try {
|
|
5065
7540
|
const response = await fetch(url);
|
|
@@ -5218,6 +7693,7 @@ var PromptInput = ({
|
|
|
5218
7693
|
maxFileSize,
|
|
5219
7694
|
onError,
|
|
5220
7695
|
onSubmit,
|
|
7696
|
+
beamActive = false,
|
|
5221
7697
|
children,
|
|
5222
7698
|
...props
|
|
5223
7699
|
}) => {
|
|
@@ -5532,7 +8008,7 @@ var PromptInput = ({
|
|
|
5532
8008
|
onSubmit: handleSubmit,
|
|
5533
8009
|
ref: formRef,
|
|
5534
8010
|
...props,
|
|
5535
|
-
children: /* @__PURE__ */ jsx(InputGroup, { className: "overflow-hidden rounded-3xl border border-input bg-white px-4 py-2 shadow-sm dark:bg-card dark:shadow-none dark:ring-1 dark:ring-white/5 has-[textarea]:rounded-3xl has-[>[data-align=block-end]]:rounded-3xl has-[>[data-align=block-start]]:rounded-3xl", children })
|
|
8011
|
+
children: /* @__PURE__ */ jsx(BrandBeam, { size: "line", active: beamActive, strength: 0.7, borderRadius: 24, children: /* @__PURE__ */ jsx(InputGroup, { className: "overflow-hidden rounded-3xl border border-input bg-white px-4 py-2 shadow-sm dark:bg-card dark:shadow-none dark:ring-1 dark:ring-white/5 has-[textarea]:rounded-3xl has-[>[data-align=block-end]]:rounded-3xl has-[>[data-align=block-start]]:rounded-3xl", children }) })
|
|
5536
8012
|
}
|
|
5537
8013
|
)
|
|
5538
8014
|
] });
|
|
@@ -6491,19 +8967,19 @@ function ChatComposerInner({
|
|
|
6491
8967
|
}) {
|
|
6492
8968
|
const { adapter } = useAgentChatAdapterContext();
|
|
6493
8969
|
const [profileMenuOpen, setProfileMenuOpen] = useState(false);
|
|
6494
|
-
const [browserProfiles, setBrowserProfiles] = useState(
|
|
6495
|
-
|
|
6496
|
-
if (!
|
|
6497
|
-
|
|
6498
|
-
void adapter.listBrowserProfiles().then((p) => {
|
|
6499
|
-
if (!cancelled) setBrowserProfiles(p);
|
|
6500
|
-
}).catch(() => {
|
|
6501
|
-
if (!cancelled) setBrowserProfiles([]);
|
|
8970
|
+
const [browserProfiles, setBrowserProfiles] = useState(null);
|
|
8971
|
+
const loadBrowserProfiles = useCallback(() => {
|
|
8972
|
+
if (!adapter.listBrowserProfiles) return;
|
|
8973
|
+
void adapter.listBrowserProfiles().then(setBrowserProfiles).catch(() => {
|
|
6502
8974
|
});
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
8975
|
+
}, [adapter]);
|
|
8976
|
+
useEffect(() => {
|
|
8977
|
+
if (!browserProfilesEnabled || !browserProfileId) return;
|
|
8978
|
+
if (browserProfiles !== null) return;
|
|
8979
|
+
loadBrowserProfiles();
|
|
8980
|
+
}, [browserProfilesEnabled, browserProfileId, browserProfiles, loadBrowserProfiles]);
|
|
8981
|
+
const activeBrowserProfile = (browserProfiles ?? []).find((p) => p.id === browserProfileId) ?? null;
|
|
8982
|
+
const profileTriggerLabel = activeBrowserProfile && /* @__PURE__ */ jsx("span", { className: "max-w-24 truncate text-xs", children: activeBrowserProfile.name });
|
|
6507
8983
|
const { textInput, attachments } = usePromptInputController();
|
|
6508
8984
|
const status = isRunning ? "streaming" : disabled ? "error" : "ready";
|
|
6509
8985
|
const [adapterCommands, setAdapterCommands] = useState([]);
|
|
@@ -6771,6 +9247,7 @@ function ChatComposerInner({
|
|
|
6771
9247
|
maxFiles: MAX_IMAGES_PER_MESSAGE + MAX_ATTACHMENTS_PER_MESSAGE,
|
|
6772
9248
|
maxFileSize: MAX_ATTACHMENT_BYTES,
|
|
6773
9249
|
onError: handlePromptInputError,
|
|
9250
|
+
beamActive: status === "streaming",
|
|
6774
9251
|
children: [
|
|
6775
9252
|
/* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(
|
|
6776
9253
|
PromptInputTextarea,
|
|
@@ -6848,30 +9325,40 @@ function ChatComposerInner({
|
|
|
6848
9325
|
// active the choice can't change. Render disabled (via
|
|
6849
9326
|
// aria-disabled, not the `disabled` attribute, so the
|
|
6850
9327
|
// tooltip still shows on hover) with an explanation.
|
|
6851
|
-
/* @__PURE__ */
|
|
9328
|
+
/* @__PURE__ */ jsxs(
|
|
6852
9329
|
PromptInputButton,
|
|
6853
9330
|
{
|
|
6854
9331
|
"aria-label": "Select browser profile",
|
|
6855
9332
|
"aria-disabled": true,
|
|
6856
9333
|
"aria-pressed": !!browserProfileId,
|
|
6857
|
-
tooltip: "A browser profile must be chosen before starting the session",
|
|
9334
|
+
tooltip: activeBrowserProfile ? `Browser profile: ${activeBrowserProfile.name} (locked for this session)` : "A browser profile must be chosen before starting the session",
|
|
6858
9335
|
className: `cursor-not-allowed opacity-50 ${browserProfileId ? "bg-accent text-foreground" : ""}`,
|
|
6859
|
-
children:
|
|
9336
|
+
children: [
|
|
9337
|
+
/* @__PURE__ */ jsx(IdCardIcon, { className: "size-4" }),
|
|
9338
|
+
profileTriggerLabel
|
|
9339
|
+
]
|
|
6860
9340
|
}
|
|
6861
9341
|
)
|
|
6862
9342
|
) : /* @__PURE__ */ jsxs(
|
|
6863
9343
|
Popover,
|
|
6864
9344
|
{
|
|
6865
9345
|
open: profileMenuOpen,
|
|
6866
|
-
onOpenChange:
|
|
9346
|
+
onOpenChange: (open) => {
|
|
9347
|
+
setProfileMenuOpen(open);
|
|
9348
|
+
if (open) loadBrowserProfiles();
|
|
9349
|
+
},
|
|
6867
9350
|
children: [
|
|
6868
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */
|
|
9351
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
6869
9352
|
PromptInputButton,
|
|
6870
9353
|
{
|
|
6871
9354
|
"aria-label": "Select browser profile",
|
|
6872
9355
|
"aria-pressed": !!browserProfileId,
|
|
9356
|
+
tooltip: activeBrowserProfile ? `Browser profile: ${activeBrowserProfile.name}` : "Select browser profile",
|
|
6873
9357
|
className: browserProfileId ? "bg-accent text-foreground" : void 0,
|
|
6874
|
-
children:
|
|
9358
|
+
children: [
|
|
9359
|
+
/* @__PURE__ */ jsx(IdCardIcon, { className: "size-4" }),
|
|
9360
|
+
profileTriggerLabel
|
|
9361
|
+
]
|
|
6875
9362
|
}
|
|
6876
9363
|
) }),
|
|
6877
9364
|
/* @__PURE__ */ jsx(
|
|
@@ -6880,34 +9367,22 @@ function ChatComposerInner({
|
|
|
6880
9367
|
side: "top",
|
|
6881
9368
|
align: "start",
|
|
6882
9369
|
className: "w-64 overflow-hidden rounded-xl p-1",
|
|
6883
|
-
children: /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
children: "No profile"
|
|
6893
|
-
}
|
|
6894
|
-
),
|
|
6895
|
-
browserProfiles.map((p) => /* @__PURE__ */ jsxs(
|
|
6896
|
-
CommandItem,
|
|
6897
|
-
{
|
|
6898
|
-
onSelect: () => {
|
|
6899
|
-
setProfileMenuOpen(false);
|
|
6900
|
-
onSelectBrowserProfile(p.id);
|
|
6901
|
-
},
|
|
6902
|
-
className: "gap-3 rounded-md px-3 py-2",
|
|
6903
|
-
children: [
|
|
6904
|
-
p.name,
|
|
6905
|
-
browserProfileId === p.id && /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: "Active" })
|
|
6906
|
-
]
|
|
9370
|
+
children: /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */ jsx(CommandList, { children: [
|
|
9371
|
+
{ id: null, name: "No profile" },
|
|
9372
|
+
...browserProfiles ?? []
|
|
9373
|
+
].map((p) => /* @__PURE__ */ jsx(
|
|
9374
|
+
CommandItem,
|
|
9375
|
+
{
|
|
9376
|
+
onSelect: () => {
|
|
9377
|
+
setProfileMenuOpen(false);
|
|
9378
|
+
onSelectBrowserProfile(p.id);
|
|
6907
9379
|
},
|
|
6908
|
-
p.id
|
|
6909
|
-
|
|
6910
|
-
|
|
9380
|
+
"data-checked": (browserProfileId ?? null) === p.id || void 0,
|
|
9381
|
+
className: "gap-3 rounded-md px-3 py-2",
|
|
9382
|
+
children: p.name
|
|
9383
|
+
},
|
|
9384
|
+
p.id ?? "none"
|
|
9385
|
+
)) }) })
|
|
6911
9386
|
}
|
|
6912
9387
|
)
|
|
6913
9388
|
]
|
|
@@ -7896,6 +10371,18 @@ var KIND_LABEL = {
|
|
|
7896
10371
|
video: "Generated video"
|
|
7897
10372
|
};
|
|
7898
10373
|
var COPY_FEEDBACK_MS = 1500;
|
|
10374
|
+
var ARTIFACT_PAYLOAD_CACHE_LIMIT = 64;
|
|
10375
|
+
var artifactPayloadCache = /* @__PURE__ */ new Map();
|
|
10376
|
+
function cachePayload(key, version, payload) {
|
|
10377
|
+
const existing = artifactPayloadCache.get(key);
|
|
10378
|
+
if (existing && existing.version >= version) return;
|
|
10379
|
+
artifactPayloadCache.delete(key);
|
|
10380
|
+
artifactPayloadCache.set(key, { version, payload });
|
|
10381
|
+
if (artifactPayloadCache.size > ARTIFACT_PAYLOAD_CACHE_LIMIT) {
|
|
10382
|
+
const oldest = artifactPayloadCache.keys().next().value;
|
|
10383
|
+
if (oldest !== void 0) artifactPayloadCache.delete(oldest);
|
|
10384
|
+
}
|
|
10385
|
+
}
|
|
7899
10386
|
function ArtifactBlock({
|
|
7900
10387
|
sessionId,
|
|
7901
10388
|
artifactId,
|
|
@@ -7904,15 +10391,24 @@ function ArtifactBlock({
|
|
|
7904
10391
|
version
|
|
7905
10392
|
}) {
|
|
7906
10393
|
const { adapter } = useAgentChatAdapterContext();
|
|
7907
|
-
const
|
|
10394
|
+
const cacheKey = `${sessionId}:${artifactId}`;
|
|
10395
|
+
const [payload, setPayload] = useState(
|
|
10396
|
+
() => artifactPayloadCache.get(cacheKey)?.payload ?? null
|
|
10397
|
+
);
|
|
7908
10398
|
const [error, setError] = useState(null);
|
|
7909
10399
|
const [copied, setCopied] = useState(false);
|
|
7910
10400
|
const [expanded, setExpanded] = useState(false);
|
|
7911
10401
|
useEffect(() => {
|
|
10402
|
+
const cached = artifactPayloadCache.get(cacheKey);
|
|
10403
|
+
if (cached) {
|
|
10404
|
+
setPayload(cached.payload);
|
|
10405
|
+
setError(null);
|
|
10406
|
+
if (cached.version >= version) return;
|
|
10407
|
+
}
|
|
7912
10408
|
let cancelled = false;
|
|
7913
|
-
setPayload(null);
|
|
7914
10409
|
setError(null);
|
|
7915
10410
|
adapter.getArtifact({ sessionId, artifactId }).then((p) => {
|
|
10411
|
+
cachePayload(cacheKey, version, p);
|
|
7916
10412
|
if (!cancelled) setPayload(p);
|
|
7917
10413
|
}).catch((e) => {
|
|
7918
10414
|
if (!cancelled) {
|
|
@@ -7922,7 +10418,7 @@ function ArtifactBlock({
|
|
|
7922
10418
|
return () => {
|
|
7923
10419
|
cancelled = true;
|
|
7924
10420
|
};
|
|
7925
|
-
}, [adapter, sessionId, artifactId, version]);
|
|
10421
|
+
}, [adapter, sessionId, artifactId, version, cacheKey]);
|
|
7926
10422
|
const handleCopy = async () => {
|
|
7927
10423
|
if (!payload) return;
|
|
7928
10424
|
const { text } = exportArtifact(payload);
|
|
@@ -7951,48 +10447,65 @@ function ArtifactBlock({
|
|
|
7951
10447
|
};
|
|
7952
10448
|
const description = error ?? (payload ? KIND_LABEL[kind] : "Loading\u2026");
|
|
7953
10449
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7954
|
-
/* @__PURE__ */
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
10450
|
+
/* @__PURE__ */ jsx(
|
|
10451
|
+
BrandBeam,
|
|
10452
|
+
{
|
|
10453
|
+
size: "pulse-inner",
|
|
10454
|
+
active: !payload && !error,
|
|
10455
|
+
strength: 0.6,
|
|
10456
|
+
borderRadius: 10,
|
|
10457
|
+
className: "w-full",
|
|
10458
|
+
children: /* @__PURE__ */ jsxs(
|
|
10459
|
+
Artifact,
|
|
10460
|
+
{
|
|
10461
|
+
className: "my-2 w-full overflow-visible border-border",
|
|
10462
|
+
"data-artifact-anchor": artifactId,
|
|
10463
|
+
children: [
|
|
10464
|
+
/* @__PURE__ */ jsxs(ArtifactHeader, { children: [
|
|
10465
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
10466
|
+
/* @__PURE__ */ jsx(ArtifactTitle, { className: "truncate", children: name }),
|
|
10467
|
+
/* @__PURE__ */ jsx(ArtifactDescription, { children: description })
|
|
10468
|
+
] }),
|
|
10469
|
+
/* @__PURE__ */ jsxs(ArtifactActions, { children: [
|
|
10470
|
+
/* @__PURE__ */ jsx(
|
|
10471
|
+
ArtifactAction,
|
|
10472
|
+
{
|
|
10473
|
+
tooltip: copied ? "Copied!" : "Copy",
|
|
10474
|
+
label: "Copy artifact",
|
|
10475
|
+
icon: copied ? CheckIcon : CopyIcon,
|
|
10476
|
+
disabled: !payload,
|
|
10477
|
+
onClick: handleCopy,
|
|
10478
|
+
className: copied ? "text-emerald-500 hover:text-emerald-500" : ""
|
|
10479
|
+
}
|
|
10480
|
+
),
|
|
10481
|
+
/* @__PURE__ */ jsx(
|
|
10482
|
+
ArtifactAction,
|
|
10483
|
+
{
|
|
10484
|
+
tooltip: "Download",
|
|
10485
|
+
label: "Download artifact",
|
|
10486
|
+
icon: DownloadIcon,
|
|
10487
|
+
disabled: !payload,
|
|
10488
|
+
onClick: handleDownload
|
|
10489
|
+
}
|
|
10490
|
+
),
|
|
10491
|
+
/* @__PURE__ */ jsx(
|
|
10492
|
+
ArtifactAction,
|
|
10493
|
+
{
|
|
10494
|
+
tooltip: "Full screen",
|
|
10495
|
+
label: "Open artifact in full screen",
|
|
10496
|
+
icon: Maximize2Icon,
|
|
10497
|
+
disabled: !payload,
|
|
10498
|
+
onClick: () => setExpanded(true)
|
|
10499
|
+
}
|
|
10500
|
+
)
|
|
10501
|
+
] })
|
|
10502
|
+
] }),
|
|
10503
|
+
/* @__PURE__ */ jsx(ArtifactContent, { className: "p-0 overflow-visible", children: /* @__PURE__ */ jsx(ArtifactBody, { error, payload, sessionId }) })
|
|
10504
|
+
]
|
|
10505
|
+
}
|
|
10506
|
+
)
|
|
10507
|
+
}
|
|
10508
|
+
),
|
|
7996
10509
|
/* @__PURE__ */ jsx(Dialog, { open: expanded, onOpenChange: setExpanded, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex h-[95vh] w-[95vw] max-w-[95vw] flex-col gap-4 overflow-hidden p-6 sm:max-w-[95vw]", children: [
|
|
7997
10510
|
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
7998
10511
|
/* @__PURE__ */ jsx(DialogTitle, { className: "truncate pr-10", children: name }),
|
|
@@ -8750,6 +11263,28 @@ function WorkspaceFilePreviewDialog({
|
|
|
8750
11263
|
) })
|
|
8751
11264
|
] }) });
|
|
8752
11265
|
}
|
|
11266
|
+
function scrollToArtifactBlock(artifactId) {
|
|
11267
|
+
document.querySelector(`[data-artifact-anchor="${CSS.escape(artifactId)}"]`)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
11268
|
+
}
|
|
11269
|
+
function ArtifactRefCard({
|
|
11270
|
+
artifactId,
|
|
11271
|
+
name,
|
|
11272
|
+
kind
|
|
11273
|
+
}) {
|
|
11274
|
+
return /* @__PURE__ */ jsxs(
|
|
11275
|
+
"button",
|
|
11276
|
+
{
|
|
11277
|
+
type: "button",
|
|
11278
|
+
onClick: () => scrollToArtifactBlock(artifactId),
|
|
11279
|
+
className: "flex w-full min-w-0 cursor-pointer items-center gap-2 rounded border border-border bg-background px-3 py-2 text-left text-sm transition-colors hover:bg-muted/60",
|
|
11280
|
+
children: [
|
|
11281
|
+
/* @__PURE__ */ jsx(FileTextIcon, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
|
|
11282
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", children: name }),
|
|
11283
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: KIND_LABEL[kind] })
|
|
11284
|
+
]
|
|
11285
|
+
}
|
|
11286
|
+
);
|
|
11287
|
+
}
|
|
8753
11288
|
function resolveArtifactRef(ref, messages) {
|
|
8754
11289
|
for (const msg of messages) {
|
|
8755
11290
|
if (msg.role !== "system" || msg.systemKind !== "artifact") continue;
|
|
@@ -8790,15 +11325,13 @@ function TurnSummaryCard({
|
|
|
8790
11325
|
}
|
|
8791
11326
|
if (artifact.kind === "artifact") {
|
|
8792
11327
|
const resolved = sessionId ? resolveArtifactRef(artifact.ref, messages) : null;
|
|
8793
|
-
if (resolved
|
|
11328
|
+
if (resolved) {
|
|
8794
11329
|
return /* @__PURE__ */ jsx(
|
|
8795
|
-
|
|
11330
|
+
ArtifactRefCard,
|
|
8796
11331
|
{
|
|
8797
|
-
sessionId,
|
|
8798
11332
|
artifactId: resolved.artifactId,
|
|
8799
11333
|
name: resolved.name || artifact.label,
|
|
8800
|
-
kind: resolved.kind
|
|
8801
|
-
version: resolved.version
|
|
11334
|
+
kind: resolved.kind
|
|
8802
11335
|
},
|
|
8803
11336
|
key
|
|
8804
11337
|
);
|
|
@@ -8814,8 +11347,6 @@ function TurnSummaryCard({
|
|
|
8814
11347
|
ArtifactRow,
|
|
8815
11348
|
{
|
|
8816
11349
|
artifact,
|
|
8817
|
-
sessionId,
|
|
8818
|
-
messages,
|
|
8819
11350
|
onFileSelect,
|
|
8820
11351
|
onCommandSelect
|
|
8821
11352
|
}
|
|
@@ -8829,8 +11360,6 @@ function TurnSummaryCard({
|
|
|
8829
11360
|
}
|
|
8830
11361
|
function ArtifactRow({
|
|
8831
11362
|
artifact,
|
|
8832
|
-
sessionId,
|
|
8833
|
-
messages,
|
|
8834
11363
|
onFileSelect,
|
|
8835
11364
|
onCommandSelect
|
|
8836
11365
|
}) {
|
|
@@ -8874,20 +11403,7 @@ function ArtifactRow({
|
|
|
8874
11403
|
}
|
|
8875
11404
|
);
|
|
8876
11405
|
}
|
|
8877
|
-
|
|
8878
|
-
if (!resolved) {
|
|
8879
|
-
return /* @__PURE__ */ jsx("span", { className: "truncate text-muted-foreground", children: artifact.label });
|
|
8880
|
-
}
|
|
8881
|
-
return /* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx(
|
|
8882
|
-
ArtifactBlock,
|
|
8883
|
-
{
|
|
8884
|
-
sessionId,
|
|
8885
|
-
artifactId: resolved.artifactId,
|
|
8886
|
-
name: resolved.name || artifact.label,
|
|
8887
|
-
kind: resolved.kind,
|
|
8888
|
-
version: resolved.version
|
|
8889
|
-
}
|
|
8890
|
-
) });
|
|
11406
|
+
return /* @__PURE__ */ jsx("span", { className: "truncate text-muted-foreground", children: artifact.label });
|
|
8891
11407
|
}
|
|
8892
11408
|
var WORKING_ON_IT_DELAY_MS = 250;
|
|
8893
11409
|
function hasUserFacingAskContent(msg) {
|
|
@@ -9331,9 +11847,9 @@ function TimelineEntryItem({
|
|
|
9331
11847
|
return /* @__PURE__ */ jsxs(TimelineItem, { step, children: [
|
|
9332
11848
|
/* @__PURE__ */ jsxs(TimelineHeader, { children: [
|
|
9333
11849
|
/* @__PURE__ */ jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
|
|
9334
|
-
/* @__PURE__ */ jsx(TimelineIndicator, { className: "size-2 border-none bg-primary
|
|
11850
|
+
/* @__PURE__ */ jsx(TimelineIndicator, { className: "size-2 border-none bg-primary" })
|
|
9335
11851
|
] }),
|
|
9336
|
-
/* @__PURE__ */ jsx(TimelineContent, { children: /* @__PURE__ */ jsx(
|
|
11852
|
+
/* @__PURE__ */ jsx(TimelineContent, { children: /* @__PURE__ */ jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
|
|
9337
11853
|
] });
|
|
9338
11854
|
}
|
|
9339
11855
|
function ReasoningEntry({
|
|
@@ -9541,30 +12057,9 @@ function lastPathSegment(path) {
|
|
|
9541
12057
|
function truncate3(s, max) {
|
|
9542
12058
|
return s.length > max ? `${s.slice(0, max - 1)}\u2026` : s;
|
|
9543
12059
|
}
|
|
9544
|
-
var _SIMPLE_MODE_HIDDEN_TOOLS = /* @__PURE__ */ new Set([
|
|
9545
|
-
"list_files",
|
|
9546
|
-
"search_files",
|
|
9547
|
-
"session_search",
|
|
9548
|
-
"skills_list",
|
|
9549
|
-
"skill_view",
|
|
9550
|
-
"skill_manage",
|
|
9551
|
-
"process",
|
|
9552
|
-
"memory",
|
|
9553
|
-
// Shell commands and code execution are infrastructure plumbing the
|
|
9554
|
-
// user doesn't need to see when the goal is to know *what* the
|
|
9555
|
-
// agent accomplished, not *how*. Expert mode still has the full
|
|
9556
|
-
// command + output block.
|
|
9557
|
-
"terminal",
|
|
9558
|
-
"execute_code"
|
|
9559
|
-
]);
|
|
9560
|
-
function _isHiddenSimpleTool(tc) {
|
|
9561
|
-
if (_SIMPLE_MODE_HIDDEN_TOOLS.has(tc.toolName)) return true;
|
|
9562
|
-
if (tc.toolName.startsWith("browser_")) return true;
|
|
9563
|
-
return false;
|
|
9564
|
-
}
|
|
9565
12060
|
function visibleToolCalls(message) {
|
|
9566
12061
|
return (message.toolCalls ?? []).filter((tc) => {
|
|
9567
|
-
if (
|
|
12062
|
+
if (isHiddenSimpleTool(tc)) return false;
|
|
9568
12063
|
const status = effectiveStatus(tc);
|
|
9569
12064
|
if (status === "error" || status === "cancelled") return false;
|
|
9570
12065
|
return true;
|
|
@@ -9579,7 +12074,7 @@ function isIterationLive(message) {
|
|
|
9579
12074
|
}
|
|
9580
12075
|
function liveIterationLabel(message) {
|
|
9581
12076
|
const running = (message.toolCalls ?? []).filter(
|
|
9582
|
-
(tc) => tc.status === "running" && !
|
|
12077
|
+
(tc) => tc.status === "running" && !isHiddenSimpleTool(tc)
|
|
9583
12078
|
);
|
|
9584
12079
|
if (running.length === 0) return "Thinking\u2026";
|
|
9585
12080
|
if (running.length === 1) {
|
|
@@ -9777,8 +12272,14 @@ function IterationGroup({
|
|
|
9777
12272
|
return /* @__PURE__ */ jsx("div", { className: "px-1 py-0.5", children: /* @__PURE__ */ jsx(AskUserQuestionToolBlock, { tc: askCall }) });
|
|
9778
12273
|
}
|
|
9779
12274
|
if (isIterationLive(message)) {
|
|
9780
|
-
|
|
9781
|
-
|
|
12275
|
+
return /* @__PURE__ */ jsx(
|
|
12276
|
+
OrbShimmerLabel,
|
|
12277
|
+
{
|
|
12278
|
+
state: messageOrbState(message, SIMPLE_MODE_ORB_OPTIONS),
|
|
12279
|
+
label: liveIterationLabel(message),
|
|
12280
|
+
className: "py-0.5"
|
|
12281
|
+
}
|
|
12282
|
+
);
|
|
9782
12283
|
}
|
|
9783
12284
|
const label = summary ?? deriveIterationLabel(message);
|
|
9784
12285
|
if (!label) {
|
|
@@ -10052,8 +12553,8 @@ function RetryBanner({ indicator }) {
|
|
|
10052
12553
|
}
|
|
10053
12554
|
);
|
|
10054
12555
|
}
|
|
10055
|
-
function WorkingOnItIndicator() {
|
|
10056
|
-
return /* @__PURE__ */ jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(
|
|
12556
|
+
function WorkingOnItIndicator({ activity }) {
|
|
12557
|
+
return /* @__PURE__ */ jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(OrbShimmerLabel, { state: activity.state, label: activity.label }) }) });
|
|
10057
12558
|
}
|
|
10058
12559
|
function useDelayedRunningIndicator(isRunning) {
|
|
10059
12560
|
const [visible, setVisible] = useState(isRunning);
|
|
@@ -10112,6 +12613,13 @@ function ChatThread({
|
|
|
10112
12613
|
}) {
|
|
10113
12614
|
const groups = useMemo(() => groupMessages(messages), [messages]);
|
|
10114
12615
|
const awaitingInput = useMemo(() => isAwaitingUserInput(messages), [messages]);
|
|
12616
|
+
const orbActivity = useMemo(
|
|
12617
|
+
() => deriveOrbActivity(
|
|
12618
|
+
messages,
|
|
12619
|
+
viewMode === "simple" ? SIMPLE_MODE_ORB_OPTIONS : void 0
|
|
12620
|
+
),
|
|
12621
|
+
[messages, viewMode]
|
|
12622
|
+
);
|
|
10115
12623
|
const showWorkingOnIt = useDelayedRunningIndicator(isRunning) && !awaitingInput;
|
|
10116
12624
|
const composerDisabled = disabled || awaitingInput;
|
|
10117
12625
|
const composerDisabledReason = awaitingInput ? "Answer the question above to continue." : disabledReason;
|
|
@@ -10253,7 +12761,7 @@ function ChatThread({
|
|
|
10253
12761
|
group.messages[0].id
|
|
10254
12762
|
);
|
|
10255
12763
|
}),
|
|
10256
|
-
showWorkingOnIt && /* @__PURE__ */ jsx(WorkingOnItIndicator, {})
|
|
12764
|
+
showWorkingOnIt && /* @__PURE__ */ jsx(WorkingOnItIndicator, { activity: orbActivity })
|
|
10257
12765
|
] }) }),
|
|
10258
12766
|
/* @__PURE__ */ jsx(ConversationScrollButton, {})
|
|
10259
12767
|
] }),
|
|
@@ -11874,9 +14382,9 @@ function applyCodeRunProgress(messages, data) {
|
|
|
11874
14382
|
...msg,
|
|
11875
14383
|
toolCalls: msg.toolCalls?.map((tc) => {
|
|
11876
14384
|
if (tc.id !== match.toolId) return tc;
|
|
11877
|
-
const
|
|
11878
|
-
|
|
11879
|
-
return { ...tc, result: JSON.stringify(
|
|
14385
|
+
const frame2 = parseCodeRunState(tc.result);
|
|
14386
|
+
frame2.output += chunk;
|
|
14387
|
+
return { ...tc, result: JSON.stringify(frame2) };
|
|
11880
14388
|
})
|
|
11881
14389
|
};
|
|
11882
14390
|
return next;
|
|
@@ -11896,15 +14404,15 @@ function applyCodeRunResult(messages, data) {
|
|
|
11896
14404
|
...msg,
|
|
11897
14405
|
toolCalls: msg.toolCalls?.map((tc) => {
|
|
11898
14406
|
if (tc.id !== match.toolId) return tc;
|
|
11899
|
-
const
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
14407
|
+
const frame2 = parseCodeRunState(tc.result);
|
|
14408
|
+
frame2.finalMessage = finalMessage;
|
|
14409
|
+
frame2.error = error;
|
|
14410
|
+
frame2.inputTokens = inputTokens;
|
|
14411
|
+
frame2.outputTokens = outputTokens;
|
|
11904
14412
|
return {
|
|
11905
14413
|
...tc,
|
|
11906
14414
|
status: error ? "error" : "complete",
|
|
11907
|
-
result: JSON.stringify(
|
|
14415
|
+
result: JSON.stringify(frame2)
|
|
11908
14416
|
};
|
|
11909
14417
|
})
|
|
11910
14418
|
};
|
|
@@ -12332,6 +14840,15 @@ function useAgentChatRuntime({
|
|
|
12332
14840
|
} catch {
|
|
12333
14841
|
}
|
|
12334
14842
|
if (live) reviveStreamIfNeeded(targetSessionId);
|
|
14843
|
+
if (statusKnown && !live && !appliedNew && stateRef.current.isRunning) {
|
|
14844
|
+
setState(
|
|
14845
|
+
(prev) => prev.isRunning ? applyRuntimeEvent(prev, {
|
|
14846
|
+
type: "session.done",
|
|
14847
|
+
eventId: 0,
|
|
14848
|
+
data: {}
|
|
14849
|
+
}) : prev
|
|
14850
|
+
);
|
|
14851
|
+
}
|
|
12335
14852
|
if (appliedNew) return RECONCILE_FAST;
|
|
12336
14853
|
if (live || !statusKnown) return RECONCILE_ACTIVE;
|
|
12337
14854
|
return isMission || stateRef.current.isRunning ? RECONCILE_MISSION_IDLE : RECONCILE_IDLE;
|
|
@@ -16711,6 +19228,6 @@ function SessionTreePanel({
|
|
|
16711
19228
|
] });
|
|
16712
19229
|
}
|
|
16713
19230
|
|
|
16714
|
-
export { ACTIVE_MISSION_STATUSES, AgentChat, AgentChatAdapterProvider, BrowserLiveView, CitationText, CodingAgentsPanel, ComposioConnectCard, FetchSseEventStream, InboxPanel, IntegrationsBand, IntegrationsPage, MISSION_EVENT_CATEGORIES, MessageResponse, MissionDashboard, MissionsPanel, ResearchSourcesPanel, ScheduledWorkPanel, SessionTreePanel, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, formatMissionTimestamp, groupMissionTasksByBucket, isTerminalMissionStatus, mergeMissionEvents, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|
|
19231
|
+
export { ACTIVE_MISSION_STATUSES, AgentChat, AgentChatAdapterProvider, BrandBeam, BrowserLiveView, CitationText, CodingAgentsPanel, ComposioConnectCard, FetchSseEventStream, InboxPanel, IntegrationsBand, IntegrationsPage, MISSION_EVENT_CATEGORIES, MessageResponse, MissionDashboard, MissionsPanel, ORB_STATE_LABELS, OrbShimmerLabel, ResearchSourcesPanel, SIMPLE_MODE_HIDDEN_TOOLS, SIMPLE_MODE_ORB_OPTIONS, ScheduledWorkPanel, SessionTreePanel, defaultSelectedMissionTaskId, deriveMissionWorkerActivityLabel, deriveOrbActivity, formatMissionTimestamp, groupMissionTasksByBucket, isHiddenSimpleTool, isTerminalMissionStatus, mergeMissionEvents, messageOrbState, missionEventActorLabel, missionEventCategory, missionEventSummary, missionEventTaskId, missionTaskBlocks, missionTaskBucket, missionTaskRailGroups, missionTaskStatusDotClass, missionTaskTitle, missionWorkerTaskCounts, splitCitations, stripMissionControlMarkup, toolOrbState, useAgentChatAdapterContext, useAgentChatRuntime, useChatViewMode, useInboxUnreadCount, useMissionEvents };
|
|
16715
19232
|
//# sourceMappingURL=index.js.map
|
|
16716
19233
|
//# sourceMappingURL=index.js.map
|