Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                
<html>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <title class= "title">Pixel Art Maker!</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Monoton">
    <link rel="stylesheet" href="styles.css">

</head>
<body class= "pixelArtMaker">
    
    

  <div id="mySidenav" class="sidenav">
    <a href="javascript:void(0)" class="closebtn"       onclick="closeNav()">&times;</a>
    <div class= "gridSize">
      <h2>Choose Grid Size</h2>
    </div>

    <div>
      <form id="sizePicker">
          Grid Height:
            <input type="number" id="inputHeight" name="height" min="1" value="1" max="50">
          Grid Width:
           <input type="number" id="inputWidth" name="width" min="1" value="1" max="50">
        <input type="submit" class="submitButton">
      </form>
    </div>
    <h2 class= "gridColor">Pick A Color</h2>
      <input type="color" id="colorPicker">
    
    <h3>Double-Click to erase!</h3>
    
      <img src= "https://image.ibb.co/kVUYTS/IMG_0113.png" alt= "By Hannah Coley" class= "hColeyLogo" width= "200" height= "100">
    
  </div>

  
<div id='main'>
<div class="header"><!--<h1 class= "pixelArtMakerHeading">Lab: Pixel Art Maker</h1> -->
      <img src= "https://image.ibb.co/d2Q9q7/IMG_0125.png" alt= "Pixel Art Maker" class= "pixelHeadingImage" width="916" height="480">
    </div>
  <span id="menu" >&#9776; Menu</span>
    <div class="coleyLogo"
      <img src= "https://image.ibb.co/kVUYTS/IMG_0113.png" alt= "By Hannah Coley" class= "hColeyLogo" width= "300" height= "200">
    </div>




    

    <div class= "canvasArea">
      <h2 class= "designCanvasHeading">Design Canvas</h2>

        <table id="pixelCanvas"></table>

    </div>


    <div class="footer">
    </div>


    <script src="designs.js"></script>
  </div>  
</body>
</html>

              
            
!

CSS

              
                body {
    text-align: center;
    background: url(https://image.ibb.co/e7ziiS/resizededitedcubismbg.png) ;   
    background-position: fixed;
    background-size: cover;
    background-repeat: none;
    
    background-size:auto;
    font-family: "Lato", sans-serif;
    font-weight: bold;
    font-size: 25px;
    color: #66004d;
    text-shadow: 2px 2px #ff84c1;
    border-style: solid;
    border-width: 20px;
    border-color: #B75F8B;

}

#main {
  margin-left: 250px;
}

.pixelHeadingImage {
  position: center;
  top: 25px;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #FF84C1;
    position: fixed;
    top: 55px;
    width:inherit;
    opacity: 0.7;
}

li {
    float: left;
}

li a {
    display: block;
    color: white;
    text-align: center;
    padding: 20px 35px;
    text-decoration: none;
}

li a:hover {
    background-color: #934c70;
}

h1 {
    font-family: Monoton;
    font-size: 70px;
    margin: 0.2em;
}

h2 {
    margin: 1em 0 0.25em;
}

h2:first-of-type {
    margin-top: 0.5em;
}

table,
tr,
td {
    border: 1px solid black;
    background-color: white;
    opacity: 0.8;
}

table {
    border-collapse: collapse;
    margin: 0 auto;
}

tr {
    height: 20px;
}

td {
    width: 20px;
}

input[type=number] {
    width: 6em;
}

#menu{
  font-size: 30px;
  cursor: pointer;
}

/* The side navigation menu */
.sidenav {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #B75F8B;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    font-family: "Lato", sans-serif;
}

.sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #000000;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #f1f1f1;
}

.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 18px;}
}
              
            
!

JS

              
                  var colorSelect = $('#colorPicker');
  var submitButton= $('.submitButton'); //defines the submitButton variable
  var canvas= $('#pixelCanvas'); //defines the canvas variables
  var maxWidth= 50;
  var maxHeight=50;
  var minHeight=0;
  var minWidth=0;
  var heightDefault=20;
  var widthDefault=20;
  var tableRow= ('<tr></tr>');
  var tableColumn= ('<td></td>');
  var colorDefault= '#000000';
  var menuIsOpen = true;
//making your grid:
  $('.submitButton').on('click' , function makeGrid(evt){
    evt.preventDefault();
    canvas.children().remove();

    var height;
    
    if ($('#inputHeight').val() > 50) {
      alert('Please limit height to 50 or less')
    } else {
      height=$('#inputHeight').val(); //defines the height variable
    }
    
    var width;
    
    if ($('#inputWidth').val() > 50) {
      alert('Please limit width to 50 or less')
    } else {
      width=$('#inputWidth').val(); //defines the width variable
    }
    
    for (var i=1; i<= height; i++){
      canvas.append(tableRow);
      for (var j=1; j<= width; j++){
        canvas.find('tr').last().append(tableColumn);
      }
    }
  });


colorSelect.change(function(){
  var color= $('#colorPicker').val(); //defines the variable color
});

  canvas.on('click', 'td', function() {
    var color = $('#colorPicker').val();
    $(this).css('background-color', color);
  });

canvas.on('dblclick', 'td', function() {
    $(this).css('background-color', 'transparent');
});

/* Set the width of the side navigation to 250px and the left margin of the page content to 250px */
function openNav() {
  $('#mySidenav').css('width', '250px');
  $('#main').css('marginLeft', '250px');

}

/* Set the width of the side navigation to 0 and the left margin of the page content to 0 */
function closeNav() {
  $('#mySidenav').css('width', '0');
  $('#main').css('marginLeft','0');
};

function toggleNav() {
  if(menuIsOpen) {
    closeNav();
    menuIsOpen = false;
  } else {
    openNav();
    menuIsOpen = true;
  }
}

$('#menu').on('click', toggleNav);
              
            
!
999px

Console