0.4.6 • Published 4 years ago
vevet-core v0.4.6
Vevet - a JavaScript library with useful stuff
The library contains classes that can allow you to create Page Routing, Sliders, Timelines and animations, etc.
Initialize
First of all, install Vevet.
# NPM
npm i vevet
Import Vevet.
import * as Vevet from 'vevet';
@import '~vevet/dist/scss/index';
The library consists of four parts, in general: Application, Core and Event.
- Application - this class is used to initialize Vevet. It is required by modules in properties.
- Core - just a set of functions that are frequently used in the library.
- Events - the basis of all modules.
- Modules.
Initialize an application.
let app = new Vevet.Application({
prefix: 'v-',
page: ['home']
});
Now you can use all features of the library. F.e., include some modules:
// initialize preloader
let preloader = new Vevet.Preloader({
selector: '.my-preloader',
progress: {
on: true,
animate: true
}
});
// add progress callbacks
preloader.add({
target: 'progressAnimate',
do: (data) => {
console.log(`Progress: ${data.progress}`);
console.log(`Resources loaded: ${data.loaded}`);
console.log(`Resources total: ${data.total}`);
}
});
// add hidden callback
preloader.add({
target: 'hidden',
do: () => {
alert("The preloader was hidden");
}
});
0.4.6
4 years ago