Skip to content

Instantly share code, notes, and snippets.

@ff6347
Created May 19, 2022 08:50
Show Gist options
  • Select an option

  • Save ff6347/975e14648708f45f2d7d74cd1224c4da to your computer and use it in GitHub Desktop.

Select an option

Save ff6347/975e14648708f45f2d7d74cd1224c4da to your computer and use it in GitHub Desktop.
simple gist for p5js with hawk
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Starter</title>
<meta name="description" content="something" />
<meta name="author" content="me" />
<link href="style.css" rel="stylesheet"/>
<style>
</style>
</head>
<body class="container">
<div id="sketch" class="flex-item"></div>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.min.js"
integrity="sha512-NxocnqsXP3zm0Xb42zqVMvjQIktKEpTIbCXXyhBPxqGZHqhcOXHs4pXI/GoZ8lE+2NJONRifuBpi9DxC58L0Lw=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<script src="index.js"></script>
</body>
</html>
function setup() {
background(128);
}
function draw() {
fill(0);
ellipse(20, 10, 10);
}
html {
font-size: 100%;
} /*16px*/
body {
background-color: white;
display: flex;
margin: 0 0;
color: #1d2429;
}
/*
see A Complete Guide to Flexbox
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
*/
.container {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.flex-item {
align-self: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment