mirror of
https://github.com/seigler/generative
synced 2025-07-26 22:56:10 +00:00
Make room for future sketches
This commit is contained in:
parent
2e601c4bb1
commit
23828113b2
5 changed files with 31 additions and 6 deletions
|
@ -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>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
require('sketch');
|
||||
require('sketches/1');
|
||||
});
|
||||
|
|
|
@ -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) {
|
Loading…
Add table
Add a link
Reference in a new issue