Last active
May 4, 2018 01:30
-
-
Save melaniehoff/239bd2e3f2612c5eda227323ec0676c2 to your computer and use it in GitHub Desktop.
D3A - embed p5.js sketch centered on a page.
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 lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<script> | |
// JAVASCRIPT COULD GO HERE | |
</script> | |
<style type="text/css"> | |
body { | |
margin: 0px; | |
padding: 0px; | |
height: 100%; | |
/*////////////////////////////////////////////////////////// | |
//////////////////////////////////////////////////////////// | |
CHANGE BACKGROUND COLOR HERE: */ | |
background-color: #ccecdc; | |
} | |
.flexcontainer { | |
height:100vh; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
flex-direction: row; | |
} | |
.centerdiv { | |
} | |
iframe { | |
border: none; | |
/*//////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////// | |
THE WIDTH AND HEIGHT OF YOUR P5 CANVAS HERE: */ | |
width: 500px; | |
height: 500px; | |
} | |
</style> | |
<title>TITLE</title> | |
</head> | |
<body> | |
<div class="flexcontainer"> | |
<div class="centerdiv"> | |
<!-- ////////////////////////////////////////////////////// | |
/////////////////////////////////////////////////////////// | |
Click file > share > embed | |
YOUR EMBEDDED IFRAME HERE: --> | |
<iframe scrolling="no" src="XXXXXXXXXXXXXXXXX"></iframe> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment