Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                  <head>
    <title id="tabname">Taco Tapper</title>
  </head>
    <body id="body">
    <h1 id="title" class="center exo">Taco Tapper</h1>
    <hr />
    <br /><br />
    <button class="center q" onclick="shop.buy(shop.grandpas, 1, grandpas);"><h1>Buy Grandpa</h1><h5>$100 - 1 tps - <div id="grandpas">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.stands, 1, stands);"><h1>Buy Stand</h1><h5>$500 - 5 tps - <div id="stands">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.trucks, 1, trucks);"><h1>Buy Truck</h1><h5>$1000 - 10 tps - <div id="trucks">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.shacks, 1, shacks);"><h1>Buy Shack</h1><h5>$5000 - 50 tps - <div id="shacks">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.counties, 1, counties);"><h1>Buy County</h1><h5>$10000 - 100 tps - <div id="counties">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.states, 1, states);"><h1>Buy State</h1><h5>$50000 - 500 tps - <div id="states">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.countries, 1, countries);"><h1>Buy Country</h1><h5>$100000 - 1000 tps - <div id="countries">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.planets, 1, planets);"><h1>Buy Planet</h1><h5>$500000 - 5000 tps - <div id="planets">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.solarsystems, 1, solarsystems);"><h1>Buy Solar System</h1><h5>$1000000 - 10000 tps - <div id="solarsystems">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.galaxies, 1, galaxies);"><h1>Buy Galaxy</h1><h5>$5000000 - 50000 tps - <div id="galaxies">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.universes, 1, universes);"><h1>Buy Universe</h1><h5>$10000000 - 100000 tps - <div id="universes">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.growthrays, 1, growthrays);"><h1>Buy Growth Ray</h1><h5>$50000000 - 500000 tps - <div id="growthrays">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.lettucelasers, 1, lettucelasers);"><h1>Buy Lettuce Laser</h1><h5>$100000000 - 1000000 tps - <div id="lettucelasers">0</div></h5></button>
    <button class="center q" onclick="shop.buy(shop.meatmountains, 1, meatmountains);"><h1>Buy Meat Mountains</h1><h5>$500000000 - 5000000 tps - <div id="meatmountains">0</div></h5></button>
    <div onclick="taco.click();" id="taco"><img src="http://ex-games.org/dev/010111O01O010000110000O00011100111I1001000O0/Taco_Tapper/taco.png" class="imgcenter"></img></div>
    <h4 class="exo">Require $1000 Purchase:</h4>
    <button class="center h" onclick="boosts.buy(boosts.doubletappers, 1, doubletappers);"><h1>Buy Double Tapper</h1><h5>$10000 - +1 tpc - <div id="doubletappers">0</div></h5></button>
    <button class="center h" onclick="boosts.buy(boosts.duplicators, 1, duplicators);"><h1>Buy Duplicator</h1><h5>$1000000 - +100 tpc - <div id="duplicators">0</div></h5></button>
    <h3 class="center exo">Tacos: </h3><h1 id="tacocounter" class="center exo">0</h1>
    <br />
    <h3 class="center exo">TPS: </h3><h1 id="tpscounter" class="center exo">0</h1>
    <footer><h4 class="exo">v0.1.5 Pen</h4></footer><h4 class="center exo">View complete version at  <a href="http://ex-games.org/dev/010111O01O010000110000O00011100111I1001000O0/Taco_Tapper/">my website</a>.</h4>
    <script src="index.js"></script>
  </body>
              
            
!

