Skip to main content

Sarah Drasner

DOM Blacksmith, UX Smelter, Code Forger.

Article

The Importance of Context-Shifting in UX Patterns

Have you ever had a day at work where you were constantly put towards a new task as you were ramping up on the current one? It feels jarring at best, and completely frustrating and time-wasting at worst. In recent years, employers at big companies have begun to consider the cost of context-shifting—the time spent re-adjusting your brain to a different task adds up, causes frustration in employees, and thus: loses money. It follows that User Experience on a website … Read article “The Importance of Context-Shifting in UX Patterns”

Snippet

“Shake” CSS Keyframe Animation

This assumes the use of an autoprefixer.

.face:hover {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}

See the Pen “Shake” CSS snippet for CSS-Tricks by Sarah Drasner (@sdras) on CodePen.… Read article ““Shake” CSS Keyframe Animation”

Article

Debugging CSS Keyframe Animations

Creating CSS animations may be about learning the syntax, but mastering a beautiful and intuitive-feeling animation requires a bit more nuance. Since animations command so much attention, it’s important to refine our code to get the timing right and debug things when they go wrong. After tackling this problem myself, I thought I’d collect some of the tools that exist to aid in this process.… Read article “Debugging CSS Keyframe Animations”

Article

Weighing SVG Animation Techniques (with Benchmarks)

The following is a guest post by Sarah Drasner (@sarah_edo). Sarah has been researching and giving talks about animation lately. I jumped at the chance to have her share some of that research here, this time focusing on SVG animation and the different tech choices you can make to do it.Read article “Weighing SVG Animation Techniques (with Benchmarks)”