This one was inspired by Keep It Straight and of course Jaws, the movie! It’s my first time using <li> elements instead of <div> elements to make rectangular shapes. One funny thing that happened was when I asked Richerd if I should incorporate selected level as a parameter for the animate function. He said something along the lines of “you don’t need to ask me, just do it” and I was thinking to myself “that means yes, I’m right, I’m smart”… and ended up typing this.
Err, selectedSmart instead of selectedLevel? Not so smart after all… or just a little absent-minded. We type what we think!
I used css animation to move the bars and used mouse leave/enter to detect whether the user had entered the beginning/ending sections or touched the bars. Originally I had the play again button inside the container but this was silly as the user would keep getting “fail” as they left the game container. I moved it below instead.
No matter the level, if you make it from the green to blue, you are rewarded with MC Hammer’s awesome dance moves.
Day 35 – Jaws