Skip to content

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

2.2 KB
Raw Blame
---
/** The sidebar icons of the Settings app (`apps/settings/src/icons.tsx`). */
interface Props {
  section: "dock" | "windows" | "menubar" | "system";
}

const { section } = Astro.props;
const tiles = {
  dock: ["#4aa3ff", "#0a6cf0"],
  windows: ["#b57bff", "#7d3ff0"],
  menubar: ["#ff9f45", "#f0640a"],
  system: ["#a1a1a6", "#6e6e73"],
} as const;
const [top, bottom] = tiles[section];
const gradient = `settings-tile-${section}`;
---

<svg class="settings-icon" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true">
  <defs>
    <linearGradient id={gradient} x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color={top}></stop>
      <stop offset="1" stop-color={bottom}></stop>
    </linearGradient>
  </defs>
  <rect width="24" height="24" rx="5.5" fill={`url(#${gradient})`}></rect>
  {
    section === "dock" && (
      <>
        <rect x="4" y="14.5" width="16" height="5" rx="1.6" fill="#fff" opacity="0.55" />
        <rect x="6" y="10.5" width="3.4" height="3.4" rx="0.9" fill="#fff" />
        <rect x="10.3" y="10.5" width="3.4" height="3.4" rx="0.9" fill="#fff" />
        <rect x="14.6" y="10.5" width="3.4" height="3.4" rx="0.9" fill="#fff" />
      </>
    )
  }
  {
    section === "windows" && (
      <>
        <rect x="4.5" y="5.5" width="11" height="8.5" rx="1.4" fill="#fff" opacity="0.55" />
        <rect x="8.5" y="9.5" width="11" height="9" rx="1.4" fill="#fff" />
        <rect x="8.5" y="9.5" width="11" height="2.2" rx="1" fill="#000" opacity="0.18" />
      </>
    )
  }
  {
    section === "menubar" && (
      <>
        <rect x="4" y="5" width="16" height="14" rx="2" fill="#fff" opacity="0.55" />
        <rect x="4" y="5" width="16" height="3.6" rx="1.6" fill="#fff" />
        <circle cx="16.8" cy="6.8" r="0.9" fill="#f0640a" />
      </>
    )
  }
  {
    section === "system" && (
      <path
        fill="#fff"
        fill-rule="evenodd"
        transform="translate(0 0.5)"
        d="M10.6 3.5h2.8l.4 2.1c.5.2 1 .4 1.4.8l2-.8 1.4 2.4-1.6 1.4a6 6 0 0 1 0 1.6l1.6 1.4-1.4 2.4-2-.8c-.4.3-.9.6-1.4.8l-.4 2.1h-2.8l-.4-2.1c-.5-.2-1-.5-1.4-.8l-2 .8-1.4-2.4 1.6-1.4a6 6 0 0 1 0-1.6L5.4 8l1.4-2.4 2 .8c.4-.4.9-.6 1.4-.8zM12 9.4a2.6 2.6 0 1 0 0 5.2 2.6 2.6 0 0 0 0-5.2z"
      />
    )
  }
</svg>