DEV Community

UI Motion AI
UI Motion AI

Posted on

What I learned making a stem chart

Only the days over goal get the accent color.

A chart of daily values drawn as thin stems with end dots, where days above a dashed goal line are colored.

demo

The trick

Stems scale up from the bottom with a 14ms stagger set from --i.

Switching between 14 days, 30 days and 13 weeks redraws everything and recounts the days over goal.

The goal comes from the --goal variable.

.s{width:2px;background:var(--fx-sub);position:relative;transform-origin:50% 100%;animation:up var(--dur) var(--fx-ease) both;animation-delay:calc(var(--i)*14ms)}
@keyframes up{from{transform:scaleY(.05);opacity:0}to{transform:none;opacity:1}}
Enter fullscreen mode Exit fullscreen mode

Where I'd use it

Spending and activity trends

One accent color for the days that matter, gray for the rest. It is a quiet way to point.

The prompt for this one is free: uimotion.app.

Top comments (0)