Hi, ok if you don’t know what a sprite is then this post might get confusing quite quickly.  I’d suggest having a quick read up and find out what they are.  Simply put, the technique of using a CSS Sprite is so that you can reduce the number of HTTP requests browsers make to your server by only showing a portion of a larger image by changing the background-position (so that only the bit you want to see is showing through the object).  Another use for them (and this is the one we’ll be using here) is for convenience.

A pie chart of increasing values 0-100% could be stored as 20 separate independent images, named pie-[00-100].gif.  This however is inefficient for both the browser, the server, and the user.  The user will have to wait for the image to download if they haven’t already seen it (and hence cached it).  In my example I have 20 pie charts of increasing values in one image.  The background-position css property will dynamically change via server-side code to show only one of the 20 available pie charts.

Here’s the finished article:

pie-finalresultHere’s how it was done…

Continue reading »

 

Thanks to the great constructive criticism at http://www.logospire.com/logos/1155 I went and redesigned the logo.  (I’m loving logospire at the moment)

I hope this new design fairs better!  I went for a clean tall and thin font and placed in some minimalist art above.  I could also experiment with some reflection (i don’t mean nasty web2.0 reflection, but some classy stuff) but for the moment I like this. Now i just got to find a way of implementing it into the site design i’ve come up with

 

Ok, so I promised this a long time ago but I’ve hardly had the time to work on it and now it’s finally here.  A beta version of my twitter clone.

http://www.speedyshare.com/635861674.html

There is a setting you can add to your settings.py to change the number of chirps that show on a single page (default 15): NUMBER_OF_CHIRPS_PER_PAGE

Lots of things have changed! Please look through the code, I’ve commented it so it should be easy to follow (please note as of yet there is no user recognition when @someone is typed in the content of a chirp- That’ll come later)

 

It’s always good to keep web pages clean and free of clutter to focus the user experience on what really is important.  For this matter, it’s nice to be shown the difference between the time now and the time something was posted in a informal way such as below:

timetoggle-normal

So if you still wanted this uncluttered view but still desired to allow the user to see the exact moment that was, then maybe you’d have to let the user check a checkbox in their user settings are show an exact time when the view of that object is more detailed.  However I’ve come up with the idea that on mouseover the nice and informal ‘time since’ can be replaced with an exact time of the post in an easy custom filter.

Here’s the same chirp as shown above but with the mouse hovering over the time.

timetoggle-mouseover

When the mouse is rolled back out, the informal time since is displayed again.

Seamless user experience showing more detail when the user wants it :)

from django.utils import timesince, dateformat

@register.filter
def timetoggle(time, id):
link = "<span id=\""+str(id) + "timesince\"> about <a href=\"#\" onmouseover=\"document.getElementById('"+str(id)+"timeactual').style.display=''; document.getElementById('"+str(id)+"timesince').style.display='none';return false;\">"
link += timesince.timesince(time)
link += " ago</a> </span><span id=\""+str(id)+"timeactual\" style='display:none'> at <a href=\"#\" onmouseout=\"document.getElementById('"+str(id)+"timeactual').style.display='none'; document.getElementById('"+str(id)+"timesince').style.display='';return false;\">"
link += dateformat.DateFormat(time).format("g:ia o\\n l jS N Y")
link += "</a></span>"
return mark_safe(link)

Use in the following way: {{ time_object|timetoggle:unique_identifier }}   Here’s an example: {{ post.pub_date|timetoggle:post.id }}

 

It’s like saying “a seller” with a lisp.

/əˈθɛlər/
uh-the-luh

© 2011 athe.la blog Suffusion theme by Sayontan Sinha