Last active
August 29, 2015 14:09
-
-
Save s0ren/5dba0b874e6294e633fd to your computer and use it in GitHub Desktop.
Demo af kode fra Khan Academy, indsat i almindelig html side
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello Web - JavaScript kode fra Khan Acamemy</title> | |
<script src="https://raw.github.com/processing-js/processing-js/v1.4.8/processing.min.js"></script> | |
</head> | |
<body> | |
<canvas id="canvas1" style="border:1px solid blue"></canvas> | |
<script type="application/javascript"> | |
function sketchProc(processing) { | |
with(processing) | |
{ | |
size(400, 400); | |
/*******************************************/ | |
/* HERFRA INDSÆTTES KODEN FRA KHAN ACADEMY */ | |
/*******************************************/ | |
background(255, 255, 255); | |
// tomato | |
noStroke(); | |
fill(224, 90, 90); | |
ellipse(150, 200, 150, 150); | |
ellipse(212, 200, 150, 150); | |
// stem | |
fill(48, 130, 31); | |
rect(176, 103, 12, 32); | |
var draw = function() { | |
// take a bite out of the tomato! | |
fill(255, 255, 255); | |
ellipse(mouseX, mouseY, 65, 66); | |
}; | |
/*********************************************/ | |
/* INDSAT KODE FRA KHAN ACADEMY SLUTTER HER! */ | |
/*********************************************/ | |
} | |
} | |
var canvas = document.getElementById("canvas1"); | |
// attaching the sketchProc function to the canvas | |
var processingInstance = new Processing(canvas, sketchProc); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment