Build touch/mouse joystick component that tracks drag position as [0,1] coordinates. Implements: - Input store (src/stores/input-store.ts) with joyX/joyY signals - Joystick component (src/components/input/Joystick.tsx) with canvas rendering, pointer events, and follow mode toggle - Input clamping for out-of-range values (NaN, Infinity, negative, >1) - Follow mode badge with pulse animation - 12 e2e tests covering VAL-JOY-001, VAL-JOY-002, VAL-JOY-005 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
49 lines
1.1 KiB
CSS
49 lines
1.1 KiB
CSS
/**
|
|
* Joystick component styles.
|
|
* Glass morphism design system with positioning for bottom-left placement.
|
|
*/
|
|
|
|
.joystick-container {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
left: 20px;
|
|
z-index: 100;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 4px;
|
|
}
|
|
|
|
.joystick-container canvas {
|
|
touch-action: none;
|
|
border-radius: 50%;
|
|
cursor: crosshair;
|
|
background: var(--glass-bg, rgba(10, 10, 20, 0.65));
|
|
border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
|
|
}
|
|
|
|
.joystick-container canvas:active {
|
|
cursor: grabbing;
|
|
}
|
|
|
|
/* Follow badge */
|
|
.follow-badge {
|
|
position: absolute;
|
|
top: -6px;
|
|
right: -6px;
|
|
background: #cc5500;
|
|
color: #fff;
|
|
font-size: 8px;
|
|
font-family: var(--font-mono, monospace);
|
|
font-weight: bold;
|
|
padding: 2px 6px;
|
|
border-radius: 8px;
|
|
letter-spacing: 0.05em;
|
|
animation: follow-pulse 1.5s ease-in-out infinite;
|
|
}
|
|
|
|
/* Follow pulse animation */
|
|
@keyframes follow-pulse {
|
|
0%, 100% { opacity: 1; box-shadow: 0 0 4px rgba(204, 85, 0, 0.4); }
|
|
50% { opacity: 0.7; box-shadow: 0 0 12px rgba(204, 85, 0, 0.8); }
|
|
}
|