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

added js file as well as draft 1 of my pixel maker #74

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
57 changes: 57 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>Joolee's PIXEL MAKER!!!</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Cabin+Sketch" rel="stylesheet">
<script src="javascript.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">

</head>
<body>
<div class="container-fluid">
<h1>joolee's pixel maker</h1>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
<table class="grid">

</table>
<div class="palette">
<div class="black"></div>
<div class="blue"></div>
<div class="purple"></div>
<div class="brown"></div>
<div class="palebrown"></div>
<div class="orange"></div>
<div class="lightorange"></div>
<div class="apricot"></div>
<div class="yellow"></div>
<div class="lime"></div>
<div class="green"></div>
<div class="darkgreen"></div>
<div class="forestgreen"></div>
<div class="indigo"></div>
<div class="violet"></div>
<div class="blueyum"></div>
<div class="cauliflower"></div>
<div class="coolblue"></div>
<div class="turquoise"></div>
<div class="paleblue"></div>
<div class="white"></div>
<div class="gray"></div>
<div class="mauve"></div>
<div class="darkgray"></div>
<div class="purple"></div>
<div class="red"></div>
<div class="crimson"></div>
<div class="pink"></div>
<div class="yummygreen"></div>
<div class="myfav"></div>
</div> <!--end of palette-->
</div>
<div class="col-md-1"></div>
</div>
</div>
</body>
</html>
34 changes: 34 additions & 0 deletions javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var width='100'
var height='45'
var selected_color

document.addEventListener('DOMContentLoaded', function() {
var grid = document.querySelector('.grid')

var palette = document.querySelector('.palette')
// var pixel = document.querySelector('tr td')


for (var i = 0; i < height; i++) {
var line = document.createElement('tr')
grid.appendChild(line) //create row
for (var y = 0; y < width; y++){
var pixel = document.createElement('td') //create pixel
pixel.classList.add('cell')
line.appendChild(pixel)
}
}


palette.addEventListener("click", function(e) {
selected_color = e.target.className //picks up color
document.addEventListener("click", function(e){
var clicked = e.target //click on pixel
console.log(clicked)
clicked.classList = selected_color //whatever you click
})

})


})
170 changes: 170 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
.container-fluid {
max-width: 100vw;
max-height: 100vh;
}

.container-fluid h1{
text-align: center;
font-family: 'Cabin Sketch', cursive;
letter-spacing: 3px;
font-size: 50px;
margin: 0;
padding-top: 15px;
padding-bottom: 15px;
}

.grid {
margin: auto;
}

.cell {
border: 1px solid #222222;
padding: 5px;
}

.colors {
background-color: antiquewhite;
}

.palette {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
margin-left: 20px;
margin-right: 20px;
margin-top: 10px;
}

.palette > div {
width: 45px;
height: 45px;
border-radius: 50%;
margin-top: 20px;
margin-left: 10px;
}

.black {
background-color: black;
}

.blue {
background-color: #241e34;
}

.purple {
background-color: #4B233B;
}

.brown {
background-color: #6D352D;
}

.palebrown {
background-color: #985234;
}

.orange {
background-color: #EF6800;
}

.lightorange {
background-color: #E29F5E;
}

.apricot {
background-color: #F5C396;
}

.yellow {
background-color: #F7F914;
}

.lime {
background-color: #71F04F;
}

.green {
background-color: green;
}

.darkgreen {
background-color: #3D6E2F;
}

.forestgreen {
background-color: #524D21;
}

.indigo {
background-color: #2F3D39;
}

.violet {
background-color: #443875;
}

.blueyum {
background-color: #215F84;
}

.cauliflower {
background-color: #655EE4;
}

.coolblue {
background-color: #6092FF;
}

.turquoise {
background-color: turquoise;
}

.paleblue {
background-color: paleturquoise;
}

.white {
background-color: white;
border: #222222 1px solid;
}

.gray {
background-color: lightslategray;
}

.mauve {
background-color: mediumpurple;
}

.gray {
background-color: gray;
}

.darkgray {
background-color: darkgray;
}

.purple {
background-color: purple;
}

.red {
background-color: red;
}

.crimson {
background-color: mediumvioletred;
}

.pink {
background-color: lightpink;
}

.yummygreen {
background-color: palegreen;
}

.myfav {
background-color: aqua;
}