mirror of
https://github.com/Louis-CFM/coucou.git
synced 2026-12-07 07:32:35 +09:00
The drop was three beats — morph, gulp, bar — where macOS has a timeline of fifteen, drawn in a canvas of its own. This ports that canvas. - src/upload/sequence.ts is UploadSequenceEngine.swift: the phase constants, the four easings, springs integrated at 240 Hz, the lock onto a slow cursor, the squeeze keyframes and the progress curve. Pure arithmetic, no DOM. - src/upload/canvas.ts is UploadCanvasView.swift: card, marching dashed border, the green glow that rises with progress, the bar and its blurred trail, the choose card, Mochi's superellipse body with its three eye shapes, and the file cut into 28 strips that funnel into the mouth. So the sequence now reads: the box slides under the cursor and locks on, the mouth opens, the file is sucked in over 0.30 s, the mouth shuts, Mochi chews, shrinks to a 14 px bead riding the head of the bar, hops at 100 %, then grows back and walks left as the choose card fades in. The island hides its own Mochi while this runs — two would overlap — and the header stays overlaid on top, as on macOS. Leaving the drop views, or shutting the island, stops the engine: left running it would keep the frame loop awake and cost CPU with nothing on screen. Two deliberate differences. macOS insets the real file icon from NSWorkspace into the sheet; the webview cannot reach it, so the generic sheet is drawn, which is already the Swift's own fallback. And the secondary button stays "Cancel" rather than "Send by email", which the Windows v1 does not have. dev/upload-preview.html replays the whole thing on a loop under `npm run dev`, since the alternative is dragging a file from Explorer for every tweak. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
18 lines
589 B
HTML
18 lines
589 B
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<title>Coucou — upload sequence preview</title>
|
||
<style>
|
||
body { margin: 0; background: #1b1b1f; font: 12px system-ui; color: #ddd; }
|
||
#stage { position: relative; width: 640px; height: 176px; margin: 24px auto; border-radius: 22px; overflow: hidden; }
|
||
#clock { text-align: center; font: 600 14px ui-monospace, monospace; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div id="stage"></div>
|
||
<div id="clock">–</div>
|
||
<script type="module" src="./upload-preview.ts"></script>
|
||
</body>
|
||
</html>
|