Last active
February 22, 2018 14:06
-
-
Save florianbrinkmann/937495c7b41df3c1600ef7d9c6e95a9e to your computer and use it in GitHub Desktop.
Add spinner to images that are currently loaded by lazysizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Spinner SVG by Sam Herbert (https://github.com/SamHerbert/SVG-Loaders), published under the MIT License */ | |
.lazyloading { | |
color: transparent; | |
opacity: 1; | |
transition: opacity 300ms; | |
background: url("data:image/svg+xml,%3Csvg width='44' height='44' xmlns='http://www.w3.org/2000/svg' stroke='%23333'%3E%3Cg fill='none' fill-rule='evenodd' stroke-width='2'%3E%3Ccircle cx='22' cy='22' r='1'%3E%3Canimate attributeName='r' begin='0s' dur='1.8s' values='1; 20' calcMode='spline' keyTimes='0; 1' keySplines='0.165, 0.84, 0.44, 1' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-opacity' begin='0s' dur='1.8s' values='1; 0' calcMode='spline' keyTimes='0; 1' keySplines='0.3, 0.61, 0.355, 1' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='1'%3E%3Canimate attributeName='r' begin='-0.9s' dur='1.8s' values='1; 20' calcMode='spline' keyTimes='0; 1' keySplines='0.165, 0.84, 0.44, 1' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-opacity' begin='-0.9s' dur='1.8s' values='1; 0' calcMode='spline' keyTimes='0; 1' keySplines='0.3, 0.61, 0.355, 1' repeatCount='indefinite'/%3E%3C/circle%3E%3C/g%3E%3C/svg%3E") no-repeat; | |
background-size: 1em 1em; | |
background-position: center center; | |
} | |
.lazyloaded { | |
transition: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment