Magic spot
Jun. 24th, 2004 10:41 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
For years, whenever my father has been learning a new programming environment (being a programmer since the late 60's, he's gone through a few), especially a new GUI environment, one of the things he'd implement as a test is a game he invented in the early 80s called "magic spot". It's a stupid little game, but it works as something to implement and get ones feet wet in a new environment.
Anyway, he's somehow avoided learning any HTML or related technologies until now, when he suddenly has to rewrite a huge bunch of asp forms with embedded client-side scripting.
So he's been picking my brain on and off and the other day sent me an initial implementation of magic spot with client-side VBScript. Of course, I can't view that in Mozilla, so I responded with my own version which will take advantage of client-side javascript if available, but will work just fine if javascript is turned off. (and works in both mozilla and ie, but may not work too well in old netscape 4)
An easier (and faster-loading) version
The source code
If you look at it in a browser that supports the css attribute :hover on arbitrary elements (like mozilla), you get the added benefit of being able to easily see which spot you're clicking.
Anyway, he's somehow avoided learning any HTML or related technologies until now, when he suddenly has to rewrite a huge bunch of asp forms with embedded client-side scripting.
So he's been picking my brain on and off and the other day sent me an initial implementation of magic spot with client-side VBScript. Of course, I can't view that in Mozilla, so I responded with my own version which will take advantage of client-side javascript if available, but will work just fine if javascript is turned off. (and works in both mozilla and ie, but may not work too well in old netscape 4)
An easier (and faster-loading) version
The source code
If you look at it in a browser that supports the css attribute :hover on arbitrary elements (like mozilla), you get the added benefit of being able to easily see which spot you're clicking.