27 CSS Card Hover Effects

Magnetic Float

Three orbit dots scatter to different positions on hover with spring easing, while the card floats upward.

Pure CSS MIT licensed

Magnetic Float the 17th of 27 designs in the 27 CSS Card Hover Effects collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<div class="card-17">
  <div class="card-17__dot card-17__dot--a"></div>
  <div class="card-17__dot card-17__dot--b"></div>
  <div class="card-17__dot card-17__dot--c"></div>
  <span class="card-17__tag">Float</span>
  <h4 class="card-17__title">Magnetic Float</h4>
  <p class="card-17__body">Orbit dots scatter on hover with spring easing.</p>
</div>
.card-17__tag {
  font-family: monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(124, 108, 255, 0.15);
  color: #7c6cff;
  border: 1px solid rgba(124, 108, 255, 0.3);
  display: inline-block;
  margin-bottom: 10px;
}
.card-17__title {
  font-size: 17px;
  font-weight: 700;
  color: #f0eeff;
  margin-bottom: 6px;
}
.card-17__body {
  font-size: 13px;
  color: #b8b6d4;
  line-height: 1.6;
}
.card-17 {
  width: 100%;
  max-width: 280px;
  position: relative;
  overflow: visible;
  padding: 22px;
  border-radius: 14px;
  background: #17171f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.42s;
}
.card-17:hover {
  transform: translateY(-10px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42);
}
.card-17__dot {
  position: absolute;
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-17__dot--a {
  width: 11px;
  height: 11px;
  background: #7c6cff;
  top: 18px;
  right: 18px;
}
.card-17__dot--b {
  width: 8px;
  height: 8px;
  background: #ff6c8a;
  bottom: 22px;
  left: 22px;
}
.card-17__dot--c {
  width: 6px;
  height: 6px;
  background: #1ed98a;
  top: 50%;
  right: 14px;
}
.card-17:hover .card-17__dot--a {
  transform: translate(10px, -12px) scale(1.5);
}
.card-17:hover .card-17__dot--b {
  transform: translate(-10px, 10px) scale(1.4);
}
.card-17:hover .card-17__dot--c {
  transform: translate(8px, 0) scale(1.6);
}

Search CodeFronts

Loading…