@artube/loader
v2.1.1
Published
Two-phase partner loader for Artube UI
Keywords
Readme
Loader for Artube UI
Overview
This is a Vite plugin, that will inject Artube logo into a game's index.html during a build.
Usage
Update vite.config.ts
Add plugin to a game's vite.config.ts file:
import { defineConfig, UserConfig } from 'vite';
import { artubeLoader } from '@artube/loader'; // !!! import artube loader module
export default defineConfig(async (configEnv): Promise<UserConfig> => {
return {
plugins: [
artubeLoader(), // !!! add artube loader to the list of plugins
...Loader API
showLoader - display progress bar (hidden by default)
hideLoader - hides loader with fade out animation
updateProgress - updates width of progress bar (range 0..100)
Example:
import { LoaderViewController } from '@artube/loader';
// initialize controller
const artubeLoader = new LoaderViewController();
// display progress bar
artubeLoader.showLoader();
// update progress bar's width while loading
artubeLoader.updateProgress(progressPercents);
// hide progress bar once all resources are loaded
artubeLoader.hideLoader();