Created
July 4, 2019 08:14
-
-
Save mklasen/d694e20463cc91f516ced3b625e703c0 to your computer and use it in GitHub Desktop.
Replace the loading spinner in Gravity Forms by a CSS spinner
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
class MyTheme { | |
public function __construct() { | |
$this->hooks(); | |
} | |
public function hooks() { | |
add_filter( 'gform_ajax_spinner_url', array($this, 'replace_gform_spinner'), 10, 2 ); | |
} | |
public function replace_gform_spinner( $image_src, $form ) { | |
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; | |
} | |
} |
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
$blue = blue; | |
$white = white; | |
.gform_ajax_spinner { | |
margin-left: 20px; | |
border: 4px solid rgba($white, 0.5); | |
border-left: 4px solid rgba($lightblue, 0.7); | |
animation: spinner 1.1s infinite linear; | |
border-radius: 50%; | |
width: 30px; | |
height: 30px; | |
} | |
@keyframes spinner { | |
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