Commit db62ecd4cb25decccefa01a94e731c0827140fca

  • avatar
  • arvind
  • Wed Sep 03 15:23:07 IST 2014
Adding loading animation to linked-data page.
  • Diff rendering mode:
  • inline
  • side by side

swtr/static/css/swtmaker.css

164 left:100px;164 left:100px;
165 width: 100%165 width: 100%
166}166}
167
168.spinner {
169 width: 40px;
170 height: 40px;
171
172 position: relative;
173 margin: 100px auto;
174}
175
176.double-bounce1, .double-bounce2 {
177 width: 100%;
178 height: 100%;
179 border-radius: 50%;
180 background-color: #333;
181 opacity: 0.6;
182 position: absolute;
183 top: 0;
184 left: 0;
185
186 -webkit-animation: bounce 2.0s infinite ease-in-out;
187 animation: bounce 2.0s infinite ease-in-out;
188}
189
190.double-bounce2 {
191 -webkit-animation-delay: -1.0s;
192 animation-delay: -1.0s;
193}
194
195@-webkit-keyframes bounce {
196 0%, 100% { -webkit-transform: scale(0.0) }
197 50% { -webkit-transform: scale(1.0) }
198}
199
200@keyframes bounce {
201 0%, 100% {
202 transform: scale(0.0);
203 -webkit-transform: scale(0.0);
204 } 50% {
205 transform: scale(1.0);
206 -webkit-transform: scale(1.0);
207 }
208}

swtr/static/js/main.js

678 id: 'linked-data-container',678 id: 'linked-data-container',
679 initialize: function() {679 initialize: function() {
680 var self = this;680 var self = this;
681 this.loader_template = _.template($("#loader-template").html());
682 $("#linked-data-page").prepend(this.loader_template());
681 swtr.LDs = new LDSwts();683 swtr.LDs = new LDSwts();
682 swtr.LDs.getAll({684 swtr.LDs.getAll({
683 what: 'img-anno',685 what: 'img-anno',
684 success: function(data) {686 success: function(data) {
685 swtr.LDs.add(data);687 swtr.LDs.add(data);
686 if(!swtr.tagCloudView) {688 if(!swtr.tagCloudView) {
689 $("#spinner").remove();
687 swtr.tagCloudView = new TagCloudView({collection: swtr.LDs});690 swtr.tagCloudView = new TagCloudView({collection: swtr.LDs});
688 }691 }
689 }692 }

swtr/templates/index.html

403 <p><%= who %></p>403 <p><%= who %></p>
404 </li>404 </li>
405 </script>405 </script>
406 <script type="text/template" id="loader-template">
407 <div id="spinner" class="spinner">
408 <div class="double-bounce1"></div>
409 <div class="double-bounce2"></div>
410 </div>
411 </script>
406 </body>412 </body>
407</html>413</html>