Portfolio on Bootstrap.

Scroll backward.
Then scroll forward.


*

FAIQ

(Frequently Asked & Idle Questions)





Frequently Asked and Idle Questions

Does this thing have any earthly use?

Yes, it fills a serious need. I thought the need was obvious until I found that some people just didn't "get it" at all. So here is the simple explanation:

It allows you to have NEW CONTENT appear EACH DAY, automatically. There are many reasons why you might want this. You might be building a news page. Or perhaps you have a module called "This Day In History" or "Whose Birthday Is it Today?" or "Planetary Aspects for Today."

For this kind of daily-update project, there are two must-haves:

1) Since your content is usually different each day, you must have each day's new content "go live" automatically when that day starts (midnight).

2) You want people to be able to look at yesterday's news, and last week's news, but not tomorrow's! You want to be able to keep editing tomorrow's content up to the last minute.

And most likely this is also important:
3) The solution has to be lightweight and easy to use.

There are content-management systems and blogging platforms that allow you to "publish" an article at some point in the future (e.g., WordPress, Drupal), but these are self-contained environments, not add-ons to your existing site.

Wunderwidget has two main pieces: the javascript itself, which you never have to open up or adjust; and the HTML wrapper that goes around your news page or module. To set up the widget in your own site, you need to provide your own content divs, and set a couple of basic parameters: How many days back do you want to be able to scroll in this calendar year? and If you can scroll back to the previous calendar year, how far back do you wish to scroll in that one? There is also a stylesheet, and some jQuery to enable simple transitions as you scroll from one day to another.

The ideal use of this is for short-term projects that will run for a fortnight or a month. Beyond that, you'd probably want a full-blown CMS with database, simply because you’ll have so much content to store. But it can and does work with a full 365 (or 366) days of content.

Why Isn't This Thing Just a Slideshow?

Because a simple javascript/css slideshow will not give you date-specific content, or today's news, every day.

If you don't need to provide date-specific content every day, a simple slideshow may be all you need. Personally I am very fond of Mike Alsup's cycle.js, a jQuery plugin that is lightweight and flexible, and has been implemented a thousand different ways around the inter-webs. (Get it here, along with other useful and fun projects.)

I scrolled backwards and forwards, but when I got back to today and tried to click ahead I got an alert message saying I couldn't see tomorrow. Why don't you want people to see tomorrow?

I don’t want people to see tomorrow because that’s the whole point of the module. It is supposed to stir up excitement, curiosity, and return visits to the website. If you could scroll ahead and see everything coming up in the next week, there wouldn't be much point in coming back tomorrow, would there? And in that case, why bother having dates at all? You might as well just have a plain old slideshow carousel.

And finally, anyone who’s that curious can just look at the source code and see if anything’s in place for the upcoming DOY (day of year). I'm betting most people are too lazy to do that.

Why couldn't you build it in jQuery?

There is no jQuery plugin or function that returns the current date and day of year, and can count backwards (or forwards) from that point. The purpose of jQuery is to simplify the long, stringy, cumbersome parts of Javascript. The date methods of Javascript are already as basic as you can get, and cannot be reduced further.

For a similar reason, the Wunderwidget cannot be refashioned as a jQuery plugin without losing most of its utility. The closest approximation would be a jQuery plugin that would have you pick a date, whereupon it would return some content for that date. But this would be little different from a basic slideshow. It would not be able to count backwards and forwards from the date you initially select, nor would it "know" when it reached today's date and could no longer scroll ahead.

Does it use backbone.js?

This question was intended as a joke, but it brings up a good point. If you created a complex date-driven website that needed to keep track of many days' relationship to each other (a scheduling program, perhaps), then backbone.js might well be the way to go. But Backbone here would be overkill (as indeed it is in most implementations we see these days).

Ditto Angular.js?

It will, Oscar, it will.

Is this site "responsive"?

Up to a point, Lord Copper. It wasn’t, now it is.

What about closures? Does it use closures?

Oh boy does it ever. If you had 366 days of content, and you scrolled back and forth a million times, the whole universe would slowly grind to a halt.

Any other further enhancements coming?

Yes, I want to make up some crazy-simple algorithm to disguise the source code for each day’s content. Right now each day’s content is pretty obvious to anyone who looks at the source: day191, day192, day193, etc. Those identifiers are created by making a text string out of the word "day" and the numeric DOY (Day of Year). If we made it a little more complicated—say, multiplied the DOY by 3 and added 34, and attached the number to something other than ‘day’—instead of day191 we could have foo607. I'm not sure it's worth the bother.


For further information, contact

Liz Houston at Wunderwidget Sales & Breeding: elizabeth.houston@wunderwidget.com

There aint no Liz Houston round here ha ha ha