Giter Site home page Giter Site logo

load.js's Introduction

What is load.js

load.js is a tiny javascript/css loader written in Javascript (4KB minified code!). Based on l.js, with awesome Youtube-like loading bar integrated.

Installation

To use load.js in production code, you need to:

<link href="lib/load.css" rel="stylesheet">
<script src="lib/load.js"></script>

For debug, you should use load.debug.js:

<script src="lib/load.debug.js"></script>

How to use?

// Define your resources list here
var urls = [
"javascript.js",
"style.css",
"http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js",
"bootstrap.css",
"bootstrap.js"
];

load.all(urls, function(){
    // DONE!
});

Default color, with callback

load.all(urls, function(){
    // DONE!
});

Custom color, available color: green, red, yellow, orange, blue, violet, white

load.all("red", urls, function(){
    // DONE!
});

Keep the loading bar after loaded. Color must be included!

load.all("red", urls, function(){
    // DONE!
}, true);

Environment setup for contributors

For setup development environment, you need to have:

  • NodeJS
  • Gulp
  • BrowserSync
  • UglifyJS
  • UglifyCSS

To install these packages, just run:

npm install

Run development server

Development server help you:

  • Automatically refresh browser on edit
  • Minify Javascript and CSS files

You can find minified Javascript and CSS file (for production) in lib folder.

To run development server:

gulp serve

load.js's People

Contributors

huytd avatar

Stargazers

Stephan Ahlf avatar Huy Nguyen Quang avatar Tung Nguyen avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.