A simple progress bar with included overlay.
npm install --save-dev ceri-progress
Progress = require("ceri-progress")
# load the theme (see below)
window.customElements.define("ceri-progress", Progress(require("ceri-progress/materialize")))
progress = document.createElement("ceri-progress")
# block document.body with indetermined progress bar
progress.show({el:document.body, timeout: 5000, onTimeout: => return})
# change to determined progress bar with 10 percent progress
progress.percent = 10
# hide again
progress.hide()
the progress bar can be used as a mixin within other ceri components:
...
mixins: [
require("ceri-progress/mixin")(require("ceri-progress/materialize"))
]
...
methods:
doSomething: ->
setPercent = @$progress({el:this})
setPercent(50)
setPercent() # close
- setup ceri-materialize and load the scss.
// and this additional requirement
@import "~ceri-progress/materialize";
- load theme file
Progress = require("ceri-progress")
window.customElements.define("ceri-progress", Progress(require("ceri-progress/materialize")))
For example see dev/materialize
.
Clone repository.
npm install
npm run dev
Browse to http://localhost:8080/
.
- use ceri-materialize@2
Copyright (c) 2017 Paul Pflugradt Licensed under the MIT license.