hlfcoding/drawing-catalog-1

View on GitHub
sketches/Elementary/template-coffee/template.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>@@sketch@@ : Built with Processing and Processing.js</title>
  <link rel="icon"  type="image/x-icon" href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAQAAVzABAEAjBQAaDwYAWjUGAGE6CQBrQQ0ATS8PAFhAJwBUQC8AbFI6AHVXPACBZk4A4NrWAPb19QAAAAAAAMmZmZmZmgAJIwAAAAAAcMIjPjA+PjAKpxIuMDMzMAm0Ii4zMzMACaIiLt3dMAAJtyIuIzPQAAm0Un5yM+IzKLRkfncy4iIotRF+dyLkIiq0QX53F+EiGrQUTkd34iIatEVu7u5iIVrBVVRBRFRVbAtGZGZla2uwAMu7u7u8vADAAwAAgAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABAADAAwAA" />
  <meta name="Generator" content="Processing" />
  <!-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  +
  +   This is CoffeeScript running on Processing.js through Processing
  +
  +   See: https://github.com/fjenett/coffeescript-mode-processing
  +
  +   http://processing.org/
  +   http://processingjs.org/
  +   http://coffeescript.org/
  +
  L + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
  <link rel="stylesheet" type="text/css" href="theme.css">
  <style type="text/css">
    /* Dynamic */
    #content { width: @@width@@px; }
  </style>
  <!--[if lt IE 9]>
    <script type="text/javascript">alert("Your browser does not support the canvas tag.");</script>
  <![endif]-->
  <script src="processing.js" type="text/javascript"></script>
  <script src="dat.gui.min.js" type="text/javascript"></script>
  <script src="underscore-min.js" type="text/javascript"></script>
  <script src="@@sketch@@-compiled.js" type="text/javascript"></script>
  @@scripts@@
</head>
<body>
  <div id="content">
    <div>
      <canvas id="@@id@@" width="@@width@@" height="@@height@@">
        <p>Your browser does not support the canvas tag.</p>
        <!-- Note: you can put any alternative content here. -->
      </canvas>
      <noscript>
        <p>JavaScript is required to view the contents of this page.</p>
      </noscript>
      </div>
    <h1>@@sketch@@</h1>
      <p id="description">@@description@@</p>
    <p id="sources">Source code: @@source@@</p>
    <p id="">
    Written in <a href="http://coffeescript.org/" title="CoffeeScript">CoffeeScript</a> 
    on <a href="http://processing.org" title="Processing">Processing</a>
    and <a href="http://processingjs.org" title="Processing.js">Processing.js</a>
    </p>
  </div>
  <script type="text/coffeescript-processing">@@coffee@@</script>
  @@coffeescripts@@
  <script type="text/javascript">
  /* + + + + + + + + + + + + + + + + + + + + + + + + + +
   +
   +    Your CoffeeScript code has been precompiled to 
   +    JavaScript. Below it is being mixed into a naked
   +    Processing.js object to make it dance ...
   +    Simple as that!
   +
   + + + + + + + + + + + + + + + + + + + + + + + + + + */
  window.onload = function(){
    if ( ! '@@coffeesketch@@' in window ) {
      alert('Something went awfully wrong. Please check file @@coffeesketch@@-compiled.js');
      return;
    }
    var p5 = new Processing(
      document.getElementById("@@id@@"),
      function ( processing ) {
        var sketchObj = new @@coffeesketch@@();
        for ( var name in sketchObj ) {
          processing[name] = sketchObj[name];
        }
      }
    );
    p5['isMousePressed'] =   function(){ return p5.__mousePressed; }; 
    p5['isKeyPressed'] =   function(){ return p5.__keyPressed;   }; 
    p5['currentFrameRate'] = function(){ return p5.__frameRate;    };
  }
  </script>
</body>
</html>