Complete the painting analogy
This commit is contained in:
parent
08b5fe7384
commit
ff1a006ded
2
app.css
2
app.css
@ -44,7 +44,7 @@ main {
|
||||
width: 35.5px;
|
||||
}
|
||||
|
||||
.current {
|
||||
.brushColor {
|
||||
border: 1px solid #999999;
|
||||
border-radius: 3px;
|
||||
height: 35.5px;
|
||||
|
10
app.js
10
app.js
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user