Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel Art Project as of July 10th AM #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" type="text/css" href="pixel-art-maker.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="pixel-art-maker.js"></script>
<title>Pixel Art!</title>
</head>

<body>
<div id="container">
<div id="canvas">
<div id="row1" class="row">

</div>

<div id="palette" class="pRow1">
<div class="turqoise color"></div>
<div class="green color"></div>
<div class="blue color"></div>
<div class="purple color"></div>
<div class="navy color"></div>
<div class="yellow color"></div>
<div class="orange color"></div>
<div class="red color"></div>
<div class="lightGrey color"></div>
<div class="grey color"></div>
<div class="black color"></div>
<div class="white color"></div>
<div class="current">Current</div>
<div class="eraser color">Eraser</div>
</div>
</div>

</div>

</body>

</html>
68 changes: 68 additions & 0 deletions pixel-art-maker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#container {
background:lightgrey;
height: 650px;
width: 90%;
padding-top: 20px;
/*border: 2px solid;*/
border-color: black;
margin-left:auto;
margin-right:auto;
border-radius: 2%

}

.row {
height: 570px;
margin-left:auto;
margin-right:auto;
margin-bottom:10px;
width: 93%;
/*border: 2px solid;*/
border-color: black;
}

.box {
width: 20px;
height: 20px;
margin: 0px 0px 0px 0px;
text-align: center;
float: left;
background-color: white;
border:2px solid lightgrey;

}

#palette {
height: 54px;
vertical-align: bottom;
margin-left: 1%;
}

.color{
height: 50px;
width: 50px;
border-radius: 50%;
display:inline-block;
border: 1.5px solid black;
padding: 0;
vertical-align: top;
}


.current{
height: 50px;
width: 100px;
padding: 0;
border: 2px solid black;
display:inline-block;
vertical-align: top;
}
.eraser{
height: 50px;
width: 100px;
padding: 0;
border: 2px solid black;
display:inline-block;
vertical-align: top;
border-radius: 0%;
}
48 changes: 48 additions & 0 deletions pixel-art-maker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
$(document).ready(function() {
console.log("ready!");

//colors
$('.turqoise').css('background-color', '#2ABB9C');
$('.green').css('background-color', '#39CA74');
$('.blue').css('background-color', '#3B99D8');
$('.purple').css('background-color', '#9A5CB4');
$('.navy').css('background-color', '#354A5D');
$('.yellow').css('background-color', '#F0C231');
$('.orange').css('background-color', '#E47E31');
$('.red').css('background-color', '#E54E42');
$('.lightGrey').css('background-color', '#ECF0F1');
$('.grey').css('background-color', '#95A5A6');
$('.black').css('background-color', 'black');
$('.white').css('background-color', 'white');
$('.eraser').css('background-color', 'white');

function fillGrid() {
for (var i = 0; i < 1127; i++) {
$('#row1').append('<div class="box"></div>')
}
}

fillGrid();

//choose color
var currentColor
$('.color').click(function() {
currentColor = $(this).css('background-color')
$('.current').css('background-color', currentColor);
})

//apply color
$('.box').click(function() {
$(this).css('background-color', currentColor);
$(this).css('border-color', currentColor)

})


for (var i = 0; i < 100; i++) {
$('box').append($('.box'))
}



});