Skip to content

Instantly share code, notes, and snippets.

@superstrong
Created August 26, 2014 18:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superstrong/910a279e43703b97d285 to your computer and use it in GitHub Desktop.
Save superstrong/910a279e43703b97d285 to your computer and use it in GitHub Desktop.
Knewton HubSpot Redirection Page with Spinner
<html>
<head>
<title>{{ content.html_title }}</title>
<meta name="description" content="{{ content.meta_description }}"/>
<meta name="robots" content="noindex">
<style>
.spinner {
position: fixed;
top: 50%;
left: 50%;
margin-top: -9px;
margin-left: -9px;
}
.spinner > div {
width: 18px;
height: 18px;
background-color: #333;
border-radius: 100%;
display: inline-block;
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
animation: bouncedelay 1.4s infinite ease-in-out;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.spinner .bounce1 {
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
.spinner .bounce2 {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
</style>
</head>
<body>
{{standard_header_includes}}
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
{{standard_footer_includes}}
<script type="text/javascript">
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
var code = getQueryVariable("{% text "x" label="URL parameter in original URL", no_wrapper=True %}")
setTimeout(function() {
window.location.href="{% text "destination URL" label="Destination URL with query string", no_wrapper=True %}" + code;
}, 2000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment