The Problem
For a fanforum I’m hosting I had to think of new features for which people would be willing to donate. And we came up with one of the most used things on a forum, signatures.
The Solution
However, we wanted to make it extra special, so how were we going to deal with that? So we came up with the idea to make them dynamic, interactive. When a signature is for example hovered on, it would show additional information about that user. Which in turn, if the user decides to use his signature on multiple forums would also give us free advertisement.
The Approach
Then we started discussing which method we would be using, one would be pure PHP, generated with raw images and text using GD (ImageMagick wasn’t supported on our hosting environment). We would try two methods, and see which one is liked the most. One using Flash, and one using HTML5 and canvas.
The Battle
Personally, I never really liked Flash, so I stuck with HTML5/Canvas, and tried it with pure canvas, but then got into trouble when I drew Gif images, they didn’t move. So I looked around the web browsing for a solution. Then stumbled upon a sweet library named RaphaĆ«l. Which gave me a much easier DSL than pure canvas, but used SVG instead. And also supplied a nice fallback method if SVG wasn’t supported. Which in turn would mean I didn’t have to go look for polyfills on older browsers.
The Result
Personally I’m fairly happy with how this all turned out, after heavily refactoring the draw methods.
Example
The Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
Conclusion
TODO: Write conclusion