Tag: JavaScript

  • RGB Colour Game UI update

    RGB Colour Game UI update

    Tonight I got a bit of time to work on a new version of RGB colour game. This time I focused mostly on UI improvements so the game looks a little nicer than the first release. I’m particularly fond of the subtle CSS transition when you click on an incorrect colour. Little touches like this…

  • I made a thing – Colour Game

    I made a thing – Colour Game

    I made another thing in JavaScript as part of the course I’m doing. This time it’s a simple colour picker game. The code is still very rough but the app is effectivly working. If you want to see it in action you can play the current version. The idea of the game is the player…

  • We’ve all got issues

    We’ve all got issues

    Since I’ve been learning JavaScript I’ve been making an effort to do things as if I was working with others. The idea being that any project of meaning is very likely a collaborative one. To my mind understanding how to effectively work with others on a coding project is as important as the coding itself.…

  • I made a thing – Score keeper

    I made a thing – Score keeper

    I’ve been doing a web development course for a few months and today I made my first thing that actually does something. Nothing amazing mind you, but it’s a start. Do you ever have the need to keep score in a best 2 out of 3 kind of way? Me neither, but here’s a web…

  • Listen to your heart

    Listen to your heart

    JavaScript is responsible for the behaviour of your website/app. At the heart of affecting the behaviour of the page is listening for user interaction events. These are things like button clicks, key presses and drags and drops. To do this, first we select an element then we add an event listener. To add an event…

  • DOM DOM DOM

    DOM DOM DOM

    Playing with the DOM is all about adding interactivity to your page. The DOM (Document Object Model) is the interface between your JavaScript and your HTML+CSS. The browser takes all the elements of your page and turns it into a JavaScript object. All the elements of the DOM for your page are contained in the…

  • Load scripts last

    Load scripts last

    So you’ve got your HTML and CSS sorted and you’ve started to drop in some customs scripts to make things a bit interactive. To keep things in shape it pays to develop some good habits early on. One such habit is placing your scripts just before the closing body tag like this: We do this…

  • No Comments

    No Comments

    When I was first learning to code, something that came up a lot was to always comment your code. Code comments have value, but despite what my teachers at the time may have thought, you should try not to rely on comments. This isn’t to say you shouldn’t communicate to the reader what the code…

  • DRY variables

    DRY variables

    The concept of DRY code is simple, Don’t Repeat Yourself. So if you look at some code you’ve just written and notice it’s looking a bit moist, AKA the same stuff repeating over and over, there’s a good chance it’s an opportunity to refactor. This is also true with variable declaration. Take the this example:…