Hi All,
FIRST OF ALL: THE DEMO PAGE
You may have noticed that any Softr page loads their blocks in an ugly way, sometimes (blocks are loaded one by one then re-arranged… not very cool UX).
So, you also may have noticed that when you enter the Softr public community (made in Discourse) there is a loading background displayed, waiting for all the content to be fully loaded before displaying the page content.
Let’s do the same for your app!
I) Code to be inserted in the header of your page or app (for all the pages) settings
<style>
#loading-spinner {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
opacity: 1;
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
#loading-spinner i {
font-size: 60px;
color: #000000;
}
</style>
II) Code to be inserted in the footer of the page or app (for all the pages) settings
<div id="loading-spinner">
<i class="fas fa-spinner fa-spin"></i>
</div>
<script>
window.addEventListener('load', function() {
var spinner = document.getElementById('loading-spinner');
spinner.style.display = 'none';
});
</script>
Precision: in the first code it is possible to set a blur effect. In order to do this, replace 1 by 0.9 or 0.8 in this line of code in the <style>
, opacity: 1;
The spinner is customizable (size and color) here: #loading-spinner i { font-size: 60px; color: #000000; }
The white background can be of an other color if you change this line of code: background-color: white;
Thanks