Git Product home page Git Product logo

ember-cli-pace's Introduction

Pace.js load progress bar for Ember apps, incl. initial scripts lazy loading

Downloads Code Climate Ember Observer Score David Dependencies

Installation

Using latest Ember-cli, run the command:

ember install ember-cli-pace

or for older versions:

npm install ember-cli-pace && ember g pace

Flash-like initial script loading

Due to application scripts loading may take some time (especially, using mobile networks or ADSL), Ember-cli-pace can load them asynchronously displaying correctly computed progress bar. To enable that feature, just change src attribute to pace-src in your app.html.

<script pace-src="assets/vendor.js"></script>
<script pace-src="assets/app.js"></script>

Therefore, the scripts will be loaded via AJAX, which allows to compute loaded vs total bytes ratio. If your scripts are located on separate host, please note CORS policy.

Configuration

All options, excluding color and theme related to the addon, are documented on http://github.hubspot.com/pace/.

var ENV = {
  pace: {
  
    // addon-specific options to configure theme
    theme: 'minimal',
    color: 'blue',
    
    // pace-specific options
    // learn more on http://github.hubspot.com/pace/#configuration
    //           and https://github.com/HubSpot/pace/blob/master/pace.coffee#L1-L72
    catchupTime: 50,
    initialRate: .01,
    minTime: 100,
    ghostTime: 50,
    maxProgressPerFrame: 20,
    easeFactor: 1.25,
    startOnPageLoad: true,
    restartOnPushState: true,
    restartOnRequestAfter: 500,
    target: 'body',
    elements: {
      checkInterval: 100,
      selectors: ['body', '.ember-view']
    },
    eventLag: {
      minSamples: 10,
      sampleCount: 3,
      lagThreshold: 3
    },
    ajax: {
      trackMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'],
      trackWebSockets: true,
      ignoreURLs: []
    }
  }
};

Themes

This addon is bundled with Material spinner theme, which is set by default. See it on demo page.

Pace.js originally provides 14 progress bar themes in 10 colors. See the progress bars and spinners in action: http://github.hubspot.com/pace/docs/welcome/

Pace.js themes

Pace API

More details on Pace events, methods and configuration could be found on http://github.hubspot.com/pace/

Developing ember-cli-pace

  • git clone this repository
  • npm install
  • bower install
  • ember server
  • Visit your app at http://localhost:4200.

For more information on using ember-cli, visit http://www.ember-cli.com/.

ember-cli-pace's People

Contributors

vectart avatar dyatko avatar laantorchaweb avatar jamesdixon avatar joshsmith avatar andybluntish avatar justin-lau avatar rsutphin avatar ember-tomster avatar

Watchers

James Cloos avatar jeancantu avatar Luiz Carraro 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.