CSS

              
                   .center {
      text-align: center;
    }
    @font-face {
    font-family: Exo;
    src: url(http://ex-games.org/dev/010111O01O010000110000O00011100111I1001000O0/Taco_Tapper/Exo-Regular.otf);
    }
    .exo {
      font-family: Exo;
    }
    body {
      background-color: #DCFCE0;
    }
    #taco:active {
      border-style: ridge;
      border-color: lightblue;
    }
    #taco {
      border-style: groove;
      border-color: black;
      background-color: #CCFFD2;
    }
    .left {
      text-align: left;
    }
    .right {
      text-align: right;
    }
    .imgcenter {
      display: block; 
      margin-left: auto; 
      margin-right: auto;
    }
    @font-face {
    font-family: Quicksand;
    src: url(http://ex-games.org/dev/010111O01O010000110000O00011100111I1001000O0/Taco_Tapper/Quicksand-Regular.otf);
    }
    button.q {
      color: darkgreen;
    }
    button {
      font-family: Quicksand;
    }
    button.h {
      color: darkblue;
    }
   
              
            
!

JS

              
                // getting elements
var tacocounter = document.getElementById("tacocounter");
var tpscounter = document.getElementById("tpscounter");
var body = document.getElementById("body");
var title = document.getElementById("tabname");
// and now for the shop
var grandpas = document.getElementById("grandpas");
var stands = document.getElementById("stands");
var trucks = document.getElementById("trucks");
var shacks = document.getElementById("shacks");
var counties = document.getElementById("counties");
var states = document.getElementById("states");
var countries = document.getElementById("countries");
var planets = document.getElementById("planets");
var solarsystems = document.getElementById("solarsystems");
var galaxies = document.getElementById("galaxies");
var universes = document.getElementById("universes");
var growthrays = document.getElementById("growthrays");
var lettucelaser = document.getElementById("lettucelasers");
var meatmountains = document.getElementById("meatmountains");
// and now for the boosts
var doubletappers = document.getElementById("doubletappers");
var duplicators = document.getElementById("duplicators");
// boost affordality
var boostAfford = false;
// defining taco (the main object of the code)
var taco = {tacos: 0, el: document.getElementById("taco"), click: function() {this.tacos = this.tacos + boosts.tpc;}};
// defining shop (things that make tacos for you)
var shop = {};
shop.buy = function(item, amount, minus){if (taco.tacos >= item.cost) {minus.innerHTML = item.num; item.num = item.num + amount; taco.tacos = taco.tacos - item.cost; this.tps = this.tps + item.prod;} if (item.cost >= 1000) {boostAfford = true;}};
shop.tps = 0;
shop.grandpas =      {num: 1, cost: 100,       prod: 1};
shop.stands =        {num: 1, cost: 500,       prod: 5}; 
shop.trucks =        {num: 1, cost: 1000,      prod: 10};
shop.shacks =        {num: 1, cost: 5000,      prod: 50};
shop.counties =      {num: 1, cost: 10000,     prod: 100};
shop.states =        {num: 1, cost: 50000,     prod: 500};
shop.countries =     {num: 1, cost: 100000,    prod: 1000};
shop.planets =       {num: 1, cost: 500000,    prod: 5000};
shop.solarsystems =  {num: 1, cost: 1000000,   prod: 10000};
shop.galaxies =      {num: 1, cost: 5000000,   prod: 50000};
shop.universes =     {num: 1, cost: 10000000,  prod: 100000};
shop.growthrays =    {num: 1, cost: 50000000,  prod: 500000};
shop.lettucelasers = {num: 1, cost: 100000000, prod: 1000000};
shop.meatmountains = {num: 1, cost: 500000000, prod: 5000000};
// defining boosts (things that give you more tpc)
var boosts = {};
boosts.buy = function(item, amount, minus) {if (taco.tacos >= item.cost * amount && boostAfford === true) {minus.innerHTML = item.num; item.num = item.num + amount; taco.tacos = taco.tacos - item.cost * amount; this.tpc = this.tpc + item.prod;}};
boosts.tpc = 1;
boosts.doubletappers = {num: 1, cost: 10000, prod: 1};
boosts.duplicators = {num: 1, cost: 1000000, prod: 100};
// sending tacos and tps to html
setInterval(function(){tacocounter.innerHTML = taco.tacos; title.innerHTML = taco.tacos + " Tacos";}, 10);
setInterval(function(){tpscounter.innerHTML = shop.tps;}, 10);
// adding tacos for tps (tacos per second) or tacos made by workers
setInterval(function(){taco.tacos = taco.tacos + shop.tps;}, 1000);
// keydowns
window.addEventListener("keydown", function(evt) {
  //defining all the keys
  // numbers:
  //0
  if (evt.keyCode == 48) {shop.buy(shop.galaxies, 1, galaxies);}
  //1
  if (evt.keyCode == 49) {shop.buy(shop.grandpas, 1, grandpas);}
  //2
  if (evt.keyCode == 50) {shop.buy(shop.stands, 1, stands);}
  //3
  if (evt.keyCode == 51) {shop.buy(shop.trucks, 1, trucks);}
  //4
  if (evt.keyCode == 52) {shop.buy(shop.shacks, 1, shacks);}
  //5
  if (evt.keyCode == 53) {shop.buy(shop.counties, 1, counties);}
  //6
  if (evt.keyCode == 54) {shop.buy(shop.states, 1, states);}
  //7
  if (evt.keyCode == 55) {shop.buy(shop.countries, 1, countries);}
  //8
  if (evt.keyCode == 56) {shop.buy(shop.planets, 1, planets);}
  //9
  if (evt.keyCode == 57) {shop.buy(shop.solarsystems, 1, solarsystems);}
});
//key ups
window.addEventListener("keyup", function(evt) {
    // space
  if (evt.keyCode == 32) {taco.click();}
});
// to be continued...
              
            
!
999px

Console