Fade & Slide Up
A hand-over on a vertical axis: A moves up 40 px while fading out as B comes in from 40 px below while fading in, on the same 0.6 s transition — the motion says "next". CSS + 0.9 KB of JavaScript, click, Enter or Space, a simple fade in place when the user reduces motion.
Updated
This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Transitions has 52 effects, including 9 free. Explore the category →
3 usage examples



How it works
The .fadeup-container frame (280 × 180 px, 16 px corners, #111118 background, overflow: hidden) stacks two .fadeup-panels with position: absolute; inset: 0, content centered in a column. A is visible and in place; B is transparent and 40 px lower (opacity: 0; transform: translateY(40px)). Both carry transition: .6s cubic-bezier(.4, 0, .2, 1), which animates both opacity and position.
When .active toggles, A goes to opacity: 0; translateY(-40px) and B to opacity: 1; translateY(0): both contents move the same way, upward, one leaving, one arriving. Measured in Chromium 151: 250 ms after the click, A is at 0.38 opacity and −24.8 px, B at 0.62 and +15.2 px (Firefox 153: 0.41 / −23.6 px and 0.59 / +16.4 px); at 1.1 s, A at 0 and −40 px, B at 1 and 0, then nothing moves any more (read 3 s later). The second click goes back down: B leaves downward, A comes back from above. Same result in WebKit 26.5.
The travel is short (40 px) and paired with a fade: the two texts never overlap at full opacity, so two names or two numbers never read on top of each other. Each .fadeup-container on the page keeps its own state, toggled by mouse or keyboard; aria-pressed and aria-hidden follow, with no global name.
Accessibility
- Reduced motion: under
prefers-reduced-motion: reduce, both panels stay in place (transform: none) and only a 0.15 s fade remains (measured in Chromium and Firefox: no translation, change complete within 260 ms). - Keyboard and screen readers: works like Slide Transition (fx-0696), a button frame usable from the keyboard, hidden panel never read.
- Public displays: for a call screen (counter, platform), also announce the change with sound or an
aria-live="polite"region; the visual hand-over alone is not enough for a visually impaired person. - Readability: mid-change, each text is at about 50% and offset by 20 px; do not trigger the hand-over more often than every 3 seconds on text people must read.
Browser compatibility
CSS (opacity, transform: translateY(), transition, inset) + 0.9 KB of JavaScript, no dependency. Measured in Chromium 151, Firefox 153 and WebKit 26.5: upward hand-over, state B held, return on the second click; keyboard and reduced motion measured in Chromium and Firefox. Opacity and transform are animated by the compositor, with no layout recalculation. inset sets the floor (Chrome 87, Firefox 66, Safari 14.1).
Without JavaScript, panel A stays on screen. Without inset, write top: 0; right: 0; bottom: 0; left: 0 on .fadeup-panel.
The code
HTML structure to paste into your page (the CSS + JS come with Premium):
<div class="fadeup-stage">
<div class="fadeup-container" role="button" tabindex="0" aria-pressed="false">
<div class="fadeup-panel fadeup-panel-a">…</div>
<div class="fadeup-panel fadeup-panel-b" aria-hidden="true">…</div>
</div>
<span class="fadeup-hint">…</span>
</div>
The full HTML + CSS + JS of Fade & Slide Up, ready to paste — plus all 840 effects. Or $299 once, lifetime access.
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
Distance (CSS — translateY(40px) and translateY(-40px)) |
40 px | 20 px for a subtle hand-over inside a card, 60 to 80 px for a large screen. Beyond half the frame height, texts leave before they finish fading. |
Direction (CSS — signs of both translateY) |
upward | Flip the signs for a downward hand-over (going back to the previous item); keep the same direction for A and B, that is what gives the feeling of a queue. |
Duration and curve (CSS — transition on .fadeup-panel) |
0.6 s, cubic-bezier(.4, 0, .2, 1) |
0.4 s for a counter or a stock ticker; delay B by 0.1 s (transition-delay on .fadeup-container.active .fadeup-panel-b) so A is almost gone when B enters. |
Content (HTML — .fadeup-panel-a, -b) |
avatar, name, role | Any centered content works: number, stop name, quote. Keep panels the same height so the motion stays even. |
Frame (CSS — .fadeup-container) |
280 × 180 px, #111118 background |
The frame background is what shows during the change: use your screen's color, opaque. |
FAQ
is-in (in place, opaque), is-out (40 px higher, transparent) and is-next (40 px lower, transparent). On each call, it would move the displayed item to is-out, the next one to is-in, then put the old one back to is-next with no transition, ready to be reused with the next text.