frontendhack-logo
Demo
Open in generator

Swing In Forward Left is a swing in CSS keyframe animation with 3 keyframe steps (0% → 60% → 100%). It animates transform (rotate, translateX) and opacity. The element starts invisible and fades in to full opacity.

Swing In animations rotate the element into place around an edge like a door hinge. They are good for cards, menus and panels that should feel physical.

Animation shorthand

.element {
  animation: swing-in-forward-left 1s ease 0s 1 normal forwards;
}

@keyframes code

@keyframes swing-in-forward-left {
  0% { transform: rotate(-90deg) translateX(-400px); opacity: 0; }
  60% { transform: rotate(10deg) translateX(10px); opacity: 1; }
  100% { transform: rotate(0) translateX(0); }
}

HTML

<div class="element">Animated content</div>

Keyframe steps

StepStyles
0%transform: rotate(-90deg) translateX(-400px); opacity: 0;
60%transform: rotate(10deg) translateX(10px); opacity: 1;
100%transform: rotate(0) translateX(0);

Respect reduced motion

@media (prefers-reduced-motion: reduce) {
  .element {
    animation: none;
  }
}

More Swing In animations

Frequently Asked Questions

Copy the @keyframes swing-in-forward-left block and the animation shorthand into your stylesheet, then add the class to any element. The shorthand reads name, duration, timing function, delay, iteration count, direction and fill mode.

Yes. Change the second value in the shorthand, for example 2s for a slower animation, or use the settings above the code to try duration, timing, delay, repeat count, direction and fill mode and copy the updated CSS.

Keep the iteration count at 1 and add the animation class to the element in your HTML. It plays once as soon as the element is rendered; use forwards or both to keep the end state.

Yes. It only animates transform and opacity, which browsers can hand to the GPU, so it stays smooth even on mobile devices.