Permalink
Browse files

some tweaks

  • Loading branch information...
1 parent 650b684 commit 97d23fbb6fc410397592d9a19723fd0c03e68476 @nulltask committed Apr 11, 2012
Showing with 28 additions and 27 deletions.
  1. +28 −27 mimics/pinterest/index.html
@@ -33,7 +33,7 @@
footer {
margin-top: 1em;
- text-align: right;
+ text-align: center;
}
.masonry {
@@ -198,52 +198,53 @@
, $masonry = $('.masonry')
, $footer = $('footer')
, spinnerOpts = {
- lines: 13, // The number of lines to draw
- length: 5, // The length of each line
- width: 2, // The line thickness
- radius: 6, // The radius of the inner circle
- rotate: 0, // The rotation offset
- color: '#000', // #rgb or #rrggbb
- speed: 1, // Rounds per second
- trail: 60, // Afterglow percentage
- shadow: false, // Whether to render a shadow
- hwaccel: false, // Whether to use hardware acceleration
- className: 'spinner', // The CSS class to assign to the spinner
- zIndex: 2e9, // The z-index (defaults to 2000000000)
- top: 'auto', // Top position relative to parent in px
- left: 'auto' // Left position relative to parent in px
- }
- , target = document.getElementById('spinner')
- , spinner = new Spinner(spinnerOpts).spin(target);
+ lines: 13, // The number of lines to draw
+ length: 5, // The length of each line
+ width: 2, // The line thickness
+ radius: 6, // The radius of the inner circle
+ rotate: 0, // The rotation offset
+ color: '#000', // #rgb or #rrggbb
+ speed: 1, // Rounds per second
+ trail: 60, // Afterglow percentage
+ shadow: false, // Whether to render a shadow
+ hwaccel: false, // Whether to use hardware acceleration
+ className: 'spinner', // The CSS class to assign to the spinner
+ zIndex: 2e9, // The z-index (defaults to 2000000000)
+ top: 'auto', // Top position relative to parent in px
+ left: 'auto' // Left position relative to parent in px
+ }
+ , target = document.getElementById('spinner')
+ , spinner = new Spinner(spinnerOpts).spin(target);
$masonry.masonry({
isFitWidth: true
});
for (var i = 0; i < 25; ++i) {
- var $item = $(itemTemplate.render({
- width: 250 + Math.round(Math.random() * 300)
- , height: Math.round(Math.random() * 100) + 150
- }));
+ var $item = getItemElement();
$masonry.append($item);
}
-
+
setTimeout(function() { $masonry.masonry('reload'); }, 500);
$footer.waypoint(function(e, direction) {
$(spinner.el).addClass('show');
for (var i = 0; i < 15; ++i) {
- var $item = $(itemTemplate.render({
- width: 250 + Math.round(Math.random() * 300)
- , height: Math.round(Math.random() * 100) + 150
- }));
+ var $item = getItemElement();
$masonry.append($item).masonry('appended', $item);
}
$masonry.masonry('reload');
setTimeout(function() {
$(spinner.el).removeClass('show');
}, 1000);
}, { offset: '100%' });
+
+ function getItemElement() {
+ return $(itemTemplate.render({
+ width: 250 + Math.round(Math.random() * 300)
+ , height: Math.round(Math.random() * 100) + 150
+ }));
+ }
});
</script>
<script>

0 comments on commit 97d23fb

Please sign in to comment.