Go Back
isotope - masonry layout
Getting Started
- read the notes section on jacobhoffman.tk/lessons on arrays, for loops, and getElementByClassName.
- make a new repl html, css, js project
- copy the lesson 3
index.html, script.js, and style.css code into the repl
- hit run on the repl, you should see a grid of squares coming on the screen
- feel free to delete the directions in the index.html file, since they are already on this page.
- go to the bottom of the code, where it says var "gridChoice = 3"
- try changing the variable from 1 to 5, what happens for each one?
Grid Changes
- set gridchoice = 1
- go to the grid1() function
- change "red" in the array to "blue"
- hit run on the repl, what happens?
- try adding some additional colors you like.
- set gridchoice = 2
- go to the grid2() function
- change "(-i + j)" to "(i+j)" . what happens? how about "(2*i + j)"?
- set gridchoice = 3 and go to grid3(). this is a very simple grid function
- challenge : set gridchoice = 4 and try writing your own grid4() function
- set gridchoice = 5 and try hitting the wasd keys. look through the code in the grid game section.