DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Languages
  4. CSS3 Transitions, Hover Effects, and Two Different Kinds of Interactivity

CSS3 Transitions, Hover Effects, and Two Different Kinds of Interactivity

John Esposito user avatar by
John Esposito
·
Nov. 10, 11 · Interview
Like (0)
Save
Tweet
Share
7.61K Views

Join the DZone community and get the full member experience.

Join For Free

This CSS3 hover tutorial caught my eye -- but also fired a recent designer's rant in my memory. Why do these hover effects, by Alessio Atzeni, look cooler than these?

The former is animated, of course, while the latter is not. Animation alone increases the sense of interactivity -- from infancy, even. But then what's the difference between this animation (flying zoom) and this one (sideways slide)? The CSS elements themselves are straightforward (scale and translate with ease-in-out) -- but why use one and not the other?

These are designers' questions, I suppose, and accordingly rather beyond me. But comparing these two CSS hover tutorials (1,2), especially the multiple transition&animation variations demoed here, gives a clear sense of how CSS3 allows a small change in the developer's code to make a really significant difference in the user's experience.

Alessio's 'true bounce effect' in Example 8 is particularly neat. At the heart is this keyframe rule -- easy to understand in principle, but remarkably well executed:

@keyframes bounceY {
2	    0% { transform: translateY(-205px);}
3	    40% { transform: translateY(-100px);}
4	    65% { transform: translateY(-52px);}
5	    82% { transform: translateY(-25px);}
6	    92% { transform: translateY(-12px);}
7	    55%, 75%, 87%, 97%, 100% { transform: translateY(0px);}
8	}

The trick lies, obviously, in the exact relation between the timing percents and the translationY distances. Alessio doesn't explain exactly how he selected these numbers, but they were certainly well-chosen.

These are the kinds of super-concrete details I find especially helpful in a tutorial like this -- where individual tips are concrete, but surrounded by a large enough number of variations that very different pages can benefit from a considerable variety of user experiences produced by fairly similar bits of code. You might want to keep this tutorial page as a go-to guide for high-quality and easy-to-code CSS3 transition and animation effects.

 

CSS Interactivity

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 7 Ways for Better Collaboration Among Your Testers and Developers
  • 5 Steps for Getting Started in Deep Learning
  • Create a CLI Chatbot With the ChatGPT API and Node.js
  • Securing Cloud-Native Applications: Tips and Tricks for Secure Modernization

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: