- {CARS.map((car, index) => (
-
{ cars.current[index] = element; }}
- className="absolute left-0 top-0 opacity-0 transition-opacity duration-300"
- style={{ width: car.width, height: car.height, transformOrigin: "0 0" }}
- >
- {index === 0 ? : }
-
- ))}
- {puffs.map((puff) =>
)}
+ {/* The cargo icons, rendered once so the canvas can paint them. */}
+
+ {cargo.map((item, index) => {item.icon})}
);
diff --git a/src/library/registry.tsx b/src/library/registry.tsx
index 3238166..fc589ec 100644
--- a/src/library/registry.tsx
+++ b/src/library/registry.tsx
@@ -131,9 +131,9 @@ export const LIBRARY: LibraryItem[] = [
{
slug: "draw-a-line",
name: "Draw a Line",
- description: "Move across the card to lay track. A little train follows it, puffing your app icons out as it goes, and it all fades once you stop.",
+ description: "A toy train set on a tilted table. Move across it to lay track; the train follows, climbs a bridge wherever you cross your own line and puffs your app icons onto the table. It all fades once you stop.",
category: "Motion",
- tags: ["train", "cursor", "canvas", "interactive"],
+ tags: ["train", "2.5d", "canvas", "interactive"],
file: "draw-a-line.tsx",
source: drawALineSource,
dependencies: [],