diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-10-15 22:36:58 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-10-15 22:36:58 -0400 |
commit | 43dc1e9dcc762be0f0e24c80f862f8425b093133 (patch) | |
tree | 4fe2171b55d607c3b33016440cb11dd03b26682a /css | |
parent | c45bbaf0c3aaf91150088d5153bfaa86c092fdf7 (diff) |
js: Add loading spinner to packages page.
* css/guix.css: Add spinner styles.
* js/controller/packages.js (guix.packages.view): Explicitly redraw
after loading packages.
* js/model/packages.js (guix.packages.Packages): Load packages in the
background.
* js/view/layout.js (guix.withLayout): Cast elem to array if needed.
* js/view/packages.js (guix.packages.view): Render spinner when there
are no packages to display.
Diffstat (limited to 'css')
-rw-r--r-- | css/guix.css | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/css/guix.css b/css/guix.css index 0534209..040f239 100644 --- a/css/guix.css +++ b/css/guix.css @@ -13,3 +13,107 @@ .sorter { cursor: pointer; } + +/* Loading Spinner */ + +@-webkit-keyframes spinner { + 0% { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -ms-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-moz-keyframes spinner { + 0% { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -ms-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-o-keyframes spinner { + 0% { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -ms-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes spinner { + 0% { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -ms-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +/* :not(:required) hides this rule from IE9 and below */ +.spinner:not(:required) { + -webkit-animation: spinner 1500ms infinite linear; + -moz-animation: spinner 1500ms infinite linear; + -ms-animation: spinner 1500ms infinite linear; + -o-animation: spinner 1500ms infinite linear; + animation: spinner 1500ms infinite linear; + -webkit-border-radius: 0.5em; + -moz-border-radius: 0.5em; + -ms-border-radius: 0.5em; + -o-border-radius: 0.5em; + border-radius: 0.5em; + -webkit-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0; + -moz-box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0; + box-shadow: rgba(0, 0, 51, 0.3) 1.5em 0 0 0, rgba(0, 0, 51, 0.3) 1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) 0 1.5em 0 0, rgba(0, 0, 51, 0.3) -1.1em 1.1em 0 0, rgba(0, 0, 51, 0.3) -1.5em 0 0 0, rgba(0, 0, 51, 0.3) -1.1em -1.1em 0 0, rgba(0, 0, 51, 0.3) 0 -1.5em 0 0, rgba(0, 0, 51, 0.3) 1.1em -1.1em 0 0; + display: inline-block; + font-size: 18px; + width: 1em; + height: 1em; + margin: 1.5em; + overflow: hidden; + text-indent: 100%; +} + +.spinner-container { + width: 1em; + margin: 0 auto; + padding: 32px; +} |