A Pen by Randall Huynh on CodePen.
Created
June 29, 2018 07:13
-
-
Save RGHuynh/b97565d21cd6d68b7434cec5a55c55fb to your computer and use it in GitHub Desktop.
CSS Spinner animation
This file contains hidden or 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
| <div class="wrap"> | |
| <h1>SPINNERS</h1> | |
| <div class="spinner spinner-1"></div> | |
| </div> |
This file contains hidden or 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 { | |
| width: 100px; | |
| height: 100px; | |
| background: #eee; | |
| border-radius: 50%; | |
| position: relative; | |
| margin: 50px; | |
| display: inline-block; | |
| } | |
| .spinner:after{ | |
| content: ''; | |
| display: block; | |
| width: 100px; | |
| height: 100px; | |
| border-radius: 50%; | |
| } | |
| .spinner-1:after { | |
| position: absolute; | |
| top: -4px; | |
| left: -4px; | |
| border: 4px solid transparent; | |
| border-top-color: orangered; | |
| border-bottom-color: orangered; | |
| animation: spinny 2s linear infinite; | |
| } | |
| @keyframes spinny { | |
| 0% { | |
| transform: rotate(0deg); | |
| } | |
| 100% { | |
| transform: rotate(360deg); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment