feat: turn floating add button into sleeping cat
This commit is contained in:
@@ -1034,6 +1034,7 @@ describe('unified floating add interaction', () => {
|
||||
expect(app).toContain('<FloatingAddButton')
|
||||
expect(floatingAdd).toContain('class="unified-fab"')
|
||||
expect(floatingAdd).toContain('@pointerdown="startDrag"')
|
||||
expect(floatingAdd).toContain("if (!event.isPrimary || (event.pointerType === 'mouse' && event.button !== 0)) return")
|
||||
expect(floatingAdd).toContain('@pointermove="moveDrag"')
|
||||
expect(floatingAdd).toContain("position.value = snapFabPosition(")
|
||||
expect(floatingAdd).toContain('snapFabToCurrentViewport')
|
||||
@@ -1046,13 +1047,19 @@ describe('unified floating add interaction', () => {
|
||||
expect(css).toContain('@media(max-width:930px){.unified-fab{bottom:calc(82px + env(safe-area-inset-bottom))}')
|
||||
})
|
||||
|
||||
it('keeps the shared FAB visually simple', () => {
|
||||
expect(floatingAdd).not.toContain('unified-fab-aura')
|
||||
expect(floatingAdd).not.toContain('unified-fab-core')
|
||||
expect(css).not.toContain('.unified-fab:before')
|
||||
expect(css).not.toContain('@keyframes fab-aura')
|
||||
expect(css).not.toContain('@keyframes fab-pulse')
|
||||
expect(css).toMatch(/\.unified-fab\{[^}]*background:var\(--accent\)/)
|
||||
it('renders a sleeping cream-orange cat that wakes while dragging and faces inward at an edge', () => {
|
||||
expect(floatingAdd).toContain('class="fab-cat"')
|
||||
expect(floatingAdd).toContain('class="fab-cat-eye fab-cat-eye--sleeping"')
|
||||
expect(floatingAdd).toContain('class="fab-cat-eye fab-cat-eye--awake"')
|
||||
expect(floatingAdd).toContain("const edge = ref<'left' | 'right'>('right')")
|
||||
expect(floatingAdd).toContain("'edge-left': edge === 'left'")
|
||||
expect(floatingAdd).toContain(':class="{ dragging, snapping, awake: dragging, sleeping: !dragging')
|
||||
expect(css).toContain('.unified-fab .fab-cat{')
|
||||
expect(css).toContain('.unified-fab.sleeping .fab-cat-body{transform-origin:29px 40px;animation:fab-cat-breathe')
|
||||
expect(css).toContain('.unified-fab.awake .fab-cat-eye--awake{opacity:1}')
|
||||
expect(css).toContain('.unified-fab.edge-left .fab-cat{transform:scaleX(-1)}')
|
||||
expect(css).toContain('@keyframes fab-cat-breathe')
|
||||
expect(css).toContain('@media(prefers-reduced-motion:reduce){.unified-fab.sleeping .fab-cat-body{animation:none}')
|
||||
})
|
||||
|
||||
it('keeps the countdown close button but removes its orange circular background', () => {
|
||||
|
||||
Reference in New Issue
Block a user