I calculated: index.html, CSS, and JS files. Just three files. The HTML file contains just the usual links to the CSS and JS files, and an element for the randomiser. That’s it. The JS file contains what I imagined to be a simple function to pick from an array of quotes. So simple. What could go wrong? Well, remember that time you wanted to have the computer open a program automatically at a specified time and you thought it would take 5 minutes but it took like 4 hours?
Then I could work on the CSS, which wasn’t bad, just tedious. Changed sizes and colours and floated things left and right and, vitally, realised that I did not know what the standards for these things were. I was just making things up on the fly. I’m sure there are standards. Right? I have to return to Colleen Van Lent’s lectures and read up on conventions and other things.
In particular, I spent a lot of time trying to figure out how to make the background cycle through all the colours of the colour wheel. Apparently, that’s a tough one. Most tutorials tell you about how to cycle through just a few colours. At least I learn that. It was at this point that I found -webkit- codes. My first brush with it and it’s confusing. I kind of get what it is, but not really.
And then, because someone’s onclick function worked for him but didn’t work for me even though I’m very sure it should, I had to look into addEventListener, at which point I discovered that the fight between Netscape and Microsoft over event handling left us with and inconvenient piece of heritage: confusing events order. Naturally, I had to wonder why they couldn’t get their shit together. Anyway, I read the linked article, and I will likely forget it until it comes back to bite me on the behind.
I also learnt that document.getElementById() is different from document.getElementById().innerHTML. But I don’t know how and I don’t know when to use either, and tutorials and lectures don’t seem to explain the difference between them. I got by on trial and error on this one, and several other things. Not ideal.
Finally, the randomiser worked. And now, I wanted to go on to the next phase. I want users to input quotes. But, I need some sort of CMS. Something like Flask? So each user has his/her own account. The gap betwixt seems the length and breadth of Thanatos’ scythe. But, what with the Law of Diminishing Marginal Returns (that is, I got tired) setting in, I became more and more unwilling to research things properly and experiment. Next weekend then!
If this post is a bit confusing with too many irregular bits thrown in, that’s because it reflects what beginning programming feels like. You think the learning curve is linear, but more often than not, it turns into a bewildering mess in the blink of an eye.