Gallery✨ Premium

Smooth Ken Burns

Your photo slowly zooms and drifts inside its frame on a 15-second loop; hovering or the pause button stops it, and it stays still for anyone who reduces motion.

CSSAnimation

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Gallery has 44 effects, including 6 free. Explore the category →

3 usage examples

Holiday cottage header — the valley drifts gently — Smooth Ken Burns example 1

① Holiday cottage header — the valley drifts gently

WhenOn the Val d'Orbéric Gîte page, the valley photo covers the whole header; the place name, capacity and the “See availability” button sit at the bottom left on a dark gradient, the pause button at the bottom right.
WhySlow motion gives the landscape depth without stealing attention from the title; an 8 s cycle stays calm yet is noticed as soon as the page opens.
SettingsRoot in position: absolute; inset: 0, --kbu-width: 100%, --kbu-ratio: 540/360, --kbu-radius: 0, --kbu-duration: 8s; badge and caption removed from the HTML; pointer-events: none on the frame (the button keeps them) so the mouse does not stop a background.
Getaway of the week in a regional rail company's app — Smooth Ken Burns example 2

② Getaway of the week in a regional rail company's app

WhenOn the Sonnevrel app home screen, the square thumbnail of Lusterel, its lighthouse and old harbour moves gently next to the journey time, the price and the “See trains” button, above the list of other weekend ideas.
WhyIn a list of static offers, a single moving photo marks the featured one without a banner or badge; at this size, a 6 s cycle stays discreet.
Settings--kbu-width: 124px, --kbu-ratio: 1, --kbu-radius: 12px, --kbu-duration: 6s, pause button reduced to 24 px; badge and caption removed.
Archive photo on a brewery's “Our story” page — Smooth Ken Burns example 3

③ Archive photo on a brewery's “Our story” page

WhenIn the middle of the Morvellon Brewery page, the sepia 1912 façade slowly moves forward between the timeline (1898, 1912) and the founder's quote, above the “Book a tour” button.
WhyThe slow pan is the gesture of history documentaries: it brings a single archive photo to life without retouching it.
Settings--kbu-width: 180px, --kbu-ratio: 15/11, --kbu-radius: 2px, --kbu-duration: 10s; badge and caption removed.

How it works

The CSS animation kbu-drift runs on the <img class="kbu-image">: over --kbu-duration (15 s), the image goes through four framings (scaled from 1 to 1.25, shifted by a few per cent) and back to the start, with an ease-in-out that avoids jolts. The frame clips the overflow. No script moves the image.

A small round button at the bottom right (.kbu-toggle) pauses and resumes the animation; that is the JavaScript's only job, wiring each root separately. Hovering the image also pauses it, as in the original version, and the “Auto-animating” badge flags the motion.

The frame adapts to the available width up to --kbu-width and keeps --kbu-ratio. For a full-screen background, set the root to position: absolute; inset: 0 and use --kbu-width: 100%.

Accessibility

  • Pause: the button is a real <button> named “Pause the animation”; aria-pressed="true" says the image is stopped. Motion lasting more than five seconds must be stoppable (WCAG 2.2.2): that is what it is for.
  • Reduced motion: under prefers-reduced-motion: reduce, the animation is removed, the image stays at its starting framing, and the badge and button disappear since there is nothing left to stop.
  • Screen readers: the image keeps its alt text; the caption is hidden. The badge stays readable: remove it if it adds nothing to your page.
  • Hover: the mouse stops the image while it is over it; the button stops it for good, even when the mouse leaves.

Browser compatibility

CSS animation, aspect-ratio and under 1 KB of JavaScript for the button, no dependency. Measured in Chromium 151, Firefox 153 and WebKit 26.5: two copies with only the 2nd paused, script pasted twice without error, button on the keyboard, reduced motion (no animation), no overflow at 390 px.

Chrome 88+✓ Full (measured)
Firefox 89+✓ Full (measured)
Safari 15+✓ Full (WebKit engine measured)
Edge 88+✓ Full (Chromium engine)
Mobile iOS 15+✓ Full (WebKit engine measured)
Android Chrome 88+✓ Full (Chromium engine)

Without JavaScript, the animation runs and stops on hover, but the button does nothing: hide it in that case. Without aspect-ratio, the frame takes the image's height.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0186-root">
  <div class="kbu-frame">
    <img class="kbu-image" src="your-photo.jpg" alt="Photo description">
    <span class="kbu-label" aria-hidden="true">Ken Burns</span>
    <span class="kbu-badge">Auto-animating</span>
    <button type="button" class="kbu-toggle" aria-pressed="false" aria-label="Pause the animation"></button>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
Image (HTML — src of .kbu-image) violet grid pattern (inline SVG) Your photo and its alt. The image grows up to 125%: a file 1.3 times wider than the frame stays sharp.
--kbu-duration 15s Length of a full cycle; 8s for visible motion, 25s for an almost still background.
--kbu-width · --kbu-ratio · --kbu-radius 280px · 7 / 5 · 0.75rem Maximum width, proportions and rounding of the frame.
Framings (@keyframes kbu-drift) 1 → 1.2 → 1.15 → 1.25 Edit the scale() and translate() of the 25%, 50% and 75% steps to aim at another part of the photo.
.kbu-badge badge · .kbu-label caption “Auto-animating” · “Ken Burns” Optional elements: delete the <span> tags on a real photo.
Pause on hover on For a background, add pointer-events: none to the frame and pointer-events: auto to the button: only the button pause remains.

FAQ

Automatic motion lasting more than five seconds must be stoppable by the reader (WCAG 2.2.2). Hover is not enough: it does not exist on keyboard or touch.
The still photo at its starting framing, with no badge or button. The content stays whole; only the motion goes away.
Not in this effect: it animates a single image. To cycle through several photos, combine it with a carousel and use one root per slide.