Complete the painting analogy

This commit is contained in:
Ryan Sobol 2016-05-15 10:34:01 -07:00 committed by Brent Gardner
parent 08b5fe7384
commit ff1a006ded
2 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,7 @@ main {
width: 35.5px;
}
.current {
.brushColor {
border: 1px solid #999999;
border-radius: 3px;
height: 35.5px;

10
app.js
View File

@ -70,13 +70,13 @@ var drawPalette = function() {
}
var heading = document.createElement('h2');
heading.textContent = 'CURRENT COLOR >';
heading.textContent = 'BRUSH COLOR >';
var current = document.createElement('div');
current.className = 'current';
var brushColor = document.createElement('div');
brushColor.className = 'brushColor';
palette.appendChild(heading);
palette.appendChild(current);
palette.appendChild(brushColor);
palette.addEventListener('click', function(event) {
if (event.target.className !== 'color') {
@ -84,7 +84,7 @@ var drawPalette = function() {
}
brush = event.target.style.background;
current.style.background = brush;
brushColor.style.background = brush;
});
}