Use script.js

You can use script.js to get the service status from the IsMyAppOnline API without writing a custom script.


Importing script.js

Import the script into your html file like this:

index.html
<head>
    <!-- rest of your head -->
    <script src="./script.min.js" defer></script>
</head>

You can download a minified version of the script here or use jsdelivr:

index.html
<head>
    <!-- rest of your head -->
    <script src="https://cdn.jsdelivr.net/gh/Fabian-Kleine/ismyapponline-template/script.min.js" defer></script>
</head>

Using script.js

To use script.js first follow the instructions in the customization guide.

Further you have to define the following CSS classes when you want the text color to be changed depending on the state.

Note that you only have to define the classes when you are not using Bootstrap.

.text-success {
    color: #198754;
}

.text-danger {
    color: #dc3545;
}

.text-warning {
    color: #ffc107;
}

Find out more on how to create a custom script or the custom status: