Skip to content

Instantly share code, notes, and snippets.

@iashris
Created November 24, 2016 20:43
Show Gist options
  • Save iashris/1986856c627ad2f0b94ed6c1af69c39f to your computer and use it in GitHub Desktop.
Save iashris/1986856c627ad2f0b94ed6c1af69c39f to your computer and use it in GitHub Desktop.
This is the template of html file to use for p5js projects for me
<!DOCTYPE html>
<html>
<head>
<title>p5js fullscreen template</title>
</head>
<style type="text/css">
canvas {
position: fixed;
top: 0; left: 0;
z-index: 1;
}
#content{
position: relative;
z-index: 2;
}
</style>
<body>
<div id = "content"></div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.4/p5.min.js"></script>
<script type="text/javascript">
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment