mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-22 20:52:23 +02:00
[eric] frontend: bring back the empty-state shimmer as a transform-only sheen, composited instead of repainting 60fps
This commit is contained in:
@@ -26,6 +26,8 @@ const DashboardEmptyState: React.FC<{ c: ClaudeTokens }> = ({ c }) => (
|
||||
alignItems: 'center',
|
||||
gap: 0.7,
|
||||
color: c.text.primary,
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
Click the
|
||||
@@ -33,6 +35,22 @@ const DashboardEmptyState: React.FC<{ c: ClaudeTokens }> = ({ c }) => (
|
||||
<ChatBubbleTeardrop sx={{ fontSize: 15 }} />
|
||||
</Box>
|
||||
below to launch your first agent
|
||||
{/* Sheen sweeps via transform only: the layer rasters once and the GPU slides it, unlike the old background-position shimmer that repainted every frame. */}
|
||||
<Box
|
||||
component="span"
|
||||
aria-hidden
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
pointerEvents: 'none',
|
||||
background: 'linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.14) 50%, transparent 58%)',
|
||||
transform: 'translateX(-100%)',
|
||||
animation: 'empty-state-sheen 6s linear infinite',
|
||||
willChange: 'transform',
|
||||
'@keyframes empty-state-sheen': { to: { transform: 'translateX(100%)' } },
|
||||
'@media (prefers-reduced-motion: reduce)': { animation: 'none' },
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user