Skip to content

Instantly share code, notes, and snippets.

@mwiemarc
Forked from iashris/index.html
Created April 25, 2024 21:20
Show Gist options
  • Save mwiemarc/eaca77efb45cb096b59bf5d02ba806a8 to your computer and use it in GitHub Desktop.
Save mwiemarc/eaca77efb45cb096b59bf5d02ba806a8 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