Wulf

Adam Wulf

This site is an outlet for my thoughts on web UI development, best practices, tutorials, and a home to my various projects. Read more about me.

Recent Posts

Contact

adamwulf

LinkedIn

Head Tracking App for iPhone! Sorta!

June 18th, 2009 · No Comments

The day has finally arrived. We are finally living in the future. Buck just sent me a link that head tracking for the iPhone is real (kinda). The horseless carriage and printing press have nothing on this!

Just barely over a year ago, I posted that somebody should build a head-tracking iPhone app. Since the iPhone can’t literally track your head/eyes, it couldn’t be “real” head tracking, but it could infer from the accelerometer well enough… and sure enough someone has done just that! Awesome!

The good folks over at Drömsynt have fullfilled my dream and built Diorama, the first head-tracking-but-not-really iPhone app in the entire universe ever. They even built stereoscopic-i-need-blue-red-glasses 3d into it (?!) incredible! I am purchasing it right now.

→ No CommentsTags: iphone

Dynamic Multi-Page Multi-Column Newsletter Layout with Columnizer

June 18th, 2009 · 1 Comment

A Columnizer Case Study

Sample Page LayoutI got an interesting email this week, asking about how to use Columnizer to help layout a multipage and multicolumn newsletter. The length of the content would vary from week to week, so the newsletter needed to be grow/shrink to as many pages as necessary. It also needed a custom header and footer for each page.

Here’s the sample page showing the solution in action.

The HTML

How does it work? Let’s take a look at the source, beginning with the HTML:


<body>
	<div id="page_template">
		<div class='header'>This is a header<hr></div>
		<div class='content'></div>
		<div class='footer'><hr><span>Page: </span>This is the footer.</div>
	</div>
	<div id="newsletterContent"> Newsletter Content Goes Here</div>
</body>

We define the template for what we want each page to look like. For our case, every page will have the exact same header and footer (with the page number shown in the footer), and page content should be split into 2 columns. Beneath our template, we just print out the entire contents of the newsletter that we want columnized.

Columnizing the Content

Our basic algorithm will be:

  1. Copy the page template and append it to the bottom of the <body>
  2. Columnize what’s in #newsletterContent into that last page until it’s full
  3. Put whatever doesn’t fit back into #newsletterContent
  4. Repeat until #newsletterContent is empty

Awesome, so lets see that in real life code:


		$(function(){
			// the height of the content, discluding the header/footer
			var content_height = 652;
			// the beginning page number to show in the footer
			var page = 1;
			function buildNewsletter(){
				if($('#newsletterContent').contents().length > 0){
					// when we need to add a new page, use a jq object for a template
					// or use a long HTML string, whatever your preference
					$page = $("#page_template").clone().addClass("page").css("display", "block");

					// append the page number to the footer
					$page.find(".footer span").append(page);
					$("body").append($page);
					page++;

					// here is the columnizer magic
					$('#newsletterContent').columnize({
						columns: 2,
						target: ".page:last .content",
						overflow: {
							height: content_height,
							id: "#newsletterContent",
							doneFunc: function(){
								console.log("done with page");
								buildNewsletter();
							}
						}
					});
				}
			}
			buildNewsletter();
		});

The Result

Check out the fully columnized and multi-paged newsletter sample, and be sure to check out the Columnizer project page for more samples, documentation, and of course, to download Columnizer!

It’s been really fun over the past few months to see how different people are using Columnizer. If your site uses Columnizer, give me a shout in the comments, I’d love to check it out!

→ 1 CommentTags: javascript · programming · user interface

Better (?) FriendFeed Stats in Feedburner

June 18th, 2009 · No Comments

Friendfeed now reports subscriber counts to feedburner, so you have a more accurate view of your total subscriber counts all in one place. This is particularly good news for a data nerd like me, since the Friendfeed API doesn’t even let you find out your ff subscriber count.

Friendfeed in Feedburner

There is a down side, however, as Kevin notes at bloggingtips.

In my opinion this is an incredibly bad move from FeedBurner. It is incredibly easy to get people to subscribe to an RSS feed through FriendFeed. Just like Twitter, many people follow anyone who follows them. This means that the feedburner count can be very easily manipulated to show a higher count than it actually has.

There’s absolutely some truth to that, and comments in freindfeed’s blog post go further.

I push out a full feed, so those subscribers are getting the content. They are the equivalent of site visitors. Friendfeed merely publishes the headline so that is a very different kind of subscription.

Absolutely true. I’m in the same boat, my feed has the entire article, but friendfeed shows only headlines.

On a similar topic, I was excited not long ago about the idea of automatically subscribing to my twitter followers blogs in friendfeed. It was a dead simple way to subscribe to all their blogs and get some awesome content - but it turned out that headlines-only-feeds pretty much suck. Awesome opportunity gone. Anyone else have any good soultions for massively subscribing to a twitter followers’ blogs?

→ No CommentsTags: other



Page 1 of 2912345»...Last »