Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

feat(ui): model picker easter egg when both sliders are maxed

Marlad34013694262
diff --git a/test/model-quality.unit.test.ts b/test/model-quality.unit.test.ts
index acff5ae..6395d1e 100644
--- a/test/model-quality.unit.test.ts
+++ b/test/model-quality.unit.test.ts
@@ -296,6 +296,20 @@ describe("界面:选择器的两个滑块", () => {
expect(find(v, (n) => n.props?.class === "tier-val custom")).toBeTruthy();
});
+ it("彩蛋:看得见的滑块都拉到最右才有(质量 + 最强);差一档都没有", () => {
+ const maxed = (v: any) => v.props.class === "tiers maxed";
+ const sparks = (v: any) => all(v, (n) => typeof n.type === "function" && n.type.name === "Sparks");
+ expect(maxed(panel({ strategy: "stable", cur: 4, model: "claude-opus-5-5" }))).toBe(true);
+ expect(sparks(panel({ strategy: "stable", cur: 4, model: "claude-opus-5-5" }))).toHaveLength(1);
+ expect(maxed(panel({ strategy: "balanced", cur: 4, model: "claude-opus-5-5" }))).toBe(false);
+ expect(maxed(panel({ strategy: "stable", cur: 3 }))).toBe(false);
+ expect(maxed(panel({ strategy: "stable", cur: -1, model: "kimi-k3" }))).toBe(false);
+ expect(sparks(panel({ strategy: "stable", cur: 3 }))).toHaveLength(0);
+ // 没有性价比滑块时,只看模型智能
+ expect(maxed(panel({ showStrategy: false, cur: 4, model: "claude-opus-5-5" }))).toBe(true);
+ expect(maxed(panel({ showStrategy: false, stops: stops.slice(0, 1), cur: 0 }))).toBe(false);
+ });
+
it("滑块和模型名:拖到第几档就选那个模型;点模型名去完整列表;恢复默认只在不是默认时出现", () => {
const got: string[] = [];
const v = panel({ onStop: (m: string) => got.push(`stop:${m}`), onStrategy: (s: string) => got.push(`strategy:${s}`), onList: () => got.push("list") });
diff --git a/ui/components/model-picker.js b/ui/components/model-picker.js
index 72c2aa5..fb6bb2c 100644
--- a/ui/components/model-picker.js
+++ b/ui/components/model-picker.js
@@ -91,7 +91,10 @@ export function TierPanel({ strategy, showStrategy, stops, cur, anchor, model, c
const n = stops.length;
const si = STRATEGIES.indexOf(strategy);
const level = levelLabel(cur, n);
- return html`<div class="tiers">
+ // 彩蛋:看得见的滑块都拉到最右(质量 + 最强)时,弹窗发光、轨道流动、四周飘几粒光点
+ const maxed = n >= 2 && cur === n - 1 && (!showStrategy || si === STRATEGIES.length - 1);
+ return html`<div class=${`tiers${maxed ? " maxed" : ""}`}>
+ ${maxed && html`<${Sparks} />`}
${canReset && html`<button type="button" class="icon-btn tiers-reset" title=${t("models.tiers.reset")} aria-label=${t("models.tiers.reset")} onClick=${onReset}><${Icon} name="reset" size="sm" /></button>`}
${showStrategy && html`<section class="tier">
<div class="tier-head"><span class="tier-name">${t("models.tiers.value")}</span><span class="tier-val">${strategyLabel(strategy)}</span></div>
@@ -109,6 +112,16 @@ export function TierPanel({ strategy, showStrategy, stops, cur, anchor, model, c
</div>`;
}
+// 光点的位置、大小、节奏是固定的(重绘不跳):沿着四条边各撒几粒
+const SPARKS = [
+ [9, 5, 3, 0], [31, 3, 2, 1.1], [57, 6, 3, 2.3], [83, 4, 2, 0.6],
+ [16, 95, 2, 1.7], [44, 92, 3, 0.3], [70, 96, 2, 2.8], [91, 91, 3, 1.4],
+ [3, 28, 2, 2.1], [5, 61, 3, 0.9], [96, 22, 3, 1.9], [94, 50, 2, 0.2], [97, 77, 3, 2.6],
+];
+function Sparks() {
+ return html`<div class="tiers-sparks" aria-hidden="true">${SPARKS.map(([x, y, s, d], i) => html`<i key=${i} style=${`--x:${x}%;--y:${y}%;--s:${s}px;--d:${d}s`} />`)}</div>`;
+}
+
/**
* models: string[] | null(加载中);error: 加载失败时的说明。
* reset: { label, note, onSelect } 顶部"恢复默认"项;foot: { label, onClick, disabled } 底部操作。
diff --git a/ui/design/components/popover.css b/ui/design/components/popover.css
index 08d1bed..bcaf18f 100644
--- a/ui/design/components/popover.css
+++ b/ui/design/components/popover.css
@@ -52,6 +52,48 @@
.tier-foot { margin: 0; padding-top: var(--space-2-5); border-top: 1px solid var(--line-2); text-align: center; font-size: var(--fs-2xs); color: var(--muted); }
.tier-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tier-foot a:hover { color: var(--fg-2); }
+
+/* —— 彩蛋:两个滑块都拉满(.tiers.maxed)——
+ 弹窗外圈一层荧光绿的光,内沿一圈缓慢转动的渐变描边;两条轨道的填充换成流动的绿色渐变(浅色下也是荧光绿,
+ 不再是墨色);四周飘几粒光点。减少 / 关闭动画时只留静止的光和描边。 */
+@property --tiers-spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
+.pop.model-picker { transition: box-shadow var(--t-moderate); }
+.pop.model-picker:has(> .tiers.maxed) {
+ --egg-1: var(--lime-500);
+ --egg-2: #3dffb5; /* 薄荷绿:只用在彩蛋里,让渐变流动看得出来 */
+ box-shadow: var(--shadow-pop), 0 0 0 1px color-mix(in srgb, var(--egg-1) 55%, transparent),
+ 0 0 20px color-mix(in srgb, var(--egg-1) 38%, transparent), 0 0 44px color-mix(in srgb, var(--egg-2) 16%, transparent);
+}
+.tiers.maxed::before {
+ content: ""; position: absolute; inset: 0; border-radius: var(--pop-r); padding: 1.5px; pointer-events: none;
+ background: conic-gradient(from var(--tiers-spin), var(--egg-1), var(--egg-2), transparent 40%, var(--egg-1) 60%, var(--egg-2) 80%, var(--egg-1));
+ -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
+ mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
+ animation: tiers-spin 5s linear infinite;
+}
+@keyframes tiers-spin { to { --tiers-spin: 360deg; } }
+.tiers.maxed .stops {
+ --stops-fill-bg: linear-gradient(90deg, var(--egg-1), var(--egg-2), var(--lime-300), var(--egg-1)) 0 0 / 200% 100%;
+ --stops-dot-on: color-mix(in srgb, var(--olive-950) 40%, transparent);
+ --stops-knob-bg: var(--white);
+ box-shadow: 0 0 12px color-mix(in srgb, var(--egg-1) 45%, transparent);
+}
+.tiers.maxed .stops-fill { animation: tiers-flow 2.4s linear infinite; }
+@keyframes tiers-flow { to { background-position: -200% 0; } }
+.tiers-sparks { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
+.tiers-sparks i {
+ position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%;
+ background: var(--egg-1); box-shadow: 0 0 6px 1px color-mix(in srgb, var(--egg-1) 70%, transparent), 0 0 0 .5px color-mix(in srgb, var(--olive-950) 25%, transparent);
+ opacity: 0; animation: tiers-spark 3.2s var(--ease-in-out) var(--d) infinite;
+}
+@keyframes tiers-spark {
+ 0%, 100% { opacity: 0; transform: translateY(0) scale(.6); }
+ 40% { opacity: .9; transform: translateY(calc(-6px * var(--motion))) scale(1); }
+ 70% { opacity: .35; transform: translateY(calc(-10px * var(--motion))) scale(.8); }
+}
+:root:is([data-motion="reduce"], [data-motion="off"]) .tiers.maxed::before,
+:root:is([data-motion="reduce"], [data-motion="off"]) .tiers.maxed .stops-fill { animation: none; }
+:root:is([data-motion="reduce"], [data-motion="off"]) .tiers-sparks i { animation: none; opacity: .5; }
:is(.pop, .palette) .search .search-back { margin-left: calc(-1 * var(--space-1)); color: var(--muted); }
/* —— 命令面板 —— */