MCPcopy Create free account
hub / github.com/TruthHun/BookStack / barPositionCSS

Function barPositionCSS

static/nprogress/nprogress.js:321–335  ·  view source on GitHub ↗

* (Internal) returns the correct CSS for changing the bar's * position given an n percentage, and speed and ease from Settings

(n, speed, ease)

Source from the content-addressed store, hash-verified

319 */
320
321 function barPositionCSS(n, speed, ease) {
322 var barCSS;
323
324 if (Settings.positionUsing === 'translate3d') {
325 barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' };
326 } else if (Settings.positionUsing === 'translate') {
327 barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' };
328 } else {
329 barCSS = { 'margin-left': toBarPerc(n)+'%' };
330 }
331
332 barCSS.transition = 'all '+speed+'ms '+ease;
333
334 return barCSS;
335 }
336
337 /**
338 * (Internal) Queues a function to be executed.

Callers 1

nprogress.jsFile · 0.85

Calls 1

toBarPercFunction · 0.85

Tested by

no test coverage detected