5k Advent Calendar

The 5k Advent Calendar uses JavaScript and cookies to display an Advent Calendar. Each day you can click the appropriately numbered link to reveal a new image that is (theoretically) evocative of the Christmas season, or that simply reminds us of something to appreciate or enjoy. You can open and close the "windows" whenever you like, though the cookie that remembers which windows you have opened is set to be deleted each year on December 31st. The total size of the HTML and image files that comprise the Advent Calendar is less than five kilobytes.

You can launch the calendar directly from your web browser's bookmarks or favorites if it supports JavaScript bookmarklets. Simply add this address as a bookmark:

javascript:window.open('http://justice.loyola.edu/~mcoffey/pr/5k/ac/c.html','c','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=237,height=347')

Your browser may warn you that using bookmarklets is a potential security risk, which is true, so you'll have to take my word for the fact that this one doesn't do anything besides open the Advent Calendar.

The images are intentionally secular, and as I am not much of an artist, it may be difficult to tell what some of them are. For either or both of these reasons, you may wish to borrow the code and make your own calendar. I encourage this, and in fact would be interested to hear about it if you make your version public.

The images that are to be revealed each day should be in GIF format and should probably have transparent backgrounds, although that may depend on how you change the background, if you do. My daily images are 10 pixels by 10 pixels to conserve bytes, but regardless of actual size, they are displayed at 20 pixels by 20 pixels.

The Advent Calendar may not display properly in some web browsers. I have found it to work correctly in recent versions of Internet Explorer, Netscape, and Opera on a Windows platform. I have observed it to fail in a recent version of Firefox, and have been told that it also fails (in a different way) in a recent version of Safari. If you observe different behavior, or discover a solution to any of these problems, I would be grateful to hear about it.

The Advent Calendar is released publicly under the terms of the GNU GPL. For some reason, I didn't keep a record of the meanings of each variable, as I have for my other 5k projects. The file is small, so hopefully it won't be too hard to decipher.


back to projects | back to the front