---
title: Comark UI on ViteHub's motion layer
resources:
  - url: https://github.com/onmax/comark-ui/pull/474
    title: comark-ui#474
  - url: https://github.com/vite-hub/vitehub/pull/4953
    title: vitehub#4953
---

Every Comark UI block now gets its motion from ViteHub UI's motion layer, through the new comark-motion package, instead of its own CSS transitions, keyframes, and WAAPI calls. Each clip plays at ¼×: `main` on the left, this branch on the right.

Each scene is the Markdown below, rendered through `comark-ui/html` in headless Chromium (1280×840 a side, laid out at double size), driven by one Playwright script on both sides. CSS and WAAPI run at 0.25 through the DevTools protocol, and the layer's springs run four times slower.

## Press and copy

A code block's Copy button, pressed and released. The icon squashes on a spring and springs back past rest, the check swaps in with a blur, and the button rings once. On `main` the whole button scales by CSS and the check appears at once.

![Pressing Copy: on the right the icon squashes, the check blurs in, and a ring grows around the button](https://drop.vitehub.dev/f/1b791b41-5300-486e-bfaa-6f3b22783230.mp4){width=1920 height=258 autoplay loop muted}

## Tabs

A code group, switched from pnpm to npm to bun and back. The selected tab's surface stretches toward the new tab and settles there. On `main` it slides on a 200ms curve.

![Switching tabs: on the right the surface stretches toward the new tab, then settles](https://drop.vitehub.dev/f/e9ec2c49-460d-4170-8766-7d328afad8a8.mp4){width=1920 height=258 autoplay loop muted}

## Show or hide content

A `::details`, opened and closed. The chevron turns on a spring and passes its angle a little, and the content opens at once, because the reader reads it. On `main` the chevron and the content's height both animate on a curve.

![Opening details: on the right the chevron turns on a spring and the text is there at once](https://drop.vitehub.dev/f/214c1c5f-3dad-4866-8bca-c3f68f3cff43.mp4){width=1920 height=378 autoplay loop muted}

## Zoom

An image, opened and closed with Escape. The picture travels from its place in the page into the dialog on springs for its position and size, and back. On `main` it flies on a 260ms WAAPI transform.

![Zooming a picture: on the right it grows from its place on springs and goes back the same way](https://drop.vitehub.dev/f/4d82cbd7-35d2-4133-bfe3-8709f30745fa.mp4){width=1920 height=678 autoplay loop muted}

## Date tooltip

Two `:time[...]` dates, hovered one after the other. The tooltip rises from behind its date, narrow, then widens to its label, and sinks back when the pointer leaves. On `main` it fades and scales in by CSS.

![Hovering dates: on the right the tooltip rises from behind the date and widens to its label](https://drop.vitehub.dev/f/b2fadef5-ca6f-4fe3-b997-b7576dcfaaf1.mp4){width=1920 height=288 autoplay loop muted}

## Citation card

Two `:cite[n]` citations, hovered one after the other. The card rises next to its citation and slides to the next one. On `main` it fades in with a 3% scale.

![Hovering citations: on the right the card rises next to the citation and slides to the next](https://drop.vitehub.dev/f/cb1183a4-2d81-4af5-a06c-dde981262370.mp4){width=1920 height=468 autoplay loop muted}

## Poll

A vote in a `::poll`. The option squashes when pressed, each bar grows to its share on springs, and each percent rolls its digits. On `main` the bars grow on a 250ms transition and the numbers appear at once.

![Voting in a poll: on the right the bars grow on springs and the percents roll](https://drop.vitehub.dev/f/a4f41a63-81fb-44cd-94d2-622538201907.mp4){width=1920 height=528 autoplay loop muted}

## Before and after swipe

A `::compare{mode="slider"}`, dragged past its left edge and let go, then dragged inside. The divider stays under the pointer and stops at the edge, where its line bends toward the pointer and springs back straight; the line is white, so its bend is faint against the page. On `main` a flick coasts on after the pointer lets go.

![Dragging the divider: on the right it stays under the pointer and stops at the edge with no coast](https://drop.vitehub.dev/f/1f70a4f6-8169-4249-b5e3-c537dd6d7006.mp4){width=1920 height=528 autoplay loop muted}
