Justin starts a blog

Photo
For today’s March Madness program I wanted to try to do something useful with the canvas tag.  I decided it would be nice to be able to programmatically generate a background gradient for a web page based on the time of day.  If you’re looking at the site in the morning the colors would be different from afternoon, sunset, midnight, etc.  I created a hidden canvas tag to do my work and then used the toDataURL method to pass the resulting image to the body’s CSS. Source

For today’s March Madness program I wanted to try to do something useful with the canvas tag. I decided it would be nice to be able to programmatically generate a background gradient for a web page based on the time of day. If you’re looking at the site in the morning the colors would be different from afternoon, sunset, midnight, etc. I created a hidden canvas tag to do my work and then used the toDataURL method to pass the resulting image to the body’s CSS. Source

Posted on Sunday, March 7 2010.
3
Notes
  1. ericmortensen reblogged this from justinday
  2. mikehudack liked this
  3. ultrafastx liked this
  4. nickdivers liked this
  5. justinday posted this
Justin starts a blog

nyc. hacker. blip.tv. vegan. drunkard.

Previous Next