Skip to content

Instantly share code, notes, and snippets.

@martinratinaud
Created November 22, 2018 12:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martinratinaud/d3f01d21392a9bd6cf3e4faa188beec6 to your computer and use it in GitHub Desktop.
Save martinratinaud/d3f01d21392a9bd6cf3e4faa188beec6 to your computer and use it in GitHub Desktop.
Improve first contentful paint in react
<div id="root">
<div class="full-page-loader">
<img width="200" src="/logo/aiptrade-vertical-color-color.png" alt="AIP.Trade logo" />
</div>
</div>
.full-page-loader {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
}
.full-page-loader > img {
animation: 1.8s infinite heartbeat;
}
@keyframes heartbeat {
0% { transform: scale(1); }
25% { transform: scale(1.05); }
50% { transform: scale(1); }
75% { transform: scale(1.05); }
100% { transform: scale(1); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment