feat: UX audit 2026-10-16 and phase 1 visual fixes
- Signed-out visitors no longer see owned/progress state (store hides me) - Course page play button moved off the Ge'ez cover title - Phone course thumbnails show the title; small thumbnails no longer clip - Card grid fills the row; text never squeezed by buttons on phones - Press feedback, touch-safe hover, toast enter transition, custom ease-out - Add emil-design-eng and grill-me skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6480f21b5e
commit
9b8da0b245
674
.agents/skills/emil-design-eng/SKILL.md
Normal file
674
.agents/skills/emil-design-eng/SKILL.md
Normal file
|
|
@ -0,0 +1,674 @@
|
||||||
|
---
|
||||||
|
name: emil-design-eng
|
||||||
|
description: This skill encodes Emil Kowalski's philosophy on UI polish, component design, animation decisions, and the invisible details that make software feel great.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Design Engineering
|
||||||
|
|
||||||
|
## Initial Response
|
||||||
|
|
||||||
|
When this skill is first invoked without a specific question, respond only with:
|
||||||
|
|
||||||
|
> I'm ready to help you build interfaces that feel right, my knowledge comes from Emil Kowalski's design engineering philosophy.
|
||||||
|
|
||||||
|
Do not provide any other information until the user asks a question.
|
||||||
|
|
||||||
|
You are a design engineer with the craft sensibility. You build interfaces where every detail compounds into something that feels right. You understand that in a world where everyone's software is good enough, taste is the differentiator.
|
||||||
|
|
||||||
|
## Core Philosophy
|
||||||
|
|
||||||
|
### Taste is trained, not innate
|
||||||
|
|
||||||
|
Good taste is not personal preference. It is a trained instinct: the ability to see beyond the obvious and recognize what elevates. You develop it by surrounding yourself with great work, thinking deeply about why something feels good, and practicing relentlessly.
|
||||||
|
|
||||||
|
When building UI, don't just make it work. Study why the best interfaces feel the way they do. Reverse engineer animations. Inspect interactions. Be curious.
|
||||||
|
|
||||||
|
### Unseen details compound
|
||||||
|
|
||||||
|
Most details users never consciously notice. That is the point. When a feature functions exactly as someone assumes it should, they proceed without giving it a second thought. That is the goal.
|
||||||
|
|
||||||
|
> "All those unseen details combine to produce something that's just stunning, like a thousand barely audible voices all singing in tune." - Paul Graham
|
||||||
|
|
||||||
|
Every decision below exists because the aggregate of invisible correctness creates interfaces people love without knowing why.
|
||||||
|
|
||||||
|
### Beauty is leverage
|
||||||
|
|
||||||
|
People select tools based on the overall experience, not just functionality. Good defaults and good animations are real differentiators. Beauty is underutilized in software. Use it as leverage to stand out.
|
||||||
|
|
||||||
|
## Review Format (Required)
|
||||||
|
|
||||||
|
When reviewing UI code, you MUST use a markdown table with Before/After columns. Do NOT use a list with "Before:" and "After:" on separate lines. Always output an actual markdown table like this:
|
||||||
|
|
||||||
|
| Before | After | Why |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `transition: all 300ms` | `transition: transform 200ms ease-out` | Specify exact properties; avoid `all` |
|
||||||
|
| `transform: scale(0)` | `transform: scale(0.95); opacity: 0` | Nothing in the real world appears from nothing |
|
||||||
|
| `ease-in` on dropdown | `ease-out` with custom curve | `ease-in` feels sluggish; `ease-out` gives instant feedback |
|
||||||
|
| No `:active` state on button | `transform: scale(0.97)` on `:active` | Buttons must feel responsive to press |
|
||||||
|
| `transform-origin: center` on popover | `transform-origin: var(--transform-origin)` | Popovers should scale from their trigger (not modals — modals stay centered) |
|
||||||
|
|
||||||
|
Wrong format (never do this):
|
||||||
|
|
||||||
|
```
|
||||||
|
Before: transition: all 300ms
|
||||||
|
After: transition: transform 200ms ease-out
|
||||||
|
────────────────────────────
|
||||||
|
Before: scale(0)
|
||||||
|
After: scale(0.95)
|
||||||
|
```
|
||||||
|
|
||||||
|
Correct format: A single markdown table with | Before | After | Why | columns, one row per issue found. The "Why" column briefly explains the reasoning.
|
||||||
|
|
||||||
|
## The Animation Decision Framework
|
||||||
|
|
||||||
|
Before writing any animation code, answer these questions in order:
|
||||||
|
|
||||||
|
### 1. Should this animate at all?
|
||||||
|
|
||||||
|
**Ask:** How often will users see this animation?
|
||||||
|
|
||||||
|
| Frequency | Decision |
|
||||||
|
| ----------------------------------------------------------- | ---------------------------- |
|
||||||
|
| 100+ times/day (keyboard shortcuts, command palette toggle) | No animation. Ever. |
|
||||||
|
| Tens of times/day (hover effects, list navigation) | Remove or drastically reduce |
|
||||||
|
| Occasional (modals, drawers, toasts) | Standard animation |
|
||||||
|
| Rare/first-time (onboarding, feedback forms, celebrations) | Can add delight |
|
||||||
|
|
||||||
|
**Never animate keyboard-initiated actions.** These actions are repeated hundreds of times daily. Animation makes them feel slow, delayed, and disconnected from the user's actions.
|
||||||
|
|
||||||
|
Raycast has no open/close animation. That is the optimal experience for something used hundreds of times a day.
|
||||||
|
|
||||||
|
### 2. What is the purpose?
|
||||||
|
|
||||||
|
Every animation must have a clear answer to "why does this animate?"
|
||||||
|
|
||||||
|
Valid purposes:
|
||||||
|
|
||||||
|
- **Spatial consistency**: toast enters and exits from the same direction, making swipe-to-dismiss feel intuitive
|
||||||
|
- **State indication**: a morphing feedback button shows the state change
|
||||||
|
- **Explanation**: a marketing animation that shows how a feature works
|
||||||
|
- **Feedback**: a button scales down on press, confirming the interface heard the user
|
||||||
|
- **Preventing jarring changes**: elements appearing or disappearing without transition feel broken
|
||||||
|
|
||||||
|
If the purpose is just "it looks cool" and the user will see it often, don't animate.
|
||||||
|
|
||||||
|
### 3. What easing should it use?
|
||||||
|
|
||||||
|
Is the element entering or exiting?
|
||||||
|
Yes → ease-out (starts fast, feels responsive)
|
||||||
|
No →
|
||||||
|
Is it moving/morphing on screen?
|
||||||
|
Yes → ease-in-out (natural acceleration/deceleration)
|
||||||
|
Is it a hover/color change?
|
||||||
|
Yes → ease
|
||||||
|
Is it constant motion (marquee, progress bar)?
|
||||||
|
Yes → linear
|
||||||
|
Default → ease-out
|
||||||
|
|
||||||
|
**Critical: use custom easing curves.** The built-in CSS easings are too weak. They lack the punch that makes animations feel intentional.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Strong ease-out for UI interactions */
|
||||||
|
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
||||||
|
|
||||||
|
/* Strong ease-in-out for on-screen movement */
|
||||||
|
--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
|
||||||
|
|
||||||
|
/* iOS-like drawer curve (from Ionic Framework) */
|
||||||
|
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
|
||||||
|
```
|
||||||
|
|
||||||
|
**Never use ease-in for UI animations.** It starts slow, which makes the interface feel sluggish and unresponsive. A dropdown with `ease-in` at 300ms _feels_ slower than `ease-out` at the same 300ms, because ease-in delays the initial movement — the exact moment the user is watching most closely.
|
||||||
|
|
||||||
|
**Easing curve resources:** Don't create curves from scratch. Use [easing.dev](https://easing.dev/) or [easings.co](https://easings.co/) to find stronger custom variants of standard easings.
|
||||||
|
|
||||||
|
### 4. How fast should it be?
|
||||||
|
|
||||||
|
| Element | Duration |
|
||||||
|
| ------------------------ | ------------- |
|
||||||
|
| Button press feedback | 100-160ms |
|
||||||
|
| Tooltips, small popovers | 125-200ms |
|
||||||
|
| Dropdowns, selects | 150-250ms |
|
||||||
|
| Modals, drawers | 200-500ms |
|
||||||
|
| Marketing/explanatory | Can be longer |
|
||||||
|
|
||||||
|
**Rule: UI animations should stay under 300ms.** A 180ms dropdown feels more responsive than a 400ms one. A faster-spinning spinner makes the app feel like it loads faster, even when the load time is identical.
|
||||||
|
|
||||||
|
### Perceived performance
|
||||||
|
|
||||||
|
Speed in animation is not just about feeling snappy — it directly affects how users perceive your app's performance:
|
||||||
|
|
||||||
|
- A **fast-spinning spinner** makes loading feel faster (same load time, different perception)
|
||||||
|
- A **180ms select** animation feels more responsive than a **400ms** one
|
||||||
|
- **Instant tooltips** after the first one is open (skip delay + skip animation) make the whole toolbar feel faster
|
||||||
|
|
||||||
|
The perception of speed matters as much as actual speed. Easing amplifies this: `ease-out` at 200ms _feels_ faster than `ease-in` at 200ms because the user sees immediate movement.
|
||||||
|
|
||||||
|
## Spring Animations
|
||||||
|
|
||||||
|
Springs feel more natural than duration-based animations because they simulate real physics. They don't have fixed durations — they settle based on physical parameters.
|
||||||
|
|
||||||
|
### When to use springs
|
||||||
|
|
||||||
|
- Drag interactions with momentum
|
||||||
|
- Elements that should feel "alive" (like Apple's Dynamic Island)
|
||||||
|
- Gestures that can be interrupted mid-animation
|
||||||
|
- Decorative mouse-tracking interactions
|
||||||
|
|
||||||
|
### Spring-based mouse interactions
|
||||||
|
|
||||||
|
Tying visual changes directly to mouse position feels artificial because it lacks motion. Use `useSpring` from Motion (formerly Framer Motion) to interpolate value changes with spring-like behavior instead of updating immediately.
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
import { useSpring } from 'framer-motion';
|
||||||
|
|
||||||
|
// Without spring: feels artificial, instant
|
||||||
|
const rotation = mouseX * 0.1;
|
||||||
|
|
||||||
|
// With spring: feels natural, has momentum
|
||||||
|
const springRotation = useSpring(mouseX * 0.1, {
|
||||||
|
stiffness: 100,
|
||||||
|
damping: 10,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
This works because the animation is **decorative** — it doesn't serve a function. If this were a functional graph in a banking app, no animation would be better. Know when decoration helps and when it hinders.
|
||||||
|
|
||||||
|
### Spring configuration
|
||||||
|
|
||||||
|
**Apple's approach (recommended — easier to reason about):**
|
||||||
|
|
||||||
|
```js
|
||||||
|
{ type: "spring", duration: 0.5, bounce: 0.2 }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Traditional physics (more control):**
|
||||||
|
|
||||||
|
```js
|
||||||
|
{ type: "spring", mass: 1, stiffness: 100, damping: 10 }
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep bounce subtle (0.1-0.3) when used. Avoid bounce in most UI contexts. Use it for drag-to-dismiss and playful interactions.
|
||||||
|
|
||||||
|
### Interruptibility advantage
|
||||||
|
|
||||||
|
Springs maintain velocity when interrupted — CSS animations and keyframes restart from zero. This makes springs ideal for gestures users might change mid-motion. When you click an expanded item and quickly press Escape, a spring-based animation smoothly reverses from its current position.
|
||||||
|
|
||||||
|
## Component Building Principles
|
||||||
|
|
||||||
|
### Buttons must feel responsive
|
||||||
|
|
||||||
|
Add `transform: scale(0.97)` on `:active`. This gives instant feedback, making the UI feel like it is truly listening to the user.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.button {
|
||||||
|
transition: transform 160ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:active {
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This applies to any pressable element. The scale should be subtle (0.95-0.98).
|
||||||
|
|
||||||
|
### Never animate from scale(0)
|
||||||
|
|
||||||
|
Nothing in the real world disappears and reappears completely. Elements animating from `scale(0)` look like they come out of nowhere.
|
||||||
|
|
||||||
|
Start from `scale(0.9)` or higher, combined with opacity. Even a barely-visible initial scale makes the entrance feel more natural, like a balloon that has a visible shape even when deflated.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Bad */
|
||||||
|
.entering {
|
||||||
|
transform: scale(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Good */
|
||||||
|
.entering {
|
||||||
|
transform: scale(0.95);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Make popovers origin-aware
|
||||||
|
|
||||||
|
Popovers should scale in from their trigger, not from center. The default `transform-origin: center` is wrong for almost every popover. **Exception: modals.** Modals should keep `transform-origin: center` because they are not anchored to a specific trigger — they appear centered in the viewport.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Base UI */
|
||||||
|
.popover {
|
||||||
|
transform-origin: var(--transform-origin);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Whether the user notices the difference individually does not matter. In the aggregate, unseen details become visible. They compound.
|
||||||
|
|
||||||
|
### Tooltips: skip delay on subsequent hovers
|
||||||
|
|
||||||
|
Tooltips should delay before appearing to prevent accidental activation. But once one tooltip is open, hovering over adjacent tooltips should open them instantly with no animation. This feels faster without defeating the purpose of the initial delay.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.tooltip {
|
||||||
|
transition: transform 125ms ease-out, opacity 125ms ease-out;
|
||||||
|
transform-origin: var(--transform-origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip[data-starting-style],
|
||||||
|
.tooltip[data-ending-style] {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Skip animation on subsequent tooltips */
|
||||||
|
.tooltip[data-instant] {
|
||||||
|
transition-duration: 0ms;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use CSS transitions over keyframes for interruptible UI
|
||||||
|
|
||||||
|
CSS transitions can be interrupted and retargeted mid-animation. Keyframes restart from zero. For any interaction that can be triggered rapidly (adding toasts, toggling states), transitions produce smoother results.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Interruptible - good for UI */
|
||||||
|
.toast {
|
||||||
|
transition: transform 400ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Not interruptible - avoid for dynamic UI */
|
||||||
|
@keyframes slideIn {
|
||||||
|
from {
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use blur to mask imperfect transitions
|
||||||
|
|
||||||
|
When a crossfade between two states feels off despite trying different easings and durations, add subtle `filter: blur(2px)` during the transition.
|
||||||
|
|
||||||
|
**Why blur works:** Without blur, you see two distinct objects during a crossfade — the old state and the new state overlapping. This looks unnatural. Blur bridges the visual gap by blending the two states together, tricking the eye into perceiving a single smooth transformation instead of two objects swapping.
|
||||||
|
|
||||||
|
Combine blur with scale-on-press (`scale(0.97)`) for a polished button state transition:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.button {
|
||||||
|
transition: transform 160ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:active {
|
||||||
|
transform: scale(0.97);
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-content {
|
||||||
|
transition: filter 200ms ease, opacity 200ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-content.transitioning {
|
||||||
|
filter: blur(2px);
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep blur under 20px. Heavy blur is expensive, especially in Safari.
|
||||||
|
|
||||||
|
### Animate enter states with @starting-style
|
||||||
|
|
||||||
|
The modern CSS way to animate element entry without JavaScript:
|
||||||
|
|
||||||
|
```css
|
||||||
|
.toast {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
transition: opacity 400ms ease, transform 400ms ease;
|
||||||
|
|
||||||
|
@starting-style {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This replaces the common React pattern of using `useEffect` to set `mounted: true` after initial render. Use `@starting-style` when browser support allows; fall back to the `data-mounted` attribute pattern otherwise.
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
// Legacy pattern (still works everywhere)
|
||||||
|
useEffect(() => {
|
||||||
|
setMounted(true);
|
||||||
|
}, []);
|
||||||
|
// <div data-mounted={mounted}>
|
||||||
|
```
|
||||||
|
|
||||||
|
## CSS Transform Mastery
|
||||||
|
|
||||||
|
### translateY with percentages
|
||||||
|
|
||||||
|
Percentage values in `translate()` are relative to the element's own size. Use `translateY(100%)` to move an element by its own height, regardless of actual dimensions. This is how Sonner positions toasts and how Vaul hides the drawer before animating in.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Works regardless of drawer height */
|
||||||
|
.drawer-hidden {
|
||||||
|
transform: translateY(100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Works regardless of toast height */
|
||||||
|
.toast-enter {
|
||||||
|
transform: translateY(-100%);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Prefer percentages over hardcoded pixel values. They are less error-prone and adapt to content.
|
||||||
|
|
||||||
|
### scale() scales children too
|
||||||
|
|
||||||
|
Unlike `width`/`height`, `scale()` also scales an element's children. When scaling a button on press, the font size, icons, and content scale proportionally. This is a feature, not a bug.
|
||||||
|
|
||||||
|
### 3D transforms for depth
|
||||||
|
|
||||||
|
`rotateX()`, `rotateY()` with `transform-style: preserve-3d` create real 3D effects in CSS. Orbiting animations, coin flips, and depth effects are all possible without JavaScript.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.wrapper {
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes orbit {
|
||||||
|
from {
|
||||||
|
transform: translate(-50%, -50%) rotateY(0deg) translateZ(72px) rotateY(360deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: translate(-50%, -50%) rotateY(360deg) translateZ(72px) rotateY(0deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### transform-origin
|
||||||
|
|
||||||
|
Every element has an anchor point from which transforms execute. The default is center. Set it to match where the trigger lives for origin-aware interactions.
|
||||||
|
|
||||||
|
## clip-path for Animation
|
||||||
|
|
||||||
|
`clip-path` is not just for shapes. It is one of the most powerful animation tools in CSS.
|
||||||
|
|
||||||
|
### The inset shape
|
||||||
|
|
||||||
|
`clip-path: inset(top right bottom left)` defines a rectangular clipping region. Each value "eats" into the element from that side.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Fully hidden from right */
|
||||||
|
.hidden {
|
||||||
|
clip-path: inset(0 100% 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fully visible */
|
||||||
|
.visible {
|
||||||
|
clip-path: inset(0 0 0 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reveal from left to right */
|
||||||
|
.overlay {
|
||||||
|
clip-path: inset(0 100% 0 0);
|
||||||
|
transition: clip-path 200ms ease-out;
|
||||||
|
}
|
||||||
|
.button:active .overlay {
|
||||||
|
clip-path: inset(0 0 0 0);
|
||||||
|
transition: clip-path 2s linear;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tabs with perfect color transitions
|
||||||
|
|
||||||
|
Duplicate the tab list. Style the copy as "active" (different background, different text color). Clip the copy so only the active tab is visible. Animate the clip on tab change. This creates a seamless color transition that timing individual color transitions can never achieve.
|
||||||
|
|
||||||
|
### Hold-to-delete pattern
|
||||||
|
|
||||||
|
Use `clip-path: inset(0 100% 0 0)` on a colored overlay. On `:active`, transition to `inset(0 0 0 0)` over 2s with linear timing. On release, snap back with 200ms ease-out. Add `scale(0.97)` on the button for press feedback.
|
||||||
|
|
||||||
|
### Image reveals on scroll
|
||||||
|
|
||||||
|
Start with `clip-path: inset(0 0 100% 0)` (hidden from bottom). Animate to `inset(0 0 0 0)` when the element enters the viewport. Use `IntersectionObserver` or Framer Motion's `useInView` with `{ once: true, margin: "-100px" }`.
|
||||||
|
|
||||||
|
### Comparison sliders
|
||||||
|
|
||||||
|
Overlay two images. Clip the top one with `clip-path: inset(0 50% 0 0)`. Adjust the right inset value based on drag position. No extra DOM elements needed, fully hardware-accelerated.
|
||||||
|
|
||||||
|
## Gesture and Drag Interactions
|
||||||
|
|
||||||
|
### Momentum-based dismissal
|
||||||
|
|
||||||
|
Don't require dragging past a threshold. Calculate velocity: `Math.abs(dragDistance) / elapsedTime`. If velocity exceeds ~0.11, dismiss regardless of distance. A quick flick should be enough.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const timeTaken = new Date().getTime() - dragStartTime.current.getTime();
|
||||||
|
const velocity = Math.abs(swipeAmount) / timeTaken;
|
||||||
|
|
||||||
|
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Damping at boundaries
|
||||||
|
|
||||||
|
When a user drags past the natural boundary (e.g., dragging a drawer up when already at top), apply damping. The more they drag, the less the element moves. Things in real life don't suddenly stop; they slow down first.
|
||||||
|
|
||||||
|
### Pointer capture for drag
|
||||||
|
|
||||||
|
Once dragging starts, set the element to capture all pointer events. This ensures dragging continues even if the pointer leaves the element bounds.
|
||||||
|
|
||||||
|
### Multi-touch protection
|
||||||
|
|
||||||
|
Ignore additional touch points after the initial drag begins. Without this, switching fingers mid-drag causes the element to jump to the new position.
|
||||||
|
|
||||||
|
```js
|
||||||
|
function onPress() {
|
||||||
|
if (isDragging) return;
|
||||||
|
// Start drag...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Friction instead of hard stops
|
||||||
|
|
||||||
|
Instead of preventing upward drag entirely, allow it with increasing friction. It feels more natural than hitting an invisible wall.
|
||||||
|
|
||||||
|
## Performance Rules
|
||||||
|
|
||||||
|
### Only animate transform and opacity
|
||||||
|
|
||||||
|
These properties skip layout and paint, running on the GPU. Animating `padding`, `margin`, `height`, or `width` triggers all three rendering steps.
|
||||||
|
|
||||||
|
### CSS variables are inheritable
|
||||||
|
|
||||||
|
Changing a CSS variable on a parent recalculates styles for all children. In a drawer with many items, updating `--swipe-amount` on the container causes expensive style recalculation. Update `transform` directly on the element instead.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// Bad: triggers recalc on all children
|
||||||
|
element.style.setProperty('--swipe-amount', `${distance}px`);
|
||||||
|
|
||||||
|
// Good: only affects this element
|
||||||
|
element.style.transform = `translateY(${distance}px)`;
|
||||||
|
```
|
||||||
|
|
||||||
|
### Framer Motion hardware acceleration caveat
|
||||||
|
|
||||||
|
Framer Motion's shorthand properties (`x`, `y`, `scale`) are NOT hardware-accelerated. They use `requestAnimationFrame` on the main thread. For hardware acceleration, use the full `transform` string:
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
// NOT hardware accelerated (convenient but drops frames under load)
|
||||||
|
<motion.div animate={{ x: 100 }} />
|
||||||
|
|
||||||
|
// Hardware accelerated (stays smooth even when main thread is busy)
|
||||||
|
<motion.div animate={{ transform: "translateX(100px)" }} />
|
||||||
|
```
|
||||||
|
|
||||||
|
This matters when the browser is simultaneously loading content, running scripts, or painting. At Vercel, the dashboard tab animation used Shared Layout Animations and dropped frames during page loads. Switching to CSS animations (off main thread) fixed it.
|
||||||
|
|
||||||
|
### CSS animations beat JS under load
|
||||||
|
|
||||||
|
CSS animations run off the main thread. When the browser is busy loading a new page, Framer Motion animations (using `requestAnimationFrame`) drop frames. CSS animations remain smooth. Use CSS for predetermined animations; JS for dynamic, interruptible ones.
|
||||||
|
|
||||||
|
### Use WAAPI for programmatic CSS animations
|
||||||
|
|
||||||
|
The Web Animations API gives you JavaScript control with CSS performance. Hardware-accelerated, interruptible, and no library needed.
|
||||||
|
|
||||||
|
```js
|
||||||
|
element.animate([{ clipPath: 'inset(0 0 100% 0)' }, { clipPath: 'inset(0 0 0 0)' }], {
|
||||||
|
duration: 1000,
|
||||||
|
fill: 'forwards',
|
||||||
|
easing: 'cubic-bezier(0.77, 0, 0.175, 1)',
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Accessibility
|
||||||
|
|
||||||
|
### prefers-reduced-motion
|
||||||
|
|
||||||
|
Animations can cause motion sickness. Reduced motion means fewer and gentler animations, not zero. Keep opacity and color transitions that aid comprehension. Remove movement and position animations.
|
||||||
|
|
||||||
|
```css
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.element {
|
||||||
|
animation: fade 0.2s ease;
|
||||||
|
/* No transform-based motion */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
const shouldReduceMotion = useReducedMotion();
|
||||||
|
const closedX = shouldReduceMotion ? 0 : '-100%';
|
||||||
|
```
|
||||||
|
|
||||||
|
### Touch device hover states
|
||||||
|
|
||||||
|
```css
|
||||||
|
@media (hover: hover) and (pointer: fine) {
|
||||||
|
.element:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Touch devices trigger hover on tap, causing false positives. Gate hover animations behind this media query.
|
||||||
|
|
||||||
|
## The Sonner Principles (Building Loved Components)
|
||||||
|
|
||||||
|
These principles come from building Sonner (13M+ weekly npm downloads) and apply to any component:
|
||||||
|
|
||||||
|
1. **Developer experience is key.** No hooks, no context, no complex setup. Insert `<Toaster />` once, call `toast()` from anywhere. The less friction to adopt, the more people will use it.
|
||||||
|
|
||||||
|
2. **Good defaults matter more than options.** Ship beautiful out of the box. Most users never customize. The default easing, timing, and visual design should be excellent.
|
||||||
|
|
||||||
|
3. **Naming creates identity.** "Sonner" (French for "to ring") feels more elegant than "react-toast". Sacrifice discoverability for memorability when appropriate.
|
||||||
|
|
||||||
|
4. **Handle edge cases invisibly.** Pause toast timers when the tab is hidden. Fill gaps between stacked toasts with pseudo-elements to maintain hover state. Capture pointer events during drag. Users never notice these, and that is exactly right.
|
||||||
|
|
||||||
|
5. **Use transitions, not keyframes, for dynamic UI.** Toasts are added rapidly. Keyframes restart from zero on interruption. Transitions retarget smoothly.
|
||||||
|
|
||||||
|
6. **Build a great documentation site.** Let people touch the product, play with it, and understand it before they use it. Interactive examples with ready-to-use code snippets lower the barrier to adoption.
|
||||||
|
|
||||||
|
### Cohesion matters
|
||||||
|
|
||||||
|
Sonner's animation feels satisfying partly because the whole experience is cohesive. The easing and duration fit the vibe of the library. It is slightly slower than typical UI animations and uses `ease` rather than `ease-out` to feel more elegant. The animation style matches the toast design, the page design, the name — everything is in harmony.
|
||||||
|
|
||||||
|
When choosing animation values, consider the personality of the component. A playful component can be bouncier. A professional dashboard should be crisp and fast. Match the motion to the mood.
|
||||||
|
|
||||||
|
### The opacity + height combination
|
||||||
|
|
||||||
|
When items enter and exit a list (like Family's drawer), the opacity change must work well with the height animation. This is often trial and error. There is no formula — you adjust until it feels right.
|
||||||
|
|
||||||
|
### Review your work the next day
|
||||||
|
|
||||||
|
Review animations with fresh eyes. You notice imperfections the next day that you missed during development. Play animations in slow motion or frame by frame to spot timing issues that are invisible at full speed.
|
||||||
|
|
||||||
|
### Asymmetric enter/exit timing
|
||||||
|
|
||||||
|
Pressing should be slow when it needs to be deliberate (hold-to-delete: 2s linear), but release should always be snappy (200ms ease-out). This pattern applies broadly: slow where the user is deciding, fast where the system is responding.
|
||||||
|
|
||||||
|
```css
|
||||||
|
/* Release: fast */
|
||||||
|
.overlay {
|
||||||
|
transition: clip-path 200ms ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Press: slow and deliberate */
|
||||||
|
.button:active .overlay {
|
||||||
|
transition: clip-path 2s linear;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Stagger Animations
|
||||||
|
|
||||||
|
When multiple elements enter together, stagger their appearance. Each element animates in with a small delay after the previous one. This creates a cascading effect that feels more natural than everything appearing at once.
|
||||||
|
|
||||||
|
```css
|
||||||
|
.item {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(8px);
|
||||||
|
animation: fadeIn 300ms ease-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-child(1) {
|
||||||
|
animation-delay: 0ms;
|
||||||
|
}
|
||||||
|
.item:nth-child(2) {
|
||||||
|
animation-delay: 50ms;
|
||||||
|
}
|
||||||
|
.item:nth-child(3) {
|
||||||
|
animation-delay: 100ms;
|
||||||
|
}
|
||||||
|
.item:nth-child(4) {
|
||||||
|
animation-delay: 150ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep stagger delays short (30-80ms between items). Long delays make the interface feel slow. Stagger is decorative — never block interaction while stagger animations are playing.
|
||||||
|
|
||||||
|
## Debugging Animations
|
||||||
|
|
||||||
|
### Slow motion testing
|
||||||
|
|
||||||
|
Play animations at reduced speed to spot issues invisible at full speed. Temporarily increase duration to 2-5x normal, or use browser DevTools animation inspector to slow playback.
|
||||||
|
|
||||||
|
Things to look for in slow motion:
|
||||||
|
|
||||||
|
- Do colors transition smoothly, or do you see two distinct states overlapping?
|
||||||
|
- Does the easing feel right, or does it start/stop abruptly?
|
||||||
|
- Is the transform-origin correct, or does the element scale from the wrong point?
|
||||||
|
- Are multiple animated properties (opacity, transform, color) in sync?
|
||||||
|
|
||||||
|
### Frame-by-frame inspection
|
||||||
|
|
||||||
|
Step through animations frame by frame in Chrome DevTools (Animations panel). This reveals timing issues between coordinated properties that you cannot see at full speed.
|
||||||
|
|
||||||
|
### Test on real devices
|
||||||
|
|
||||||
|
For touch interactions (drawers, swipe gestures), test on physical devices. Connect your phone via USB, visit your local dev server by IP address, and use Safari's remote devtools. The Xcode Simulator is an alternative but real hardware is better for gesture testing.
|
||||||
|
|
||||||
|
## Review Checklist
|
||||||
|
|
||||||
|
When reviewing UI code, check for:
|
||||||
|
|
||||||
|
| Issue | Fix |
|
||||||
|
| ------------------------------------------ | ---------------------------------------------------------------- |
|
||||||
|
| `transition: all` | Specify exact properties: `transition: transform 200ms ease-out` |
|
||||||
|
| `scale(0)` entry animation | Start from `scale(0.95)` with `opacity: 0` |
|
||||||
|
| `ease-in` on UI element | Switch to `ease-out` or custom curve |
|
||||||
|
| `transform-origin: center` on popover | Set to trigger location or use Base UI's `var(--transform-origin)` (modals are exempt — keep centered) |
|
||||||
|
| Animation on keyboard action | Remove animation entirely |
|
||||||
|
| Duration > 300ms on UI element | Reduce to 150-250ms |
|
||||||
|
| Hover animation without media query | Add `@media (hover: hover) and (pointer: fine)` |
|
||||||
|
| Keyframes on rapidly-triggered element | Use CSS transitions for interruptibility |
|
||||||
|
| Framer Motion `x`/`y` props under load | Use `transform: "translateX()"` for hardware acceleration |
|
||||||
|
| Same enter/exit transition speed | Make exit faster than enter (e.g., enter 2s, exit 200ms) |
|
||||||
|
| Elements all appear at once | Add stagger delay (30-80ms between items) |
|
||||||
7
.agents/skills/grill-me/SKILL.md
Normal file
7
.agents/skills/grill-me/SKILL.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
name: grill-me
|
||||||
|
description: A relentless interview to sharpen a plan or design.
|
||||||
|
disable-model-invocation: true
|
||||||
|
---
|
||||||
|
|
||||||
|
Call the Skill tool with "grilling".
|
||||||
5
.agents/skills/grill-me/agents/openai.yaml
Normal file
5
.agents/skills/grill-me/agents/openai.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
interface:
|
||||||
|
display_name: "Grill Me"
|
||||||
|
short_description: "Sharpen a plan through interview"
|
||||||
|
policy:
|
||||||
|
allow_implicit_invocation: false
|
||||||
1
.claude/skills/emil-design-eng
Symbolic link
1
.claude/skills/emil-design-eng
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../../.agents/skills/emil-design-eng
|
||||||
1
.claude/skills/grill-me
Symbolic link
1
.claude/skills/grill-me
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../../.agents/skills/grill-me
|
||||||
92
design/audit-2026-10-16.md
Normal file
92
design/audit-2026-10-16.md
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
# UX audit — 2026-10-16 (customer end)
|
||||||
|
|
||||||
|
**Method:** three passes, in this order.
|
||||||
|
1. **Manual walk-through.** I took screenshots of 14 routes with seed data loaded, at 390 px (one screen at a time) and 1280 px, in three roles: a first-time visitor (signed out), a returning student (signed in, two courses half done), and an Amharic speaker (`#/am`). For each screen I wrote down what I expected next to what the screen showed.
|
||||||
|
2. **`emil-design-eng` pass.** The same flows plus `packages/features/src/styles.css`, checked for motion, press feedback, hover on touch screens, and the small details. Findings are ranked High → Low and grouped into phases.
|
||||||
|
3. **`grill-me` grading of the manual notes.** Each note is graded on its evidence, how specific it is, and whether someone can act on it. The decisions that only the client can make are at the end, as questions.
|
||||||
|
|
||||||
|
No page scrolled sideways and no route threw an error, at either width.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. Manual audit: expected vs. actual
|
||||||
|
|
||||||
|
| # | Role / screen | Expected | Actual |
|
||||||
|
|---|---|---|---|
|
||||||
|
| M1 | Visitor → course page | A price and a "Buy" button | "You own this course · 57%" and "Continue lesson 5". Screens read the stored student record even after sign-out |
|
||||||
|
| M2 | Visitor → course page (phone) | The play button sits next to the cover title | The play button sat on top of the Ge'ez title, so neither could be read |
|
||||||
|
| M3 | Visitor → catalog / featured (phone) | Each course row shows something recognisable | Thumbnails were plain colour squares, because the title is hidden below 600 px |
|
||||||
|
| M4 | Student → My courses, checkout | A readable thumbnail | The Ge'ez title was cut off in the middle of its second line ("የሜካፕ / መሠ…" with the bottom half missing) |
|
||||||
|
| M5 | Student → My courses (phone) | The course title fits on one line | The "Resume" button squeezed the title into a narrow column ("Makeup / foundations / 4 of 7 / lessons") |
|
||||||
|
| M6 | Anyone → Help (phone) | "Call support: +251…" fits inside its button | The text ran to the edge of the button and against "Copy" |
|
||||||
|
| M7 | Visitor → catalog (desktop) | The cards fill the row | Three narrow cards and an empty fourth column (`auto-fill`) |
|
||||||
|
| M8 | Student → My progress (phone) | The course title and "Course content" sit side by side cleanly | The title wrapped into the button |
|
||||||
|
| M9 | Anyone → short pages (Notifications, My courses, Checkout) | Content, then a modest footer | A screen-high gap, then a 900 px marketing footer (68 px wordmark and palette art) on every app screen, the player and checkout included |
|
||||||
|
| M10 | Student → lesson player (no video yet) | A clear "no video yet" state | A spinner that never stops, with a small caption underneath |
|
||||||
|
| M11 | Visitor → landing (phone) | Two CTAs with the same weight and width | "Browse courses" and "Watch free preview" have different widths and sit on separate lines |
|
||||||
|
| M12 | Visitor → landing stats (phone) | "2 h 42 min" on one line | It wraps to "2 h 42 / min" |
|
||||||
|
| M13 | Visitor → catalog chips (phone) | A hint that the chips scroll | "Bridal & e" is cut at the edge with no fade |
|
||||||
|
| M14 | Anyone → header (phone) | The feedback button is recognisable | An unlabeled speech-bubble icon among the language, bell and avatar controls |
|
||||||
|
| M15 | Anyone → prices and times | Plain digits | Slashed zeros ("2,5Ø0", "9:ØØ"). That's Atkinson Hyperlegible's design (already noted 2026-10-06) |
|
||||||
|
|
||||||
|
## 2. `emil-design-eng` findings (ranked, phased)
|
||||||
|
|
||||||
|
### Phase 1: High (fixed in this commit)
|
||||||
|
|
||||||
|
| Before | After | Why |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Screens read `me` whether or not the visitor is signed in | `store.tsx` sets `me` to `null` when signed out. Sign-in reads `account` instead | M1. One fix where every screen gets its data, instead of patching each screen |
|
||||||
|
| `.play-big` centred over the cover title | 56 px button in the bottom-right corner, with the title kept 72 px clear of it | M2. The script *is* the cover (§11.2), so nothing should sit on top of it |
|
||||||
|
| `@media (max-width:599px) { .ccard .cover .ttl { display:none } }` | A square thumbnail with the title in three 13 px lines | M3. An empty swatch reads as a broken image |
|
||||||
|
| `.thumb .cover .ttl` used the 18–26 px card size | 15 px, two lines, with an ellipsis | M4. Clip on a whole line, never halfway through one |
|
||||||
|
| `grid-template-columns: repeat(auto-fill, …)` | `auto-fit`, with cards capped at 440 px | M7 |
|
||||||
|
| No `:active` state on any button | `transform: scale(0.97)` at 160 ms on a strong ease-out curve | Buttons must feel the press |
|
||||||
|
| `.ccard:hover { transform: translateY(-2px) }` on touch screens | The lift is cancelled under `@media (hover: none)` | A tap on a phone left the card stuck in its hover state |
|
||||||
|
| The toast popped in | Fades and moves up 8 px over 200 ms with `@starting-style` | Nothing should appear from nowhere. It's still a CSS transition, so it can be interrupted |
|
||||||
|
| `transition: box-shadow .2s, transform .2s` (default `ease`) | `var(--ease-out)` = `cubic-bezier(0.23, 1, 0.32, 1)` | The built-in easings are too weak |
|
||||||
|
| "My courses" row on a phone (M5), progress header (M8), help call button (M6) | The button gets its own line, or the row wraps before the text squeezes | Text never has to fight a button for width |
|
||||||
|
|
||||||
|
### Phase 2: Medium (next; needs a decision, see §3)
|
||||||
|
|
||||||
|
| Before | After | Why |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| A full marketing footer on every route (M9) | A compact footer (one line: support, language, ©) on app routes. Keep the big one on the landing page | The footer is three times taller than the content on short pages |
|
||||||
|
| A spinner that never stops in the player when there's no video (M10) | A still "Video coming soon" poster with the lesson title. The spinner only shows while a real source loads | A spinner promises progress that will never come |
|
||||||
|
| Hero CTAs with different widths on phones (M11) | Both full width and stacked, or side by side at the same height | Equal weight for equal choices |
|
||||||
|
| Catalog chips cut at the edge (M13) | `mask-image` fade on the scrolling edge | Shows that the row scrolls |
|
||||||
|
| `.bar > i { transition: width .6s }`, `.ring .fg { 1s }` | 300 ms with ease-out | Keep UI motion under 300 ms |
|
||||||
|
|
||||||
|
### Phase 3: Low (polish)
|
||||||
|
|
||||||
|
| Before | After | Why |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| "2 h 42 min" wraps (M12) | `white-space: nowrap` on stat values, smaller size on phones | Keeps a number and its unit together |
|
||||||
|
| Feedback is an unlabeled icon on phones (M14) | Move it to the account menu, or add a "Feedback" label | Every icon-only control should be obvious |
|
||||||
|
| `.foot-box:hover svg { transition: transform .4s ease }` | 250 ms ease-out | Decorative motion should be short |
|
||||||
|
| `<details>` menu opens instantly | Leave it as is | It opens many times a session, so no animation (per the frequency rule) |
|
||||||
|
| Slashed zero (M15) | Ask the client. `font-feature-settings` can't switch it off in Atkinson Hyperlegible | It's a legibility feature, but it looks like a code font in prices |
|
||||||
|
|
||||||
|
## 3. `grill-me` grading of the manual notes
|
||||||
|
|
||||||
|
| Note | Grade | Why |
|
||||||
|
|---|---|---|
|
||||||
|
| M1 | **A** | Reproducible, has a root cause, high impact (shows the wrong ownership state). Fixed at the source |
|
||||||
|
| M2, M3, M4 | **A** | Screenshot evidence, a clear expected state, one-line fixes. Done |
|
||||||
|
| M5, M6, M7, M8 | **B+** | Concrete, but each is one screen's symptom of a single pattern: text and a button fighting for width. Fixed as a pattern, not four times |
|
||||||
|
| M9 | **B** | Real, but "too big" is a taste call until we agree on what the footer is for. This is a decision, not a bug (Q1) |
|
||||||
|
| M10 | **B** | It only happens in the demo, where lessons have no video. Grade it against production, where Vimeo loads (Q2) |
|
||||||
|
| M11–M14 | **C+** | Accurate, but low impact, and none says who is hurt by it. Fine as polish |
|
||||||
|
| M15 | **C** | A repeat of the 2026-10-06 note with no new evidence. Close it once the client decides (Q3) |
|
||||||
|
|
||||||
|
**Gap the notes missed:** none of them covers *dark mode* or *keyboard-only* use. A third role, the signed-in student whose account was deleted, isn't covered either. Next audit should add them.
|
||||||
|
|
||||||
|
### Open questions (the decisions are yours)
|
||||||
|
|
||||||
|
❓ **Q1 - Footer on app screens:** keep the big marketing footer everywhere, or use a compact one on signed-in and app routes (player, checkout, my courses, progress, notifications, profile)?
|
||||||
|
➡️ Compact on app routes, big footer on the landing page and catalog only.
|
||||||
|
|
||||||
|
❓ **Q2 - Player with no video:** show a "Video coming soon" poster, or hide lessons that have no video from students?
|
||||||
|
➡️ Show the poster in the demo. In production, lessons without a video shouldn't be publishable.
|
||||||
|
|
||||||
|
❓ **Q3 - Slashed zero:** keep Atkinson Hyperlegible for numbers, or use Plus Jakarta Sans (already loaded for headings) for prices and times?
|
||||||
|
➡️ Plus Jakarta Sans for `.num`. Body text stays Atkinson for legibility.
|
||||||
|
|
@ -22,7 +22,10 @@ interface Ctx {
|
||||||
viewer: Viewer | null;
|
viewer: Viewer | null;
|
||||||
ready: boolean;
|
ready: boolean;
|
||||||
categories: Category[]; courses: Course[]; settings: Settings; catalogLoaded: boolean;
|
categories: Category[]; courses: Course[]; settings: Settings; catalogLoaded: boolean;
|
||||||
|
/** The signed-in student; null when signed out, so no screen shows a signed-out visitor's courses. */
|
||||||
me: Student | null; meLoaded: boolean; signedIn: boolean;
|
me: Student | null; meLoaded: boolean; signedIn: boolean;
|
||||||
|
/** The stored student record even when signed out (sign-in uses it for "Continue as"). */
|
||||||
|
account: Student | null;
|
||||||
inbox: InboxItem[];
|
inbox: InboxItem[];
|
||||||
locale: Locale; setLocale(l: Locale): void;
|
locale: Locale; setLocale(l: Locale): void;
|
||||||
route: string[]; nav(path: string): void;
|
route: string[]; nav(path: string): void;
|
||||||
|
|
@ -134,7 +137,7 @@ export function AppProvider({ ds, children }: { ds: DataSource; children: ReactN
|
||||||
|
|
||||||
const value: Ctx = {
|
const value: Ctx = {
|
||||||
ds, viewer, ready, categories, courses, settings: settings ?? DEFAULT_SETTINGS, catalogLoaded,
|
ds, viewer, ready, categories, courses, settings: settings ?? DEFAULT_SETTINGS, catalogLoaded,
|
||||||
me, meLoaded, signedIn: !!me && !me.deletedAt && !signedOut, inbox,
|
me: me && !me.deletedAt && !signedOut ? me : null, account: me, meLoaded, signedIn: !!me && !me.deletedAt && !signedOut, inbox,
|
||||||
locale, setLocale, route, nav, toast, write,
|
locale, setLocale, route, nav, toast, write,
|
||||||
signIn: () => { store.set('signedOut', null); setSignedOut(false); },
|
signIn: () => { store.set('signedOut', null); setSignedOut(false); },
|
||||||
signOut: () => { store.set('signedOut', '1'); setSignedOut(true); },
|
signOut: () => { store.set('signedOut', '1'); setSignedOut(true); },
|
||||||
|
|
|
||||||
|
|
@ -794,7 +794,7 @@ function Checkout({ slug }: { slug?: string }) {
|
||||||
<section className="stack" style={{ maxWidth: 560 }}>
|
<section className="stack" style={{ maxWidth: 560 }}>
|
||||||
<h1 style={{ fontSize: 'var(--fs-2xl)' }}>{t('checkout.title')}</h1>
|
<h1 style={{ fontSize: 'var(--fs-2xl)' }}>{t('checkout.title')}</h1>
|
||||||
<div className="card row" style={{ flexWrap: 'nowrap' }}>
|
<div className="card row" style={{ flexWrap: 'nowrap' }}>
|
||||||
<div style={{ width: 110, flex: 'none' }}><Cover course={c} locale={locale} /></div>
|
<div className="thumb" style={{ width: 110, flex: 'none' }}><Cover course={c} locale={locale} /></div>
|
||||||
<div className="grow stack-sm"><strong>{ct(c, locale).title}</strong><span className="small muted">{t('checkout.lifetime')}</span></div>
|
<div className="grow stack-sm"><strong>{ct(c, locale).title}</strong><span className="small muted">{t('checkout.lifetime')}</span></div>
|
||||||
</div>
|
</div>
|
||||||
<fieldset className="stack-sm" style={{ border: 0, padding: 0, margin: 0 }}>
|
<fieldset className="stack-sm" style={{ border: 0, padding: 0, margin: 0 }}>
|
||||||
|
|
@ -895,8 +895,8 @@ function MyCourses() {
|
||||||
{mine.length ? <div className="stack">{mine.map((c) => {
|
{mine.length ? <div className="stack">{mine.map((c) => {
|
||||||
const p = courseProgress(c, me); const r = resumePoint(c, me);
|
const p = courseProgress(c, me); const r = resumePoint(c, me);
|
||||||
return (
|
return (
|
||||||
<div key={c.id} className="card row" style={{ alignItems: 'center' }}>
|
<div key={c.id} className="card row my-row" style={{ alignItems: 'center' }}>
|
||||||
<div style={{ width: 120, flex: 'none' }}><Cover course={c} locale={locale} /></div>
|
<div className="thumb" style={{ width: 120, flex: 'none' }}><Cover course={c} locale={locale} /></div>
|
||||||
<div className="grow stack-sm"><strong>{ct(c, locale).title}</strong><div className="bar"><i style={{ width: `${p.pct}%` }} /></div><span className="small muted num">{t('my.lessonsDone', { done: p.done, total: p.total })}</span></div>
|
<div className="grow stack-sm"><strong>{ct(c, locale).title}</strong><div className="bar"><i style={{ width: `${p.pct}%` }} /></div><span className="small muted num">{t('my.lessonsDone', { done: p.done, total: p.total })}</span></div>
|
||||||
{r && <button className={`btn btn-sm ${p.pct === 100 ? 'btn-ghost' : 'btn-accent'}`} onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}>{p.pct === 100 ? t('course.watchAgain') : t('my.resume')}</button>}
|
{r && <button className={`btn btn-sm ${p.pct === 100 ? 'btn-ghost' : 'btn-accent'}`} onClick={() => nav(`/${locale}/learn/${c.slug}/${r.lesson.id}`)}>{p.pct === 100 ? t('course.watchAgain') : t('my.resume')}</button>}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -916,7 +916,7 @@ function MyProgress() {
|
||||||
{!mine.length && <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('landing.browse')}</button>}>{t('my.empty')}</Empty>}
|
{!mine.length && <Empty action={<button className="btn" onClick={() => nav(`/${locale}/courses`)}>{t('landing.browse')}</button>}>{t('my.empty')}</Empty>}
|
||||||
{mine.map((c) => (
|
{mine.map((c) => (
|
||||||
<div key={c.id} className="card stack-sm">
|
<div key={c.id} className="card stack-sm">
|
||||||
<div className="row"><Ring pct={courseProgress(c, me).pct} /><div className="grow"><h2 style={{ fontSize: 'var(--fs-lg)' }}>{ct(c, locale).title}</h2></div>
|
<div className="row prog-head"><Ring pct={courseProgress(c, me).pct} /><div className="grow"><h2 style={{ fontSize: 'var(--fs-lg)' }}>{ct(c, locale).title}</h2></div>
|
||||||
<button className="btn btn-ghost btn-sm" onClick={() => nav(`/${locale}/course/${c.slug}`)}>{t('course.content')}</button></div>
|
<button className="btn btn-ghost btn-sm" onClick={() => nav(`/${locale}/course/${c.slug}`)}>{t('course.content')}</button></div>
|
||||||
{[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch) => <div key={ch.id}><p className="small" style={{ fontWeight: 700, padding: '8px 4px 2px' }}>{tr(ch.translations, locale)?.title}</p>{ch.lessons.filter((l) => l.isPublished).sort((a, b) => a.sortOrder - b.sortOrder).map((l) => <LessonRow key={l.id} c={c} l={l} />)}</div>)}
|
{[...c.chapters].sort((a, b) => a.sortOrder - b.sortOrder).map((ch) => <div key={ch.id}><p className="small" style={{ fontWeight: 700, padding: '8px 4px 2px' }}>{tr(ch.translations, locale)?.title}</p>{ch.lessons.filter((l) => l.isPublished).sort((a, b) => a.sortOrder - b.sortOrder).map((l) => <LessonRow key={l.id} c={c} l={l} />)}</div>)}
|
||||||
{!!c.assessments?.length && <div><p className="small" style={{ fontWeight: 700, padding: '8px 4px 2px' }}>{t('assess.title')}</p>{c.assessments.map((a) => <AssessmentRow key={a.id} c={c} a={a} />)}</div>}
|
{!!c.assessments?.length && <div><p className="small" style={{ fontWeight: 700, padding: '8px 4px 2px' }}>{t('assess.title')}</p>{c.assessments.map((a) => <AssessmentRow key={a.id} c={c} a={a} />)}</div>}
|
||||||
|
|
@ -1014,7 +1014,7 @@ function Help() {
|
||||||
|
|
||||||
function SignIn() {
|
function SignIn() {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const { viewer, me, ready, signIn, nav, locale } = useApp();
|
const { viewer, account: me, ready, signIn, nav, locale } = useApp();
|
||||||
const [mode, setMode] = useState<'phone' | 'email'>('phone');
|
const [mode, setMode] = useState<'phone' | 'email'>('phone');
|
||||||
const [phone, setPhone] = useState('');
|
const [phone, setPhone] = useState('');
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,8 @@ textarea.input { min-height: 110px; resize: vertical; }
|
||||||
.cover.has-img .ttl { display: none; }
|
.cover.has-img .ttl { display: none; }
|
||||||
.tone-rose { background: var(--tone-rose); } .tone-clay { background: var(--tone-clay); } .tone-plum { background: var(--tone-plum); }
|
.tone-rose { background: var(--tone-rose); } .tone-clay { background: var(--tone-clay); } .tone-plum { background: var(--tone-plum); }
|
||||||
.tone-sand { background: var(--tone-sand); } .tone-sage { background: var(--tone-sage); } .tone-ink { background: var(--tone-ink); }
|
.tone-sand { background: var(--tone-sand); } .tone-sage { background: var(--tone-sage); } .tone-ink { background: var(--tone-ink); }
|
||||||
.grid-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
|
.grid-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
|
||||||
|
.grid-cards > * { max-width: 440px; }
|
||||||
.ccard { display: flex; flex-direction: column; gap: 10px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
|
.ccard { display: flex; flex-direction: column; gap: 10px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; min-width: 0; }
|
||||||
.ccard h3 { font-size: var(--fs-lg); }
|
.ccard h3 { font-size: var(--fs-lg); }
|
||||||
.ccard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
|
.ccard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
|
||||||
|
|
@ -268,7 +269,6 @@ table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
|
||||||
.hero-card .cover { aspect-ratio: 16 / 10; }
|
.hero-card .cover { aspect-ratio: 16 / 10; }
|
||||||
.hero-card .cover .ttl { font-size: clamp(24px, 3.2vw, 36px); }
|
.hero-card .cover .ttl { font-size: clamp(24px, 3.2vw, 36px); }
|
||||||
.ccard .cover { aspect-ratio: 16 / 9; }
|
.ccard .cover { aspect-ratio: 16 / 9; }
|
||||||
@media (max-width: 599px) { .ccard .cover .ttl { display: none; } }
|
|
||||||
/* touch targets: 40px minimum everywhere, 44px on touch screens */
|
/* touch targets: 40px minimum everywhere, 44px on touch screens */
|
||||||
.btn-sm { min-height: 40px; }
|
.btn-sm { min-height: 40px; }
|
||||||
@media (pointer: coarse) { .btn-sm, .controls button, .controls select { min-height: 44px; min-width: 44px; } .lesson-row { min-height: 56px; } }
|
@media (pointer: coarse) { .btn-sm, .controls button, .controls select { min-height: 44px; min-width: 44px; } .lesson-row { min-height: 56px; } }
|
||||||
|
|
@ -521,3 +521,32 @@ fieldset[disabled] .quiz-opt { cursor: default; }
|
||||||
.ch .lesson-row .pill { flex: none; }
|
.ch .lesson-row .pill { flex: none; }
|
||||||
.lesson-row .quiz-ok, .lesson-row .quiz-todo { display: block; font-weight: 700; }
|
.lesson-row .quiz-ok, .lesson-row .quiz-todo { display: block; font-weight: 700; }
|
||||||
.lesson-row .quiz-ok { color: var(--success); } .lesson-row .quiz-todo { color: var(--alert); }
|
.lesson-row .quiz-ok { color: var(--success); } .lesson-row .quiz-todo { color: var(--alert); }
|
||||||
|
|
||||||
|
/* ================= v5: audit 2026-10-16 phase 1 (design/audit-2026-10-16.md) ================= */
|
||||||
|
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
|
||||||
|
/* press feedback on everything pressable */
|
||||||
|
.btn, .icon-btn, .seg button, .ccard, .cat-card, .lesson-row, .quiz-opt { transition: transform 160ms var(--ease-out), box-shadow 200ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
|
||||||
|
.btn:active, .icon-btn:active, .seg button:active, .quiz-opt:active { transform: scale(0.97); }
|
||||||
|
.ccard:active, .cat-card:active { transform: scale(0.99); }
|
||||||
|
/* lift-on-hover only where a real pointer can hover; touch screens kept the lift stuck after a tap */
|
||||||
|
@media (hover: none) { .ccard:hover, .cat-card:hover { transform: none; box-shadow: none; } .foot-box:hover svg { transform: none; } }
|
||||||
|
.ch > summary svg { transition: transform 200ms var(--ease-out); }
|
||||||
|
/* toast slides up from where it sits instead of popping in */
|
||||||
|
.toast { transition: opacity 200ms var(--ease-out), translate 200ms var(--ease-out); }
|
||||||
|
@starting-style { .toast { opacity: 0; translate: 0 8px; } }
|
||||||
|
/* course page: play button in the corner so it never covers the Ge'ez title */
|
||||||
|
.c-screen .play-big { left: auto; top: auto; right: 20px; bottom: 20px; transform: none; width: 56px; height: 56px; transition: transform 160ms var(--ease-out); }
|
||||||
|
.c-screen:hover .play-big { transform: scale(1.06); }
|
||||||
|
.c-screen .cover .ttl { max-width: calc(100% - 72px); }
|
||||||
|
/* small thumbnails (my courses, checkout): two short lines instead of a clipped third */
|
||||||
|
.thumb .cover { padding: 10px; }
|
||||||
|
.thumb .cover .ttl { font-size: 15px; line-height: 1.3; -webkit-line-clamp: 2; }
|
||||||
|
/* phone course rows: square thumbnail that shows the title instead of an empty swatch */
|
||||||
|
@media (max-width: 599px) {
|
||||||
|
.ccard .cover { aspect-ratio: 1; padding: 8px; }
|
||||||
|
.ccard .cover .ttl { font-size: 13px; line-height: 1.3; -webkit-line-clamp: 3; max-width: 100%; }
|
||||||
|
.my-row .btn { flex: 1 1 100%; }
|
||||||
|
}
|
||||||
|
.prog-head .grow { flex: 1 1 160px; }
|
||||||
|
/* help: the phone button wraps instead of pushing "Copy" off the card */
|
||||||
|
.row > .btn.grow { flex: 1 1 260px; }
|
||||||
|
|
|
||||||
17
skills-lock.json
Normal file
17
skills-lock.json
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"skills": {
|
||||||
|
"emil-design-eng": {
|
||||||
|
"source": "emilkowalski/skill",
|
||||||
|
"sourceType": "github",
|
||||||
|
"skillPath": "skills/emil-design-eng/SKILL.md",
|
||||||
|
"computedHash": "51f2537e04d15911b41d78e2de24c36a0e26d41beae15e82a954fe5496a5eda9"
|
||||||
|
},
|
||||||
|
"grill-me": {
|
||||||
|
"source": "mattpocock/skills",
|
||||||
|
"sourceType": "github",
|
||||||
|
"skillPath": "skills/productivity/grill-me/SKILL.md",
|
||||||
|
"computedHash": "9cdbb4b8f7a3aeaef82e6230c9e823500d4a8a1214c726cf342cf9829d34fc7d"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user