Pen Settings



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


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


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.


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.


                 <div class="container">
   <div class='row'>
     <div class="col-sm-12" id="buttons-row">
       <h3> because sometimes bunnies & hamsters are cuter than humans<h3>
      <button class="btn btn-default"id="flower-crown"><img src=""></button>
      <button class="btn btn-default" id="bunny-ears"><img src=""></button> 
      <button class="btn btn-default"id="doggy"><img src=""></button>
      <button class="btn btn-default" id="hearts"><img src=""></button> 
           <button class="btn btn-default" id="story"><img src=""></button>
       </div> <!-- end of col-sm-12 -->
    </div> <!-- end of row -->     
     <div class="row justify-content-center">
      <video id="video" width="500" height="325" preload autoplay loop muted></video>
      <canvas id="canvas" width="500" height="325"></canvas>     
</div> <!-- end of row -->
</div><!-- end of container -->

         <!-- CREDITS
0. No copyright infringments intended
1. Image:
3. Code: tracking.js and Ally Spitel 



                @import url(",400i,700");

  background-image: url("");
  background-size: 100px;
 font-family: Lato, sans-serif;
 height: 1200px;
  margin-top: 150px;
  background-color:#FFFFFF ;
  border: 12px solid #FFFC00;
h1, h3{
  font-weight: 900;
  text-transform: uppercase;

  margin: 30px;
 margin-bottom: 10px;

  /*background-color: #eabdfd;*/
  color: black;
  text-transform: uppercase;
  border: 3px solid #eabdfd;
  width: 120px;
  height: 80px;
  margin-left: -500px;



const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
const tracker = new tracking.ObjectTracker('face');
const flowerCrownButton = document.getElementById('flower-crown');
const bunnyEarsButton = document.getElementById('bunny-ears');
const doggyButton = document.getElementById('doggy');
const heartsButton = document.getElementById('hearts');


// image constructor create new image element
//new Image();
// image(w,h)
const img = document.createElement("img");
let filterX = 0;
let filterY = 0;
let filterWidth = 0;
let filterHeight = 0;

function changePic (x, y, width, height, src) {
  img.src = src;
  filterX = x;
  filterY = y;
  filterWidth = width;
  filterHeight = height;

function flowerCrown () {
  changePic(0, -0.5, 1, 1, '')

flowerCrownButton.addEventListener('click', flowerCrown);

bunnyEarsButton.addEventListener('click', () => {
  changePic(-0.5, -0.9, 2, 2, '')

function doggy () {
  changePic(0, -1, 1, 3, '')

doggyButton.addEventListener('click', doggy);

function hearts( ) {
  changePic(0, -1, 2, 2, '')

heartsButton.addEventListener('click', hearts);

//listen for track events
tracker.on('track', function(event) {
  //if ( === 0) {
    //alert("No objects were detected in this frame.");
  //} else {
context.clearRect(0, 0, canvas.width, canvas.height) => {
 context.drawImage(img, rect.x + (filterX * rect.width),
    rect.y + (filterY * rect.height),
    rect.width * filterWidth,
    rect.height * filterHeight
  )  })
  //}// end of else

//start tracking
tracking.track('#video', tracker, { camera: true })