Create your own pixel art maker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
THACHER ffd00ae104 example solution 8 years ago
.gitignore Initial commit 9 years ago
CNAME example solution 8 years ago
README.md example solution 8 years ago
app.js example solution 8 years ago
index.html example solution 8 years ago
pixel-art-maker-alt.png update example image and project description 9 years ago
pixel-art-maker.png Pixel Art Maker 9 years ago
style.css example solution 8 years ago

README.md

####Example solution deployed to surge

Pixel Art Maker

In this exercise, you'll create your own pixel art maker which will allow a user to choose colors from a palette and then paint pixel art. The interface is completely up to you, but it could look something like this.

Example of Pixel Art Maker

More specifically, your pixel art maker should allow a user to do the following.

  1. Start with a blank canvas of pixels.
  2. Select a brush color from a palette of colors.
  3. Paint the pixels on the canvas using the brush color.
  4. Repeat step 2.

Here's a development workflow that we recommend you use.

  1. Fork and clone this repository.
  2. Create a small, 2x2 grid canvas made up of white, square div tags with a border.
  3. Add an event listener to each div so when clicked the background turns red.
  4. Create a small palette of two colors (e.g. red and blue) below the canvas using more div tags.
  5. Add an event listener to these div tags so when clicked the brush color is saved.
  6. Expand the dimensions of the pixel canvas.
  7. Expand the palette with more colors. (i.e. red, orange, yellow, green, blue, purple, brown, gray, black, white, etc.)
  8. Expand the palette with a brush color indicator.
  9. Improve the look and feel of the canvas and color palette. Be careful not to break your program's behavior!

TIP: Check out this handy tool to see a list of all the named colors in CSS.

Bonus 1

Improve the mouse so it behaves like a real paintbrush. In other words, allow the user to paint by clicking and dragging across the canvas. For this, you'll need a combination of the mousedown, mouseenter, and mouseup events.

TIP: The mouseenter event doesn't bubble up the DOM tree.

Bonus 2

Add a color picker which allows the user to select any brush color using the <input type="color"> tag and the change event.

Deployment

Review the following articles on the Surge platform and then deploy your website to production.

A good domain name for this project is USERNAME-pixel-art-maker.surge.sh where USERNAME is your GitHub username in all lowercase letters. Once deployed and everything works as you expect, copy the URL to your site and paste it below.

PASTE YOUR PRODUCTION URL HERE