Radioactive Buttons
Create awesome looking and engaging buttons by using CSS animations to give them all that radioactive feel.
Note: Demo works best in Safari 4.x and Chrome and, um, not so much in Firefox 3.5.
This Is How We Do It
Using CSS animations in Safari, we're able to turn an otherwise ordinary button into a glowing, radioactive mess of awesome. Don't see the radioactive above? Be sure you're in Safari before getting underway.
For each button, we specify three things:
- Animation name (we'll show this later)
- Animation duration
- And the number of times it repeats (iteration count)
You can see how these come together on the right. The CSS calls a pre-defined animation you create, assigns it a duration, and tells it how long to repeat. Pretty sweet, right?
To make it work, we first specify all our button styles (done in our global styles for ZURB.com) and then we added the shadows. Now, in the animation, we switch from a box-shadow that matches the background color to the color of the button to give it the glowing effect.
And when we add in the animations, bam! Radioactive buttons.
1. Create Your Animation
@-webkit-keyframes greenPulse { from { background-color: #749a02; -webkit-box-shadow: 0 0 9px #333; } 50% { background-color: #91bd09; -webkit-box-shadow: 0 0 18px #91bd09; } to { background-color: #749a02; -webkit-box-shadow: 0 0 9px #333; } }
2. And Then Cue It Up
a.green.button { -webkit-animation-name: greenPulse; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: infinite; }
Copyright ZURB, freely available for distribution under the MIT license.
Check out other Playground experiments
Foundation CSS Grid Examples
Foundation CSS Grid + Container Queries
Foundation Grids within Grids
Reactive Animation Listener
Get started with finishing
Team up with our designers to see how our iterative design process can get your project going. Equipped with our Progressive Design process, visual skills, and the coding chops that brought you Foundation, ZURB Studios is ready to jump in and get your product out to the masses!
Stay in touch
Get monthly updates from ZURB in your inbox. Read our latest news & buzz.
Get ZURBnews!Log in with your ZURB ID
Your ZURB ID explained
You’ll use your ZURB ID to log in to all of ZURB’s properties — University, Products and Foundation. One account to handle it all.
University
Product design resources, courses and training.
Design Apps
Prototype, iterate and collect feedback on your products.
Foundation
The most advanced front-end framework in the world.
Sign up for a ZURB ID
Your ZURB ID explained
You’ll use your ZURB ID to log in to all of ZURB’s properties — University, Products and Foundation. One account to handle it all.
University
Product design resources, courses and training.
Design Apps
Prototype, iterate and collect feedback on your products.
Foundation
The most advanced front-end framework in the world.