├── demo-assets └── fan.png ├── README.md ├── .gitignore ├── LICENSE.md ├── infinite.css └── index.html /demo-assets/fan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tilomitra/infinite/HEAD/demo-assets/fan.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Infinite CSS Animations 2 | A small set of useful infinite CSS animations that you can drop into your project. 3 | 4 | ##[View Docs and Demo](http://tilomitra.github.io/infinite) 5 | 6 | MIT License. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /infinite.css: -------------------------------------------------------------------------------- 1 | /* Make the element pulse (grow large and small slowly) */ 2 | /* Usage 3 | .myElement { 4 | animation: pulsate 1s ease-out; 5 | animation-iteration-count: infinite; 6 | opacity: 1; 7 | } 8 | */ 9 | @-webkit-keyframes pulsate { 10 | 0% {-webkit-transform: scale(0.1, 0.1); opacity: 0.0;} 11 | 50% {opacity: 1.0;} 12 | 100% {-webkit-transform: scale(1.2, 1.2); opacity: 0.0;} 13 | } 14 | 15 | /* Make the element's opacity pulse*/ 16 | /* Usage 17 | .myElement { 18 | animation: opacityPulse 1s ease-out; 19 | animation-iteration-count: infinite; 20 | opacity: 0; 21 | } 22 | */ 23 | @-webkit-keyframes opacityPulse { 24 | 0% {opacity: 0.0;} 25 | 50% {opacity: 1.0;} 26 | 100% {opacity: 0.0;} 27 | } 28 | 29 | /* Make the element's background pulse. I call this alertPulse because it is red. You can call it something more generic. */ 30 | /* Usage 31 | .myElement { 32 | animation: alertPulse 1s ease-out; 33 | animation-iteration-count: infinite; 34 | opacity: 1; 35 | } 36 | */ 37 | @-webkit-keyframes alertPulse { 38 | 0% {background-color: #9A2727; opacity: 1;} 39 | 50% {opacity: red; opacity: 0.75; } 40 | 100% {opacity: #9A2727; opacity: 1;} 41 | } 42 | 43 | 44 | /* Make the element rotate infinitely. */ 45 | /* 46 | Usage 47 | .myElement { 48 | animation: rotating 3s linear infinite; 49 | } 50 | */ 51 | @keyframes rotating { 52 | from { 53 | -ms-transform: rotate(0deg); 54 | -moz-transform: rotate(0deg); 55 | -webkit-transform: rotate(0deg); 56 | -o-transform: rotate(0deg); 57 | transform: rotate(0deg); 58 | } 59 | to { 60 | -ms-transform: rotate(360deg); 61 | -moz-transform: rotate(360deg); 62 | -webkit-transform: rotate(360deg); 63 | -o-transform: rotate(360deg); 64 | transform: rotate(360deg); 65 | } 66 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Infinite: Useful CSS Animations 6 | 7 | 159 | 160 | 161 | 162 | 163 | 164 |
165 |

166 | ∞ 167 |
Useful infinite CSS animations that you can drop into your project.
168 |

169 | 170 |
171 | Get infinite.css v0.1 172 | Github 173 |
174 | 175 | 176 | 177 |
178 |

pulsate

179 |

This will generate a pulsating item that changes opacity and scale. I normally use it for loading indicators.

180 |
181 | 182 |

183 | .pulsate-css {
184 |     animation: pulsate 1s ease-out;
185 |     animation-iteration-count: infinite; 
186 |     opacity: 0.0;
187 | 
188 |     /* you dont need the stuff below, but its what I used to create the loading circle */
189 |     border: 3px solid #999;
190 |     border-radius: 30px;
191 |     height: 18px;
192 |     width: 18px;
193 |     position: relative;
194 |     display: inline-block;
195 |     margin-top: 20px;
196 |     text-align: center;
197 | }
198 |             
199 | 200 | 201 |

opacityPulse

202 |

This will generate an opacity pulse. Useful for muted text items.

203 |
204 |

Here is some text that will be pulsating.

205 |
206 | 207 |

208 | .opacityPulse-css {
209 |     animation: opacityPulse 2s ease-out;
210 |     animation-iteration-count: infinite; 
211 |     opacity: 1;
212 | }
213 |             
214 | 215 | 216 | 217 |

alertPulse

218 |

This will generate a background-color pulse. Since it is red, I call it an alert pulse.

219 |
220 |

Something is wrong.

221 |
222 | 223 |

224 | .alertPulse-css {
225 |     animation: alertPulse 2s ease-out;
226 |     animation-iteration-count: infinite;
227 |     opacity: 1;
228 |     background: #9A2727; /* you need this to specify a color to pulse to */
229 | }
230 |             
231 | 232 | 233 | 234 |

rotating

235 |

This will generate an infinitely rotating item. The speed is dependent on the animation duration (2s for this example).

236 |
237 | 238 |
239 | 240 |

241 | .rotating-css {
242 |     animation: rotating 2s linear;
243 |     animation-iteration-count: infinite;
244 | }
245 |             
246 |
247 |
248 | 252 | 253 | --------------------------------------------------------------------------------