John Ferris / @pixel_whip
http://pixelwhip.github.io/svg-flavors
/* CSS Animation */
@keyframes wave-hello {
0% { transform: rotate(0deg);}
100% { transform: rotate(20deg);}
}
#left-arm {
animation: wave-hello 1s infinite linear alternate;
transform-origin: 135px 195px;
}
...
/** CSS Styles **/
/** Embedded Media Queries **/
@media (max-width: 360px) {
.kool-aid { fill: orange; }
.oh-yeah { display: none; }
.oh-no { display: block; }
}


.icon--kool-aid { background-image: url(img/kool-aid-man.svg); }
.icon--kool-aid { background-image: url(img/kool-aid-man.svg); }
.no-svg .icon--kool-aid { background-image: url(img/kool-aid-man.png); }
Animation | Script w/ JS | Style w/ CSS | Cached | ||||
---|---|---|---|---|---|---|---|
SMIL | CSS | JS | Embedded | External | |||
<img/> | Yes | Yes | No | No | Yes | No | Yes |
background-image | Yes | Yes | No | No | Yes | No | Yes |
<object/> | Yes | Yes | Yes | Yes | Yes | No | Yes |
<svg/> | Yes | Yes | Yes | Yes | Yes | Yes | No |
// Elements to inject
var mySVGsToInject = document.querySelectorAll('img.inject-me');
// Trigger the injection
SVGInjector(mySVGsToInject);
/* Mark only */
#horizontal,
#stacked {
display: none;
}
/* Horizontal */
@media all and (min-aspect-ratio: 570/270) {
#horizontal { display: block; }
#mark { display: none; }
}
/* Stacked */
@media all and (max-aspect-ratio: 12/18) {
#mark,
#stacked-design { display: none; }
#stacked { display: block; }
}
/* Full */
@media all and (max-aspect-ratio: 120/205) {
#stacked-design { display: block; }
}
Copyright © Jolly Icons by Olly Holovchenko 2013
Copyright © Jolly Icons by Olly Holovchenko 2013
Copyright Roberts OzolinsFlat
See the Pen Form with Animation That Assists in UX by Sarah Drasner (@sdras) on CodePen.
Created with Circulus.svg by Sara Soueidan. Animated with GSAP.
See the Pen VelocityJS + SVG = ♡ by LegoMushroom (@sol0mka) on CodePen.