Workspaces in Workspaces all around

This commit is contained in:
2026-02-19 01:49:15 +00:00
parent 72bca6cd42
commit dd8ab84df5
84 changed files with 3047 additions and 749 deletions
@@ -19,7 +19,8 @@ const ICON_GAP = 24;
const DOCK_PADDING = 12;
const MAX_SCALE = 1.5;
const MAX_DISTANCE = 150;
const BOTTOM_THRESHOLD = 100;
const SHOW_THRESHOLD = 24;
const HIDE_THRESHOLD = 100;
const getScale = (mouseX: number | null, iconCenterX: number) => {
if (mouseX === null) return 1;
@@ -39,12 +40,14 @@ export const Dock = ({ items, className }: DockProps) => {
useEffect(() => {
const handleMouseMove = (ev: MouseEvent) => {
const distFromBottom = window.innerHeight - ev.clientY;
if (distFromBottom <= BOTTOM_THRESHOLD) {
setVisible(true);
setVisible((prev) => {
if (!prev) return distFromBottom <= SHOW_THRESHOLD;
return distFromBottom <= HIDE_THRESHOLD;
});
if (distFromBottom <= HIDE_THRESHOLD) {
const rect = dockRef.current?.getBoundingClientRect();
if (rect) setMouseX(ev.clientX - rect.left);
} else {
setVisible(false);
setMouseX(null);
}
};