Make app less shocking when CSS fails to load.

We now have a stand-in message that says "Loading CSS...", which
only gets hidden once the CSS loads.  This is a better user
experience than seeing completely unformatted Zulip HTML on the
page.  The message is set to fill the whole page, and it's cleared
once zulip.css gets loaded.

(imported from commit 613fe3d6a39197aabfeb63823b7fad75834bb9eb)
This commit is contained in:
Steve Howell 2013-11-25 17:05:08 -05:00
parent d25f0a7580
commit aea01d54ac
2 changed files with 22 additions and 0 deletions

View File

@ -4,6 +4,10 @@ html {
overflow-x: hidden;
}
#css-loading {
display: none !important; /* We are now loaded, by definition. */
}
body {
font-family: 'Humbug', 'Helvetica Neue', Helvetica, Arial, sans-serif;
overflow-y: auto;

View File

@ -17,6 +17,19 @@ var page_params = {{ page_params }};
{% block customhead %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
#css-loading {
background: white;
position: fixed;
height: 100%;
width: 100%;
padding: 0px;
top: 0px;
left: 0px;
}
</style>
{% if nofontface %}
{# We can't use @font-face on qtwebkit, so use differently minified CSS #}
@ -32,6 +45,11 @@ var page_params = {{ page_params }};
{% endblock %}
{% block content %}
<div id="css-loading">
<h3>Loading CSS...</h3>
<p>If this message does not go away, please wait a couple seconds and reload the page.</p>
</div>
<div id="top-screen" class="screen"></div>
<div id="bottom-screen" class="screen"></div>
<div id="left-screen" class="screen"></div>