If the browser has JavaScript disabled, instead of generating and spinning the wheel on the client-side, clicking spin the wheel submits a form… To make the spinner work without js was surprisingly simple. This ended up being just ~1.2kB of js - with room for further optimization. I found this tutorial on synthesizing drum sounds and tweaked the hi-hat example to fit. Luckily for me, I know a synth enthusiast, and he explained some of the terminology to me. But instead I chose to generate a click with JavaScript and the Web Audio API Something I hadn't even heard of before now. I'm sure there are lots of clever ways of reducing the file size of audio. Using it would have put me over the 30kB budget. I found an mp3 of a click, but even at less than 1 second long, it weighed 7kB. It was important that the spinner have a satisfying clicking sound as it spun. every tool should have a no javascript fallbackįor this tool there we're some interestng hurdles to overcome:.the site should be as accessible as possible.I want the site to be a success, so i first took a look at the competition and - for reasons I'll elaborate on in another post - decided that: For various reasons there are times when you need to roll dice, flip cards, or spin a spinner online. I've been building a website of simple tools for boardgame players. I'd really appreciate any feedback on improving it, i've been staring at it for a week!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |