Giter Club home page Giter Club logo

iron-router-progress's Introduction

iron-router-progress

Implements a simple progress bar, when loading different routes. Example running at: https://iron-router-progress.meteor.com/

Installation

Use Atmosphere to install the latest version of iron-router-progress.

$ mrt add iron-router-progress

Customization

It's mostly all CSS (LESS), and you can pretty much just override the CSS with whatever you want.

For the most part, you'll want to change the #iron-router-progress's background-color and box-shadow like this:

#iron-router-progress {
	background-color : <COLOR>;
	box-shadow       : 0 0 5px <COLOR>;
}

Automatic ticks

By default, the progress bar will tick every 0.75-1.5 seconds, after you start loading a route.

If you want to disable this behaviour you can do it either globally by:

IronRouterProgress.configure
	tick : false

Or by route definition:

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			tick : false

Spinner

By default, a spinner is running, on the far right of the page, when loading.

You'll most likely want to just change the border-color like this:

#iron-router-progress.spinner:before {
	border-color : <COLOR>;
}

If you don't like the spinner, simply disable it with:

IronRouterProgress.configure
	spinner : false

Or by route definition:

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			spinner : false

Enable the progress bar, only for certain routes

If you don't want to use the progress bar for all routes, you can disable it globally, and enable it on the route level:

IronRouterProgress.configure
	enabled : false

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			enabled : true

Or if you just want it disabled for certain routes:

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			enabled : false

Delay the progress from showing up on fast routes

If you don't want to see the progress-bar for 'fast' routes, you can set a delay (time in ms) in which you would like for the progress to wait, before showing up. Global delay:

IronRouterProgress.configure
	delay : 100

Or per route:

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			delay : 100

You can enable it globally, and disable it for specific routes like this:

IronRouterProgress.configure
	delay : 100

Router.map ->
	@route 'home',
		path     : '/'
		progress :
			delay : false

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.