/* (cs)spinner.css - http://jh3y.github.io/-cs-spinner Licensed under the MIT license Jhey Tompkins (c) 2014. 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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. */ /* BASE */ .csspinner { position: relative; } .csspinner:before { content: ""; z-index: 1; position: absolute; top: 0; left: 0; display: block; height: 100%; width: 100%; background-color: #999999; opacity: 0.6; } .csspinner:after { z-index: 2; content: ""; height: 40px; width: 40px; position: absolute; top: 50%; left: 50%; margin: -20px 0 0 -20px; transition: all .75s ease 0s; -webkit-transition: all .75s ease 0s; border-radius: 100%; border-top: 4px solid #555555; animation: standard .75s infinite linear; -webkit-animation: standard .75s infinite linear; } .csspinner.no-overlay:before { content: none; display: none; } /* STANDARD ROTATION ANIMATION */ @-webkit-keyframes standard { from { -webkit-transform: rotate(0deg); } to { -webkit-transform: rotate(360deg); } } @keyframes standard { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } /* TRADITIONAL */ .csspinner.traditional:after { border-right: 4px solid #777777; border-top: 4px solid #777777; border-left: 4px solid #999999; border-bottom: 4px solid #bbbbbb; } /* DOUBLE UP*/ .csspinner.double-up:after { border-right: 4px solid #e74c3c; border-top: 4px double #e74c3c; border-left: 4px double #e74c3c; border-bottom: 4px double #e74c3c; } /* DUO */ .csspinner.duo:after { border-right: 4px solid #333333; border-left: 4px solid #333333; border-top: 4px solid #f1c40f; border-bottom: 4px solid #f1c40f; } /* SPHERICAL */ .csspinner.sphere.horizontal:after, .csspinner.sphere:after { border-radius: 100%; animation: sphere .5s infinite; -webkit-animation: sphere .5s infinite; border: none; height: 40px; } .csspinner.sphere.vertical:after { border-radius: 100%; animation: sphere-v 0.5s infinite; -webkit-animation: sphere-v 0.5s infinite; border: none; height: 40px; } @-webkit-keyframes sphere { from { box-shadow: inset 45px 0px 10px rgba(0, 0, 0, 0.5); } to { box-shadow: inset -45px 0px 10px rgba(0, 0, 0, 0.5); } } @keyframes sphere { from { box-shadow: inset 45px 0px 10px rgba(0, 0, 0, 0.5); } to { box-shadow: inset -45px 0px 10px rgba(0, 0, 0, 0.5); } } @-webkit-keyframes sphere-v { from { box-shadow: inset 0px 45px 10px rgba(0, 0, 0, 0.5); } to { box-shadow: inset 0px -45px 10px rgba(0, 0, 0, 0.5); } } @keyframes sphere-v { from { box-shadow: inset 0px 45px 10px rgba(0, 0, 0, 0.5); } to { box-shadow: inset 0px -45px 10px rgba(0, 0, 0, 0.5); } } /* BAR */ .csspinner.bar:after { height: 20px; width: 40px; border-radius: 0; border: none; animation: bar 1s infinite linear; -webkit-animation: bar 1s infinite linear; } @-webkit-keyframes bar { from { box-shadow: inset 0px 0px 0px rgba(0, 0, 0, 0.5); } to { box-shadow: inset 80px 0px 0px rgba(0, 0, 0, 0.5); } } @keyframes bar { from { box-shadow: inset 0px 0px 0px rgba(0, 0, 0, 0.5); } to { box-shadow: inset 80px 0px 0px rgba(0, 0, 0, 0.5); } } .csspinner.bar.follow:after { animation: bar-follow 1s infinite linear; -webkit-animation: bar-follow 1s infinite linear; } @-webkit-keyframes bar-follow { 0% { box-shadow: inset 40px 0px 0px rgba(0, 0, 0, 0.5); } 100% { box-shadow: inset -40px 0px 0px rgba(0, 0, 0, 0.5); } } @keyframes bar-follow { 0% { box-shadow: inset 40px 0px 0px rgba(0, 0, 0, 0.5); } 100% { box-shadow: inset -40px 0px 0px rgba(0, 0, 0, 0.5); } } /* LINE */ .csspinner.line:after { height: 20px; border-radius: 0; border: none; box-shadow: inset -10px 0px 0px rgba(0, 0, 0, 0.5); animation: line .75s infinite linear; -webkit-animation: line .75s infinite linear; } @-webkit-keyframes line { from { width: 10px; } to { width: 50px; } } @keyframes line { from { width: 10px; } to { width: 50px; } } .csspinner.line.grow:after { animation: line 0.75s infinite linear, line-grow 0.75s infinite linear; -webkit-animation: line 0.75s infinite linear, line-grow 0.75s infinite linear; } @keyframes line-grow { 0% { transform: scaleY(1); -webkit-transform: scaleY(1); } 50% { transform: scaleY(2); -webkit-transform: scaleY(2); } 100% { transform: scaleY(1); -webkit-transform: scaleY(1); } } @-webkit-keyframes line-grow { 0% { transform: scaleY(1); -webkit-transform: scaleY(1); } 50% { transform: scaleY(2); -webkit-transform: scaleY(2); } 100% { transform: scaleY(1); -webkit-transform: scaleY(1); } } /* LINE BACK AND FOURTH */ .csspinner.line.back-and-fourth:after { animation: line-back-and-fourth 1s infinite linear; -webkit-animation: line-back-and-fourth 1s infinite linear; } @-webkit-keyframes line-back-and-fourth { 0% { width: 10px; } 50% { width: 50px; } 100% { width: 10px; } } @keyframes line-back-and-fourth { 0% { width: 10px; } 50% { width: 50px; } 100% { width: 10px; } } .csspinner.line.back-and-fourth.grow:after { animation: line-back-and-fourth 1s infinite linear, line-back-and-fourth-grow 1s infinite linear; -webkit-animation: line-back-and-fourth 1s infinite linear, line-back-and-fourth-grow 1s infinite linear; } @keyframes line-back-and-fourth-grow { 0% { transform: scaleY(1); -webkit-transform: scaleY(1); } 25% { transform: scaleY(2); -webkit-transform: scaleY(2); } 50% { transform: scaleY(1); -webkit-transform: scaleY(1); } 75% { transform: scaleY(2); -webkit-transform: scaleY(2); } 100% { transform: scaleY(1); -webkit-transform: scaleY(1); } } @-webkit-keyframes line-back-and-fourth-grow { 0% { transform: scaleY(1); -webkit-transform: scaleY(1); } 25% { transform: scaleY(2); -webkit-transform: scaleY(2); } 50% { transform: scaleY(1); -webkit-transform: scaleY(1); } 75% { transform: scaleY(2); -webkit-transform: scaleY(2); } 100% { transform: scaleY(1); -webkit-transform: scaleY(1); } } /* BOX SHADOWING */ .csspinner.shadow:after { animation: spin-shadow 0.25s infinite linear; -webkit-animation: spin-shadow 0.25s infinite linear; border-radius: 100%; border: none; } .csspinner.shadow.oval.left:after, .csspinner.shadow.oval:after { animation: spin-shadow 0.25s infinite linear; -webkit-animation: spin-shadow 0.25s infinite linear; border-radius: 100%; border: none; border-radius: 40% 100%; } .csspinner.shadow.oval.right:after { animation: spin-shadow 0.25s infinite linear; -webkit-animation: spin-shadow 0.25s infinite linear; border-radius: 100%; border: none; border-radius: 100% 40%; } @-webkit-keyframes spin-shadow { 0% { box-shadow: inset 5px 5px 5px rgba(0, 0, 0, 0.5); } 25% { box-shadow: inset -5px 5px 5px rgba(0, 0, 0, 0.5); } 50% { box-shadow: inset -5px -5px 5px rgba(0, 0, 0, 0.5); } 100% { box-shadow: inset 5px -5px 5px rgba(0, 0, 0, 0.5); } } @keyframes spin-shadow { 0% { box-shadow: inset 5px 5px 5px rgba(0, 0, 0, 0.5); } 25% { box-shadow: inset -5px 5px 5px rgba(0, 0, 0, 0.5); } 50% { box-shadow: inset -5px -5px 5px rgba(0, 0, 0, 0.5); } 100% { box-shadow: inset 5px -5px 5px rgba(0, 0, 0, 0.5); } }