Giter Club home page Giter Club logo

checkerboard-exercise's Introduction

DOM Manipulation Exercise

As always, fork and clone this repo. Submit the link to your fork when you're done.

Checkerboard

On the master branch, write code to generate a checkboard pattern as seen below:

Screen Shot 2015-05-12 at 9.28.07 PM.png

The Rules

Your index.html must look like this:

<!DOCTYPE html>
<html>
<head>
	<title>Checkerboard</title>
</head>
<body>
	<script type="text/javascript" src="script.js"></script>
</body>
</html>

You are not allowed to add any other elements to the html file, which means that you must create all the tiles dynamically. Same goes for CSS: no CSS in the html file or in a separate stylesheet. You must set all the style properties using Javascript.

Hints

  • Each tile should be a div
  • Each tile's width is 11.1%
  • Set each tile's float property to left
  • Each tile's paddingBottom is 11.1%

JUST TO REITERATE, YOU WILL NOT WRITE ANY HTML OR CSS FOR THIS EXERCISE. ONLY JS!!!

Random Colors

On a new branch called randomcolors, implement the following changes:

  1. Instead of being either red or black, each tile should be a random color. How do you generate random colors? You can use RGB or Hexadecimal as your color system.

Screen Shot 2015-05-12 at 10.19.59 PM.png

Gradient

On a new branch called gradient, write code to color the tiles using some sort of gradient. It does not need to look exactly like the image below, but it should have some sort of increasing/decreasing color values.

Screen Shot 2015-05-12 at 10.17.24 PM.png

Flashing Colors

On a new branch called flashing, write code to change each tile's color to a new random color every 2 seconds.

Bonus: Audio

Get some audio playing to accompany your trippy visuals, using only JS. No editing the HTML!

checkerboard-exercise's People

Contributors

colt avatar olitreadwell avatar bobbygrdn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.