ansilove.js

A script to display ANSi and artscene related file formats on web pages
Log | Files | Refs | README | LICENSE

commit 8eddf196e1dbc0d02867c950b46dcc45291dbea7
parent c0988696d48e3933b64f5791b107869c1477e56e
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Sat,  9 Nov 2013 11:01:53 +0000

Add option for a loading 'spinner'.

Diffstat:
Mansilove.js | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -1837,6 +1837,9 @@ var AnsiLove = (function () { var divOverlay, divCanvasContainer; function slideUpContainer() { + if (options.spinner) { + applyStyle(divOverlay, {"background-image": "none"}); + } transitionCSS(divCanvasContainer, "top", "0.6s", "ease-in-out", {"top": "0"}); } @@ -1880,6 +1883,9 @@ var AnsiLove = (function () { } divOverlay = createDiv({"position": "fixed", "left": "0px", "top": "0px", "width": "100%", "height": "100%", "background-color": "rgba(0, 0, 0, 0.8)", "overflow": "scroll", "z-index": (findHighestZIndex() + 1).toString(10), "opacity": "0"}); + if (options.spinner) { + applyStyle(divOverlay, {"background-image": "url(" + options.spinner + ")", "background-position": "center center", "background-repeat": "no-repeat"}); + } divCanvasContainer = createDiv({"background-color": "black", "box-shadow": "0 8px 32px rgb(0, 0, 0)", "margin": "8px auto", "padding": "16px", "border": "2px solid white", "border-radius": "8px", "top": "100%"}); divOverlay.appendChild(divCanvasContainer);