Fancy canvas demo
Above, observe several things:
- A dot that moves left, rests, moves right, and repeats.
- A dot that appears in one place, appears further to the right,
rests, and repeats. (This dot tests conditional branching.)
- A dot that appears in one place, appears further to the right,
appears even further to the right, and repeats. (These periodic
animations all use the same state, and this dot displays that
state the most directly.)
- A dot that stays just where it is.
- A dot that can be controlled using the WASD keys.
- A box that follows the cursor.
Right now, these are actually rendered in locations that are
relative to the window's viewport. The canvas itself may appear in
the wrong place for you to see the dots, depending on your browser
fonts, user stylesheets, text wrapping, scroll position, and maybe
even zoom level.