Skip to content

Instantly share code, notes, and snippets.

@camillebaldock
Last active October 13, 2015 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camillebaldock/6da9fbaa1637c58f652c to your computer and use it in GitHub Desktop.
Save camillebaldock/6da9fbaa1637c58f652c to your computer and use it in GitHub Desktop.
Prototype: GOV.UK template with spinner

Sharing a piece of work done as part of a prototype that relies on a mapping service that takes up to 2 minutes to respond.

This is an attempt at a loading page for that prototype.

Original spinner code from: http://projects.lukehaas.me/css-loaders/

The only changes made to it are to match GOV.UK colours, we are also using the govuk_template.

The CSS3 spinning animation degrades to "Loading..." text for older browsers.

<main id="content">
<h1 class="heading-xlarge">Please wait while we generate your report...</h1>
<p class="lede">This could take up to 2 minutes.</p>
<div class="loader">Loading...</div>
</main>
.loader {
font-size: 10px;
margin: 50px auto;
text-indent: -9999em;
width: 11em;
height: 11em;
border-radius: 50%;
background: #ffffff;
background: -moz-linear-gradient(left, #005ea5 10%, rgba(255, 255, 255, 0) 42%);
background: -webkit-linear-gradient(left, #005ea5 10%, rgba(255, 255, 255, 0) 42%);
background: -o-linear-gradient(left, #005ea5 10%, rgba(255, 255, 255, 0) 42%);
background: -ms-linear-gradient(left, #005ea5 10%, rgba(255, 255, 255, 0) 42%);
background: linear-gradient(to right, #005ea5 10%, rgba(255, 255, 255, 0) 42%);
position: relative;
-webkit-animation: load3 1.4s infinite linear;
animation: load3 1.4s infinite linear;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.loader:before {
width: 50%;
height: 50%;
background: #005ea5;
border-radius: 100% 0 0 0;
position: absolute;
top: 0;
left: 0;
content: '';
}
.loader:after {
background: #ffffff;
width: 75%;
height: 75%;
border-radius: 50%;
content: '';
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
@-webkit-keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment