CSS Effects

Create stunning animations, transitions, and visual effects using pure CSS. No JavaScript required!

Live CSS Demos

Glass Morphism

Glass Card

This card uses backdrop-filter for the glass effect

glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 1.5rem;
}

Animated Gradient

Animated Background
animated-gradient {
  background: linear-gradient(-45deg, 
    #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

3D Card Hover

3D Card

Hover to see the 3D effect

card-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card-3d:hover {
  transform: rotateY(15deg) rotateX(15deg);
}

.card-content {
  transform: translateZ(50px);
}

Morphing Button

morph-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.morph-button:hover {
  transform: scale(1.05);
  border-radius: 50px;
}

.morph-button:hover .button-text {
  transform: translateX(-100%);
}

.morph-button:hover .button-icon {
  transform: translateX(0);
}

Text Reveal

Amazing Text Effect

text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, #fff, transparent);
  animation: reveal 2s ease-in-out;
}

@keyframes reveal {
  0% { left: -100%; }
  100% { left: 100%; }
}

Floating Elements

floating-element {
  animation: float 3s ease-in-out infinite;
}

.element-1 { animation-delay: 0s; }
.element-2 { animation-delay: 1s; }
.element-3 { animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

Advanced CSS Techniques

CSS Grid Magic

Create complex layouts with CSS Grid and add animations for dynamic effects.

grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  animation: gridPulse 2s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { gap: 1rem; }
  50% { gap: 2rem; }
}

CSS Custom Properties

Use CSS variables for dynamic theming and animations.

:root {
  --primary-color: #667eea;
  --animation-duration: 0.3s;
}

.button {
  background: var(--primary-color);
  transition: all var(--animation-duration) ease;
}

.button:hover {
  --primary-color: #764ba2;
}

Clip Path Animations

Create unique shapes and reveal animations with clip-path.

clip-reveal {
  clip-path: circle(0% at 50% 50%);
  animation: clipReveal 1s ease-out forwards;
}

@keyframes clipReveal {
  to {
    clip-path: circle(100% at 50% 50%);
  }
}

Scroll Animations

Create scroll-triggered animations using CSS only.

scroll-element {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

.scroll-element.in-view {
  opacity: 1;
  transform: translateY(0);
}

Performance Tips

Use Transform

Always use transform and opacity for animations - they're GPU accelerated and don't trigger layout.

🎯

Will-Change

Use will-change property to hint the browser about upcoming animations for better performance.

🔄

Reduce Repaints

Avoid animating properties that cause layout recalculations like width, height, or margins.

📱

Mobile First

Test animations on mobile devices and consider reducing complexity for better performance.

🎨

CSS Containment

Use contain property to isolate animations and prevent unnecessary recalculations.

⏱️

Timing Functions

Choose appropriate easing functions - cubic-bezier for custom curves, ease-out for natural feel.