Make room for future sketches

This commit is contained in:
Joshua Seigler 2019-11-05 00:40:21 -05:00 committed by Joshua Seigler
parent 2e601c4bb1
commit 23828113b2
5 changed files with 31 additions and 6 deletions

View file

@ -3,10 +3,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<title>Generative Art - seigler.github.io</title>
<link rel="stylesheet" href="DIGEST(app.css)">
<style>footer { position: fixed; bottom: 0; left: 0; right: 0; color: white; } </style>
</head>
<body>
<footer>space or double click for a new one</footer>
<script src="modules/p5.min.js"></script>
<script src="modules/p5.sound.min.js"></script>
<script src="DIGEST(app.js)"></script>

View file

@ -1,3 +1,3 @@
document.addEventListener('DOMContentLoaded', function() {
require('sketch');
require('sketches/1');
});

View file

@ -17,6 +17,11 @@ new p5(sketch => {
sketch.setup = () => {
goalInstances = 100;
window.onhashchange = () => {
seed = window.location.hash.substr(1);
generate();
};
seed = window.location.hash.substr(1);
sketch.noStroke();
sketch.colorMode(sketch.HSB, 100);
@ -36,17 +41,22 @@ new p5(sketch => {
pass2.noStroke();
generate();
}
};
sketch.draw = () => {
}
};
sketch.keyPressed = () => {
if (sketch.key == ' ') {
seed = null;
generate();
}
}
};
sketch.doubleClicked = () => {
seed = null;
generate();
};
function generate() {
if (seed) {