Skip to content

Instantly share code, notes, and snippets.

@brendandawes
Created August 23, 2016 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendandawes/a310114d36808b79153fec92b2ebb263 to your computer and use it in GitHub Desktop.
Save brendandawes/a310114d36808b79153fec92b2ebb263 to your computer and use it in GitHub Desktop.
p5.js: Fullscreen html and css
<html>
<head>
<script language="javascript" type="text/javascript" src="libraries/p5.js"></script>
<script type='text/javascript' src='libraries/p5.dom.js'></script>
<script type='text/javascript' src='libraries/sylvester.js'></script>
<style>
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 0;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
p {
padding:0px;
margin:0px;
position: absolute;
text-align: center;
}
canvas {
width: 100%;
height: 100%;
background-color: #515151;
top:0px;
left:0px;
position: absolute;
background:transparent;
visibility:visible;
z-index: 0;
moz-opaque:false;
pointer-events:none;
}
#defaultCanvas {
pointer-events:none;
z-index: 8;
background:transparent;
moz-opaque:false;
} </style>
</head>
<body>
<script language="javascript" type="text/javascript" src="sketch.js"></script>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment