How to Create a Preloader in Sitepad

How to Create a Preloader in Sitepad

Since we have previously discussed how to create a preloader in WordPress using both Elementor and Gutenberg, what if you want to create a preloader, but in Sitepad?

In this article, we will discuss the complete guide to creating a preloader in Sitepad so that when your website is accessed, there will be a loading animation that can make its appearance more attractive.

How to Create a Preloader in Sitepad

Because WordPress and Sitepad use the same concept and you even use the Pagelayer plugin in WordPress if you want to edit pages like in Sitepad, the way to create a preloader is also almost the same.

But before starting, make sure you have:

  • Logged in to the Sitepad admin page
  • Uploaded the image used for the preloader, usually with a .gif extension

As additional information, this tutorial will create a preloader that runs on all website pages that use Sitepad. If you want to create a preloader on just one page, you can edit only the page where you want to add the preloader.

1. Edit Header Template

Once you are on the WordPress dashboard page, you can open the Templates page and then edit the existing Header section

If you are not immediately directed to the Sitepad editor, you can click the link Edit using Pagelayer

2. Create a New Row

Add a new Row by clicking the Add New Row button when you are on the Pagelayer editor page

3. Add a CSS ID to the Row

Once you have added a new Row, you can add a CSS ID, for example preload-wpg by clicking the pencil icon, then opening the Options > Custom CSS

tab

4. Add an Image

Now you can add an image to the Row you just added. Here you can add the preloader image you have prepared

5. Add Custom HTML

Once the image has been added to the Row, you can add a Custom HTML block inside the same Row so that the preloader runs

<script> document.addEventListener('DOMContentLoaded', function () {        setTimeout(function () {            document.getElementById('preload-wpg').style.display = 'none';        }, 2000);    });</script><style>#preload-wpg {    position: fixed;    top: 0;    left: 0;    min-height: 100vh;    width: 100%;    height: 100%;    background: #fff; /* preloader background color */    z-index: 9999;    display: flex;     justify-content: center;     align-items: center;}</style>

With the code above, the preloader will be displayed for 2 seconds. If you want to make it longer, you can change 2000 to a higher number.

6. Publish and Check the Results

Now you can publish or update the Header template and see the results. If successful, when you access the website or open a page, there will be a preloader like this

That is the easy way to create a preloader in Sitepad. If you have not installed Sitepad yet, you can install it by following this tutorial: How to Install Sitepad on Hosting

Written by

Muhammad Khoirun Nasikin

I enjoy tinkering with WordPress, hosting, VPS, web development, and various small experiments related to websites. I have over 3 years of experience in the web hosting industry.

COMMENTS

Loading...