you can do it using jQuery
add a div in webpage or master page with id
<div id="iconloading"></div>
use css for it, change the path of gif as per your requirement
#iconloading {
position: fixed;
width: 100%;
height: 100vh;
background: #fff url('images/loader.gif') no-repeat center center;
z-index: 9999;
}
add below jQuery code in your script
<script>
jQuery(document).ready(function() {
jQuery('#iconloading').fadeOut(3000);
});
</script>