Last active
August 22, 2022 18:53
-
-
Save codearachnid/7b383cd7c0c84d69e622afd2c5cc8489 to your computer and use it in GitHub Desktop.
Gravity Forms full page spinner
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
img.gform_ajax_spinner { | |
position: fixed !important; | |
z-index: 999999; | |
left: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
display: block !important; | |
overflow: hidden !important; | |
width: 100% !important; | |
height: 100% !important; | |
background-color: rgba(0,0,0); | |
/* fall back */ | |
background-color: rgba(0,0,0,0.7); | |
url('/wp-content/uploads/.../preloading.gif'); /* fallback GIF spinner */ | |
/* awesome svg loaders from http://samherbert.net/svg-loaders/ */ | |
background-image: linear-gradient(transparent,transparent), url('/wp-content/uploads/.../pulse.svg'); /* SVG spinner */ | |
background-repeat: no-repeat; | |
background-size: 60px 60px; | |
background-position: center center; | |
} |
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
<?php | |
add_filter("gform_ajax_spinner_url", "transparent_spinner_url", 10, 2); | |
function transparent_spinner_url( $image_src, $form ){ | |
// locally load https://commons.wikimedia.org/wiki/File:Transparent.gif | |
return '/wp-content/uploads/.../transparent.gif'; | |
} |
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
<?php | |
add_filter('upload_mimes', 'inject_svg_mime_types'); | |
function inject_svg_mime_types($mimes) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment