Skip to content

A lightweight, macOS-style dock for Windows 11, with glass visuals, smooth magnification, and Genie effect.

feat(settings): enhance dock customization options and improve UI elements

CristianOlivera12a1e13cb562e
diff --git a/muelle/src/components/showcase/Customize.astro b/muelle/src/components/showcase/Customize.astro
index cb399d8..989da1c 100644
--- a/muelle/src/components/showcase/Customize.astro
+++ b/muelle/src/components/showcase/Customize.astro
@@ -9,7 +9,7 @@ import ToggleRow from "@/components/showcase/ToggleRow.astro";
import Crab from "@/components/crab/Crab.astro";
import {
customizeIntro,
- previewIcons,
+ previewDockItems,
settingsDefaults as d,
settingsText,
type SettingsKey,
@@ -37,22 +37,20 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
<i></i>
</div>
<nav class="settings-nav">
- {
- panes.map((pane, index) => (
- <button
- type="button"
- data-pane={pane}
- data-label={pane}
- aria-current={index === 0 ? "page" : undefined}
- aria-label={t[pane]}
- >
- <SettingsIcon section={pane} />
- <span class="settings-nav-label" {...tx(pane)}>
- {t[pane]}
- </span>
- </button>
- ))
- }
+ {panes.map((pane, index) => (
+ <button
+ type="button"
+ data-pane={pane}
+ data-label={pane}
+ aria-current={index === 0 ? "page" : undefined}
+ aria-label={t[pane]}
+ >
+ <SettingsIcon section={pane} />
+ <span class="settings-nav-label" {...tx(pane)}>
+ {t[pane]}
+ </span>
+ </button>
+ ))}
</nav>
</aside>
@@ -82,6 +80,23 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
<small {...tx("large")}>{t.large}</small>
</span>
</div>
+ <div class="settings-row">
+ <label class="settings-label" for="preview-density" {...tx("dockDensity")}>
+ {t.dockDensity}
+ </label>
+ <select
+ id="preview-density"
+ class="mac-select"
+ data-setting="dockDensity"
+ data-label="dockDensity"
+ >
+ {(["compact", "normal", "spacious"] as const).map((choice) => (
+ <option value={choice} selected={choice === d.dockDensity} {...tx(choice)}>
+ {t[choice]}
+ </option>
+ ))}
+ </select>
+ </div>
<div class="settings-row">
<span class="settings-text">
<span class="settings-label" {...tx("magnification")}>
@@ -124,8 +139,35 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
<div class="settings-card">
<ToggleRow name="autoHide" hint="autoHideHint" on={d.autoHide} />
+ <div class="settings-row" data-speed-row hidden>
+ <label class="settings-label" for="preview-hide-speed" {...tx("dockAutoHideSpeed")}>
+ {t.dockAutoHideSpeed}
+ </label>
+ <select
+ id="preview-hide-speed"
+ class="mac-select"
+ data-setting="dockAutoHideSpeed"
+ data-label="dockAutoHideSpeed"
+ >
+ {(["smooth", "normal", "fast"] as const).map((choice) => (
+ <option value={choice} selected={choice === d.dockAutoHideSpeed} {...tx(choice)}>
+ {t[choice]}
+ </option>
+ ))}
+ </select>
+ </div>
<ToggleRow name="mascot" hint="mascotHint" on={d.mascot} />
</div>
+ <details class="settings-card settings-details">
+ <summary {...tx("fixedItems")}>{t.fixedItems}</summary>
+ <ToggleRow name="showStart" on={d.showStart} />
+ <ToggleRow name="pinExplorer" hint="pinExplorerHint" on={d.pinExplorer} />
+ <ToggleRow name="showDownloads" on={d.showDownloads} />
+ <ToggleRow name="showTrash" on={d.showTrash} />
+ <p class="settings-hint settings-note" {...tx("fixedItemsHint")}>
+ {t.fixedItemsHint}
+ </p>
+ </details>
</div>
<div class="settings-body" data-view="windows" hidden>
@@ -138,11 +180,23 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
<div class="settings-body" data-view="menubar" hidden>
<div class="settings-card">
<ToggleRow name="menuBar" hint="menuBarHint" on={d.menuBar} />
- <ToggleRow name="menuBarAutoHide" hint="menuBarAutoHideHint" on={d.menuBarAutoHide} sub />
+ <ToggleRow
+ name="menuBarAutoHide"
+ hint="menuBarAutoHideHint"
+ on={d.menuBarAutoHide}
+ sub
+ />
<ToggleRow name="aiUsage" hint="aiUsageHint" on={d.aiUsage} sub />
- <ToggleRow name="accessoryBattery" hint="accessoryBatteryHint" on={d.accessoryBattery} sub />
+ <ToggleRow
+ name="accessoryBattery"
+ hint="accessoryBatteryHint"
+ on={d.accessoryBattery}
+ sub
+ />
</div>
- <p class="settings-hint" {...tx("accessoryPreviewHint")}>{t.accessoryPreviewHint}</p>
+ <p class="settings-hint" {...tx("accessoryPreviewHint")}>
+ {t.accessoryPreviewHint}
+ </p>
</div>
<div class="settings-body" data-view="system" hidden>
@@ -214,7 +268,7 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
sizes="(min-width: 1024px) 480px, 100vw"
/>
<div class="preview-bar" data-preview-bar>
- <b>File Explorer</b>
+ <b>Muelle</b>
<span class="preview-island" data-preview-island aria-hidden="true">
<i style="--ring: #d97757; --p: 63%"></i>63%
<i style="--ring: #8ab4f8; --p: 28%"></i>28%
@@ -230,8 +284,13 @@ const textJson = JSON.stringify(settingsText).replace(/</g, "\\u003c");
</span>
</div>
<div class="preview-dock" data-preview-dock>
- {previewIcons.map((icon) => (
- <Image src={icon} alt="" class="w-32" />
+ <span class="preview-start" data-preview-icon data-fixed="showStart" aria-hidden="true">
+ <svg viewBox="0 0 24 24">
+ <path d="M2 2h9v9H2zm11 0h9v9h-9zM2 13h9v9H2zm11 0h9v9h-9z" />
+ </svg>
+ </span>
+ {previewDockItems.map(({ icon, fixed }) => (
+ <Image src={icon} alt="" class="w-32" data-preview-icon data-fixed={fixed} />
))}
</div>
<Crab cell={2} class="crab-free" data-preview-crab />
diff --git a/muelle/src/components/showcase/ToggleRow.astro b/muelle/src/components/showcase/ToggleRow.astro
index 21d2519..027b512 100644
--- a/muelle/src/components/showcase/ToggleRow.astro
+++ b/muelle/src/components/showcase/ToggleRow.astro
@@ -4,7 +4,7 @@ import { type SettingsKey, settingsText } from "@/data/showcase";
interface Props {
name: SettingsKey;
- hint: SettingsKey;
+ hint?: SettingsKey;
on: boolean;
sub?: boolean;
}
@@ -15,8 +15,14 @@ const t = settingsText.en;
<div class:list={["settings-row", sub && "settings-row-sub"]} data-row={name}>
<span class="settings-text">
- <span class="settings-label" data-t={name}>{t[name]}</span>
- <span class="settings-hint" data-t={hint}>{t[hint]}</span>
+ <span class="settings-label" data-t={name}>
+ {t[name]}
+ </span>
+ {hint && (
+ <span class="settings-hint" data-t={hint}>
+ {t[hint]}
+ </span>
+ )}
</span>
<button
type="button"
diff --git a/muelle/src/data/showcase.ts b/muelle/src/data/showcase.ts
index da2ffdc..f2a8af9 100644
--- a/muelle/src/data/showcase.ts
+++ b/muelle/src/data/showcase.ts
@@ -32,11 +32,16 @@ export interface AnatomyGroup {
export const anatomyIntro = {
eyebrow: "The Dock",
title: "Everything in its place.",
- lead: "Your apps, your files and your open windows, in one glass shelf at the bottom of the screen. Every part of it works like you expect from a Mac.",
+ lead: "Your apps, files and open windows in one glass shelf. Place it along the bottom or either side, and keep only the shortcuts you need.",
} as const;
export const anatomy: AnatomyGroup[] = [
- { label: "Start", detail: "The Windows Start menu, always first", side: "top", tiles: [{ kind: "start" }] },
+ {
+ label: "Start",
+ detail: "The Windows Start menu. Optional",
+ side: "top",
+ tiles: [{ kind: "start" }],
+ },
{
label: "Pinned apps",
detail: "Drag to reorder. A dot marks the open ones",
@@ -60,15 +65,20 @@ export const anatomy: AnatomyGroup[] = [
},
{
label: "Downloads",
- detail: "Drop files straight in",
+ detail: "Drop files in. Right-click to hide",
side: "bottom",
divider: true,
tiles: [{ kind: "app", icon: downloads, label: "Downloads" }],
},
- { label: "Minimized", detail: "Optional live thumbnails of minimized windows", side: "top", tiles: [{ kind: "window" }] },
+ {
+ label: "Minimized",
+ detail: "Optional live thumbnails of minimized windows",
+ side: "top",
+ tiles: [{ kind: "window" }],
+ },
{
label: "Recycle Bin",
- detail: "Drop files to delete them",
+ detail: "Drop files to recycle. Optional",
side: "bottom",
tiles: [{ kind: "app", icon: recycleBin, label: "Recycle Bin" }],
},
@@ -79,20 +89,26 @@ export const anatomy: AnatomyGroup[] = [
export const customizeIntro = {
eyebrow: "Settings",
title: "Make it yours.",
- lead: "A real settings window, in English or Spanish. Try each change here, including optional mouse and headset battery indicators. Accessory monitoring stays off until you enable it.",
+ lead: "Adjust icon size, spacing and animation speed. Choose which shortcuts stay in your Dock, and try the changes in the preview.",
} as const;
/** The preview dock in the Customize scene. */
-export const previewIcons: ImageMetadata[] = [
- fileExplorer,
- microsoftStore,
- windowsTerminal,
- microsoftPhotos,
- settings,
- downloads,
- recycleBin,
+export const previewDockItems: {
+ icon: ImageMetadata;
+ fixed?: "pinExplorer" | "showDownloads" | "showTrash";
+}[] = [
+ { icon: fileExplorer, fixed: "pinExplorer" },
+ { icon: microsoftStore },
+ { icon: windowsTerminal },
+ { icon: microsoftPhotos },
+ { icon: settings },
+ { icon: downloads, fixed: "showDownloads" },
+ { icon: recycleBin, fixed: "showTrash" },
];
+/** Shared decorative docks keep their existing icon list. */
+export const previewIcons: ImageMetadata[] = previewDockItems.map(({ icon }) => icon);
+
/** Same defaults as the app (`crates/muelle-config`). */
export const settingsDefaults = {
iconSize: 48,
@@ -102,6 +118,12 @@ export const settingsDefaults = {
magnifiedSize: 77,
magnifiedSizeMax: 160,
autoHide: false,
+ dockDensity: "normal",
+ dockAutoHideSpeed: "normal",
+ showStart: true,
+ showDownloads: true,
+ showTrash: true,
+ pinExplorer: true,
menuBar: true,
menuBarAutoHide: false,
aiUsage: true,
@@ -122,6 +144,21 @@ export const settingsText = {
menubar: "Menu bar",
system: "System",
size: "Size",
+ dockDensity: "Spacing",
+ compact: "Compact",
+ normal: "Normal",
+ spacious: "Spacious",
+ dockAutoHideSpeed: "Animation speed",
+ smooth: "Smooth",
+ fast: "Fast",
+ fixedItems: "Dock shortcuts",
+ fixedItemsHint:
+ "You can also right-click Start, Downloads or Recycle Bin in Muelle and choose Remove from Dock.",
+ showStart: "Show Start",
+ showDownloads: "Show Downloads",
+ showTrash: "Show Recycle Bin",
+ pinExplorer: "Keep File Explorer in the Dock",
+ pinExplorerHint: "When off, it still appears while its windows are open.",
small: "Small",
large: "Large",
magnification: "Magnification",
@@ -134,19 +171,26 @@ export const settingsText = {
menuBarAutoHide: "Automatically hide and show the menu bar",
menuBarAutoHideHint: "It reappears when you touch the top edge of the screen.",
aiUsage: "Show AI provider usage",
- aiUsageHint: "While a supported AI client is open, an island in the menu bar shows its available plan limits.",
+ aiUsageHint:
+ "While a supported AI client is open, an island in the menu bar shows its available plan limits.",
accessoryBattery: "Show accessory battery",
- accessoryBatteryHint: "Battery levels for supported mice and headsets. While off, no accessories are monitored or queried.",
- accessoryPreviewHint: "Turn this on to preview a connected mouse and headset. The values are examples; device support varies.",
+ accessoryBatteryHint:
+ "Battery levels for supported mice and headsets. While off, no accessories are monitored or queried.",
+ accessoryPreviewHint:
+ "Turn this on to preview a connected mouse and headset. The values are examples; device support varies.",
genie: "Genie effect",
- genieHint: "While it is on, windows do not use the Windows animations for maximizing or closing.",
+ genieHint:
+ "While it is on, windows do not use the Windows animations for maximizing or closing.",
showMinimized: "Show minimized windows",
- showMinimizedHint: "As thumbnails on the right side of the Dock, instead of inside their app's icon.",
+ showMinimizedHint:
+ "As thumbnails on the right side of the Dock, instead of inside their app's icon.",
autostart: "Open Muelle at login",
mascot: "Crab on special moments",
- mascotHint: "A pixel crab comes out when an AI plan resets or runs out, when you plug in the charger, or when energy saver starts. Hover over it.",
+ mascotHint:
+ "A pixel crab comes out when an AI plan resets or runs out, when you plug in the charger, or when energy saver starts. Hover over it.",
autoUpdate: "Install updates automatically",
- autoUpdateHint: "Once a day, a couple of minutes after you turn on the computer (or every 24 hours if it stays on), Muelle installs new versions by itself.",
+ autoUpdateHint:
+ "Once a day, a couple of minutes after you turn on the computer (or every 24 hours if it stays on), Muelle installs new versions by itself.",
language: "Language",
languageAuto: "Automatic",
updates: "Updates",
@@ -161,6 +205,21 @@ export const settingsText = {
menubar: "Barra superior",
system: "Sistema",
size: "Tamaño",
+ dockDensity: "Espaciado",
+ compact: "Compacto",
+ normal: "Normal",
+ spacious: "Amplio",
+ dockAutoHideSpeed: "Velocidad de la animación",
+ smooth: "Suave",
+ fast: "Rápida",
+ fixedItems: "Accesos del Dock",
+ fixedItemsHint:
+ "También puedes hacer clic derecho en Inicio, Descargas o Papelera en Muelle y elegir Quitar del Dock.",
+ showStart: "Mostrar Inicio",
+ showDownloads: "Mostrar Descargas",
+ showTrash: "Mostrar Papelera",
+ pinExplorer: "Mantener Explorador en el Dock",
+ pinExplorerHint: "Desactivado, sigue apareciendo mientras tenga ventanas abiertas.",
small: "Pequeño",
large: "Grande",
magnification: "Ampliación",
@@ -173,19 +232,26 @@ export const settingsText = {
menuBarAutoHide: "Ocultar y mostrar la barra superior automáticamente",
menuBarAutoHideHint: "Reaparece al tocar el borde superior de la pantalla.",
aiUsage: "Mostrar uso de proveedores de IA",
- aiUsageHint: "Mientras un cliente de IA compatible está abierto, una isla en la barra superior muestra sus límites disponibles.",
+ aiUsageHint:
+ "Mientras un cliente de IA compatible está abierto, una isla en la barra superior muestra sus límites disponibles.",
accessoryBattery: "Mostrar batería de accesorios",
- accessoryBatteryHint: "Batería de ratones y auriculares compatibles. Desactivado, no detecta ni consulta accesorios.",
- accessoryPreviewHint: "Actívalo para ver un ratón y unos auriculares conectados. Los valores son ejemplos; la compatibilidad depende del dispositivo.",
+ accessoryBatteryHint:
+ "Batería de ratones y auriculares compatibles. Desactivado, no detecta ni consulta accesorios.",
+ accessoryPreviewHint:
+ "Actívalo para ver un ratón y unos auriculares conectados. Los valores son ejemplos; la compatibilidad depende del dispositivo.",
genie: "Efecto genio",
- genieHint: "Mientras está activo, las ventanas no usan las animaciones de Windows al maximizar ni al cerrar.",
+ genieHint:
+ "Mientras está activo, las ventanas no usan las animaciones de Windows al maximizar ni al cerrar.",
showMinimized: "Mostrar ventanas minimizadas",
- showMinimizedHint: "Como miniaturas a la derecha del Dock, en lugar de dentro del icono de su app.",
+ showMinimizedHint:
+ "Como miniaturas a la derecha del Dock, en lugar de dentro del icono de su app.",
autostart: "Abrir Muelle al iniciar sesión",
mascot: "Cangrejo en momentos especiales",
- mascotHint: "Un cangrejo pixelado aparece cuando un plan de IA se reinicia o se agota, al enchufar el cargador o al activarse el ahorro de energía. Pasa el puntero por encima.",
+ mascotHint:
+ "Un cangrejo pixelado aparece cuando un plan de IA se reinicia o se agota, al enchufar el cargador o al activarse el ahorro de energía. Pasa el puntero por encima.",
autoUpdate: "Instalar actualizaciones automáticamente",
- autoUpdateHint: "Una vez al día, un par de minutos después de encender el ordenador (o cada 24 horas si sigue encendido), Muelle instala las versiones nuevas por sí solo.",
+ autoUpdateHint:
+ "Una vez al día, un par de minutos después de encender el ordenador (o cada 24 horas si sigue encendido), Muelle instala las versiones nuevas por sí solo.",
language: "Idioma",
languageAuto: "Automático",
updates: "Actualizaciones",
@@ -206,12 +272,27 @@ export const safetyIntro = {
} as const;
/** The taskbar shown when Muelle is off. */
-export const taskbarIcons: ImageMetadata[] = [fileExplorer, microsoftStore, windowsTerminal, microsoftPhotos, settings];
+export const taskbarIcons: ImageMetadata[] = [
+ fileExplorer,
+ microsoftStore,
+ windowsTerminal,
+ microsoftPhotos,
+ settings,
+];
export const safetyFacts = [
- { title: "Quit any time", body: "Right-click the dock and choose Quit Muelle. The taskbar is back at once." },
- { title: "Even if it stops", body: "A tiny guardian process watches the dock and restores the taskbar if it ever stops." },
- { title: "Uninstall cleanly", body: "Windows Settings → Apps → Muelle. Windows is left exactly as it was." },
+ {
+ title: "Quit any time",
+ body: "Right-click the dock and choose Quit Muelle. The taskbar is back at once.",
+ },
+ {
+ title: "Even if it stops",
+ body: "A tiny guardian process watches the dock and restores the taskbar if it ever stops.",
+ },
+ {
+ title: "Uninstall cleanly",
+ body: "Windows Settings → Apps → Muelle. Windows is left exactly as it was.",
+ },
] as const;
/* --------------------------------------------------------------- Download */
@@ -229,7 +310,10 @@ export const download = {
releases: "All versions on GitHub",
steps: [
{ title: "Open the installer", body: "Per user. No admin rights, no wizard." },
- { title: "If SmartScreen asks", body: "Muelle is new, so Windows may not know it yet: More info → Run anyway." },
+ {
+ title: "If SmartScreen asks",
+ body: "Muelle is new, so Windows may not know it yet: More info → Run anyway.",
+ },
{ title: "That's it", body: "The dock appears and starts with Windows from now on." },
],
source: {
diff --git a/muelle/src/data/usage.ts b/muelle/src/data/usage.ts
index 22ef70c..f18159c 100644
--- a/muelle/src/data/usage.ts
+++ b/muelle/src/data/usage.ts
@@ -52,17 +52,17 @@ export const usageProviders: UsageProvider[] = [
export const usageIntro = {
eyebrow: "AI usage",
title: "AI plan usage, at a glance.",
- lead: "Muelle shows available limits for Claude Code, Codex, OpenCode Go, and Gemini CLI or Antigravity. Gemini Pro and Flash quotas appear separately when available.",
+ lead: "Available quotas and reset times for Claude Code, Codex, OpenCode Go, Gemini / Antigravity and Z.ai GLM Coding Plan, in the menu bar.",
} as const;
export const usageFacts = [
{
title: "Only while you use them",
- body: "The island recognizes four clients: Claude Code, Codex, OpenCode Go, and Gemini CLI or Antigravity.",
+ body: "Providers appear while a supported client is running. Z.ai works with OpenCode and your configured Coding Plan key.",
},
{
title: "Your existing session",
- body: "Muelle reuses the sign-in those tools already keep on your PC. Gemini Pro and Flash are shown as separate model families when the provider supplies those quotas.",
+ body: "Muelle uses the sign-in or Coding Plan key already configured on your PC. Gemini Pro and Flash stay separate when those quotas are available.",
},
{
title: "Straight to the provider",
diff --git a/muelle/src/scripts/customize.ts b/muelle/src/scripts/customize.ts
index b913d7d..2bcc41b 100644
--- a/muelle/src/scripts/customize.ts
+++ b/muelle/src/scripts/customize.ts
@@ -1,9 +1,9 @@
-import { prefersReducedMotion } from "@/lib/motion";
+import { prefersReducedMotion, ScrollTrigger } from "@/lib/motion";
/** The preview desk is smaller than a screen, so the dock is drawn at this share of its size. */
const PREVIEW_SCALE = 0.7;
-/** Horizontal room the dock needs besides its icons: gaps, padding, border and a margin to the desk edge. */
-const DOCK_CHROME = 72;
+/** Room between the preview dock and the desk edges. */
+const DOCK_MARGIN = 24;
/** Width of the magnified area around the pointer, in preview pixels at `PREVIEW_SCALE`. */
const SIGMA = 46;
/** How close to an edge the pointer must be to reveal an auto-hidden bar. */
@@ -13,8 +13,11 @@ const DOCK_REACH = 60;
const CHECK_MS = 1100;
/** How long the dock stays magnified after a magnification setting changes. */
const DEMO_MS = 1400;
-/** Gap between preview icons; it must match the gap of `.preview-dock` in the stylesheet. */
-const ICON_GAP = 6;
+const DENSITIES = {
+ compact: { gap: 4, padding: 4 },
+ normal: { gap: 6, padding: 6 },
+ spacious: { gap: 8, padding: 8 },
+} as const;
type Strings = Record<string, string>;
@@ -34,7 +37,13 @@ export function initCustomize(root: HTMLElement) {
const texts = JSON.parse(textNode.textContent ?? "{}") as Record<"en" | "es", Strings>;
let strings = texts.en;
- const icons = [...dock.querySelectorAll<HTMLImageElement>("img")];
+ const icons = [...dock.querySelectorAll<HTMLElement>("[data-preview-icon]")];
+ const choices = new Map(
+ [...scene.querySelectorAll<HTMLSelectElement>("select[data-setting]")].map((select) => [
+ select.dataset.setting ?? "",
+ select,
+ ]),
+ );
const ranges = new Map(
[...scene.querySelectorAll<HTMLInputElement>("input[data-setting]")].map((input) => [
input.dataset.setting ?? "",
@@ -68,9 +77,18 @@ export function initCustomize(root: HTMLElement) {
let demoTimer = 0;
const layoutDock = () => {
+ const visibleIcons = icons.filter((icon) => !icon.hidden);
+ const density = choices.get("dockDensity")?.value as keyof typeof DENSITIES;
+ const { gap, padding } = DENSITIES[density] ?? DENSITIES.normal;
+ dock.style.gap = `${gap}px`;
+ dock.style.padding = `${padding}px ${padding + 2}px`;
// Narrow desks (phones) shrink the dock so even the largest icon size fits.
- const largest = icons.length * Number(ranges.get("iconSize")?.max ?? 0);
- const scale = Math.min(PREVIEW_SCALE, (preview.clientWidth - DOCK_CHROME) / (largest || 1));
+ const largest = visibleIcons.length * Number(ranges.get("iconSize")?.max ?? 0);
+ const chrome = Math.max(0, visibleIcons.length - 1) * gap + 2 * (padding + 2) + DOCK_MARGIN;
+ const scale = Math.max(
+ 0,
+ Math.min(PREVIEW_SCALE, (preview.clientWidth - chrome) / (largest || 1)),
+ );
const sigma = SIGMA * (scale / PREVIEW_SCALE);
const size = value("iconSize") * scale;
const peak = value("magnifiedSize") * scale;
@@ -78,14 +96,16 @@ export function initCustomize(root: HTMLElement) {
const magnify = isOn("magnification") && focusX !== null && !prefersReducedMotion();
// Centres of the resting row: the magnified widths are derived from these.
- const rowWidth = icons.length * size + (icons.length - 1) * ICON_GAP;
+ const rowWidth = visibleIcons.length * size + Math.max(0, visibleIcons.length - 1) * gap;
const left = preview.clientWidth / 2 - rowWidth / 2;
- icons.forEach((icon, index) => {
+ visibleIcons.forEach((icon, index) => {
let width = size;
if (magnify && focusX !== null) {
- const center = left + index * (size + ICON_GAP) + size / 2;
+ const center = left + index * (size + gap) + size / 2;
const distance = focusX - center;
- width = size + (Math.max(peak, size) - size) * Math.exp(-(distance * distance) / (2 * sigma * sigma));
+ width =
+ size +
+ (Math.max(peak, size) - size) * Math.exp(-(distance * distance) / (2 * sigma * sigma));
}
icon.style.width = `${width}px`;
icon.style.height = `${width}px`;
@@ -126,6 +146,17 @@ export function initCustomize(root: HTMLElement) {
island?.toggleAttribute("hidden", !isOn("aiUsage"));
accessories?.toggleAttribute("hidden", !isOn("accessoryBattery"));
bar.classList.toggle("has-accessories", isOn("accessoryBattery"));
+ scene
+ .querySelector<HTMLElement>("[data-speed-row]")
+ ?.toggleAttribute("hidden", !isOn("autoHide"));
+ for (const icon of icons) {
+ if (icon.dataset.fixed) icon.hidden = !isOn(icon.dataset.fixed);
+ }
+ const speed = choices.get("dockAutoHideSpeed")?.value;
+ dock.style.setProperty(
+ "--dock-slide-duration",
+ speed === "smooth" ? "0.48s" : speed === "fast" ? "0.2s" : "0.32s",
+ );
};
preview.addEventListener("pointermove", (event) => {
@@ -180,6 +211,15 @@ export function initCustomize(root: HTMLElement) {
else layoutDock();
});
});
+ choices.forEach((select) => {
+ select.addEventListener("change", () => {
+ applyBars();
+ layoutDock();
+ });
+ });
+ scene
+ .querySelector(".settings-details")
+ ?.addEventListener("toggle", () => ScrollTrigger.refresh());
/* ---- Panes and language ---------------------------------------------- */
@@ -202,7 +242,12 @@ export function initCustomize(root: HTMLElement) {
const status = scene.querySelector<HTMLElement>("[data-update-status]");
const setLanguage = (choice: string) => {
- const resolved = choice === "auto" ? (navigator.language.toLowerCase().startsWith("es") ? "es" : "en") : choice;
+ const resolved =
+ choice === "auto"
+ ? navigator.language.toLowerCase().startsWith("es")
+ ? "es"
+ : "en"
+ : choice;
strings = texts[resolved === "es" ? "es" : "en"];
scene.lang = resolved === "es" ? "es" : "en";
scene.querySelectorAll<HTMLElement>("[data-t]").forEach((node) => {
diff --git a/muelle/src/styles/showcase.css b/muelle/src/styles/showcase.css
index 6a04710..14eb876 100644
--- a/muelle/src/styles/showcase.css
+++ b/muelle/src/styles/showcase.css
@@ -431,6 +431,36 @@
display: none;
}
+.mac-select {
+ max-width: 48%;
+ padding: 4px 8px;
+ border: 1px solid var(--mac-hairline);
+ border-radius: 6px;
+ background: var(--mac-segment);
+ color: inherit;
+ font: inherit;
+}
+
+.mac-select option {
+ background: var(--mac-window);
+}
+
+.settings-details summary {
+ padding: 12px;
+ font-weight: 500;
+ cursor: pointer;
+}
+
+.settings-details[open] summary {
+ border-bottom: 1px solid var(--mac-hairline);
+}
+
+.settings-note {
+ margin: 0;
+ padding: 10px 12px;
+ border-top: 1px solid var(--mac-hairline);
+}
+
.settings-text {
display: grid;
gap: 2px;
@@ -496,6 +526,8 @@
.mac-button:focus-visible,
.mac-seg button:focus-visible,
.mac-range:focus-visible,
+.mac-select:focus-visible,
+.settings-details summary:focus-visible,
.settings-nav button:focus-visible {
outline: 2px solid var(--mac-accent);
outline-offset: 2px;
@@ -633,12 +665,20 @@
/* This desk is a miniature: keep status readings clear when there is no room
for the optional centre island, just as in the hero's mobile preview. */
@container (min-width: 441px) and (max-width: 640px) {
- .preview-bar.has-accessories [data-date] { display: none; }
- .preview-bar.has-accessories .preview-island { left: 42%; }
+ .preview-bar.has-accessories [data-date] {
+ display: none;
+ }
+ .preview-bar.has-accessories .preview-island {
+ left: 42%;
+ }
}
@container (max-width: 440px) {
- .preview-island { display: none; }
- .preview-bar [data-date] { display: none; }
+ .preview-island {
+ display: none;
+ }
+ .preview-bar [data-date] {
+ display: none;
+ }
}
.preview-dock {
@@ -657,14 +697,14 @@
background: rgb(255 255 255 / 0.22);
backdrop-filter: blur(20px) saturate(170%);
box-shadow: 0 12px 30px rgb(0 0 0 / 0.25);
- transition: translate 0.32s ease;
+ transition: translate var(--dock-slide-duration, 0.32s) ease;
}
.preview-dock.is-hidden {
translate: -50% calc(100% + 14px);
}
-.preview-dock img {
+.preview-dock [data-preview-icon] {
display: block;
flex: none;
/* The JS sets each size; this only smooths it. */
@@ -673,6 +713,20 @@
height 0.12s ease-out;
}
+.preview-dock [data-preview-icon][hidden] {
+ display: none;
+}
+.preview-dock .preview-start {
+ display: grid;
+ place-items: center;
+ border-radius: 22%;
+ background: linear-gradient(160deg, #3c9bff, #0062d1);
+}
+.preview-start svg {
+ width: 55%;
+ fill: #fff;
+}
+
/* ------------------------------------------------------------- Reversible */
.flip {
@@ -1068,7 +1122,7 @@
.mac-switch i,
.preview-bar,
.preview-dock,
- .preview-dock img,
+ .preview-dock [data-preview-icon],
.flip-menubar,
.flip-dock,
.flip-taskbar {