Permalink
Browse files

added flickr-photoset js thingy

  • Loading branch information...
1 parent 24b13f5 commit 781e47d57f56982a9fc6e51d5aec797c6ff4833e @zackham zackham committed Mar 2, 2013
Showing with 47 additions and 3 deletions.
  1. +32 −0 _layouts/default.html
  2. +2 −3 _posts/2013-02-27-Quick-Tip-Winter-Commuting.markdown
  3. +13 −0 stylesheets/main.css
View
32 _layouts/default.html
@@ -74,6 +74,38 @@
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+<script type="text/javascript">
+function flickrizer($el, photosetId) {
+ var apiKey = "60d192bb5d2d100c53aaad6f0438cf8f";
+ $.getJSON("http://api.flickr.com/services/rest/?jsoncallback=?", {
+ format: 'json',
+ api_key: apiKey,
+ method: 'flickr.photosets.getPhotos',
+ photoset_id: photosetId
+ }, function(data) {
+ $.each(data.photoset.photo, function(i,photo) {
+ var imgBaseUrl = "http://farm" + photo.farm + ".static.flickr.com/" + photo.server + "/" + photo.id + "_" + photo.secret + "_",
+ imgSmallUrl = imgBaseUrl + "m.jpg",
+ imgLargeUrl = imgBaseUrl + "b.jpg",
+ $box = $("<div class='flickr-img-box'></div>");
+
+ $("<a href='" + imgLargeUrl + "' class='colorbox'></a>").append(
+ $("<img/>").attr("src", imgSmallUrl)
+ ).appendTo($box);
+ $el.append($box);
+ $el.after("<div style='clear:left;'></div>");
+ });
+ $el.find('.colorbox').colorbox();
+ });
+}
+$(function() {
+ $('.flickr-photoset').each(function() {
+ var id = $(this).attr('data-id');
+ console.log(id);
+ flickrizer($(this), id);
+ });
+});
+</script>
<script src="http://ridewithgps.com/javascripts/colorbox.js"></script>
<link rel="stylesheet" href="http://ridewithgps.com/stylesheets/colorbox.css" />
<script>
View
5 _posts/2013-02-27-Quick-Tip-Winter-Commuting.markdown
@@ -16,12 +16,11 @@ Mid winter sneaks up and life begins to change. One of the more notable changes
Late winter might best be described as having a splinter that is so deep you can't remove it. There's a moment, when on a ride the wind will cut through my layers and chill me to the bone. From this point on logic and reason are dismissed from the wardrobe selection process and instead I just wear every piece of warm clothing I own, because, well, it's cold and dark out. At this point, the temperature that in "Early Winter" didn't even warrant a long sleeve jersey now deserves a thermal jacket and tights.
-<a class="colorbox" href="http://farm9.staticflickr.com/8373/8511863044_bb75d431af_b.jpg"><img src="http://farm9.static.flickr.com/8373/8511863044_bb75d431af_m.jpg" title="Winter Bike Commuting"/ height="200px" width="300px"></a>&nbsp;<a class="colorbox" href="http://farm9.staticflickr.com/8087/8511861704_09a659ef06_b.jpg"><img src="http://farm9.static.flickr.com/8087/8511861704_09a659ef06_m.jpg" title="Winter Bike Commuting"/ height="200px"></a>&nbsp;<a class="colorbox" href="http://farm9.static.flickr.com/8109/8511862228_201a0855bd_b.jpg"><img src="http://farm9.static.flickr.com/8109/8511862228_201a0855bd_m.jpg" title="Winter Bike Commuting"/ height="200px"></a><br />
-<a class="colorbox" href="http://farm9.static.flickr.com/8367/8511863612_cbcdf53c5a_b.jpg"><img src="http://farm9.static.flickr.com/8367/8511863612_cbcdf53c5a_m.jpg" title="Winter Bike Commuting"/ height="200px" width="400px"></a>&nbsp;<a class="colorbox" href="http://farm9.static.flickr.com/8366/8511862446_b390a363ab_b.jpg"><img src="http://farm9.static.flickr.com/8366/8511862446_b390a363ab_m.jpg" title="Winter Bike Commuting"/ height="200px"></a>&nbsp;
-<a class="colorbox" href="http://farm9.static.flickr.com/8251/8511862620_97ae413785_b.jpg"><img src="http://farm9.static.flickr.com/8251/8511862620_97ae413785_m.jpg" title="Winter Bike Commuting"/ height="200px"></a>&nbsp;
+<div class="flickr-photoset" data-id="72157632869725594"></div>
Usually in late winter I can also feel the drain of the winter bike commute mentally as my decision making on and off the bike diminish. Just last week I was riding to the office on a cold morning after a snow storm, and instead of riding the snow bike (the obvious bike to ride) I convinced myself that the road bike was adequate for the conditions. I made it out the snow covered driveway, and down the snow packed alley to the ice skating rink that is called "the street" and within 100ft I was reminded of why I wear a helmet. *Special note: there's nothing like sliding down an icy street on your backside to start your day off right!*
I wouldn't trade or stop bike commuting for anything, so luckily there is a positive aspect of the "Late Winter Chill" and that is, it means SPRING is right around the corner. Soon the afternoons will be filled with warm rides that wont require leg-warmers, arm-warmers, caps, or any other similar layers. The moral of the story is, don't let old man winter get you down!
Do you have any similar winter riding or commuting experiences? We invite you to comment below regarding *{{ page.title }}*.
+
View
13 stylesheets/main.css
@@ -86,3 +86,16 @@ img.postimage {
#post-pagination .current-page {
color: #ccc;
}
+
+.flickr-img-box {
+ margin: 2px;
+ float: left;
+}
+.flickr-img-box img {
+ height: 180px;
+ -ms-interpolation-mode: bicubic;
+}
+
+.flickr-photoset {
+ clear: both;
+}

0 comments on commit 781e47d

Please sign in to comment.