From 40d65e5582bfce979feb65152ef1bad87c0d5076 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 14 Feb 2019 11:25:01 -0600 Subject: [PATCH] add loading screen --- docs/demo/demo.css | 4 +++ docs/demo/demo.js | 4 +++ docs/demo/index.html | 83 +++++++++++++++++++++++--------------------- 3 files changed, 51 insertions(+), 40 deletions(-) diff --git a/docs/demo/demo.css b/docs/demo/demo.css index 8502d49190..398c663a51 100644 --- a/docs/demo/demo.css +++ b/docs/demo/demo.css @@ -62,6 +62,10 @@ header h1 { flex-grow: 1; } +#main { + display: none; +} + .error { border-color: red; background-color: #FEE diff --git a/docs/demo/demo.js b/docs/demo/demo.js index a343440523..2e5198adb3 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -11,6 +11,8 @@ onunhandledrejection = function (e) { throw e.reason; }; +var $loadingElem = document.querySelector('#loading'); +var $mainElem = document.querySelector('#main'); var $markdownElem = document.querySelector('#markdown'); var $markedVerElem = document.querySelector('#markedVersion'); var $commitVerElem = document.querySelector('#commitVersion'); @@ -73,6 +75,8 @@ Promise.all([ handleOutputChange(); checkForChanges(); setScrollPercent(0); + $loadingElem.style.display = 'none'; + $mainElem.style.display = 'block'; }); function setInitialText() { diff --git a/docs/demo/index.html b/docs/demo/index.html index faae46fa60..7d21663695 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -18,52 +18,55 @@

Marked Demo

-
-
-
- Input · - · - Version: - - · - - +
Loading...
+
+
+
+
+ Input · + · + Version: + + · + + +
+ +
- - -
-
-
- · - Response Time: - -
+
+
+ · + Response Time: + +
-
- - -
+
+ + +
- + - + - + +