mirror of
https://github.com/rileyjshaw/terra.git
synced 2024-11-21 04:54:23 +00:00
Reorganize for efficient gh_pages deploy
This commit is contained in:
parent
8dfdc93eeb
commit
8caf0fe500
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,6 +2,3 @@
|
|||||||
demo
|
demo
|
||||||
bower_components
|
bower_components
|
||||||
node_modules
|
node_modules
|
||||||
index.html
|
|
||||||
main.css
|
|
||||||
terra.demo.min.js
|
|
||||||
|
@ -27,9 +27,6 @@
|
|||||||
"lodash_custom",
|
"lodash_custom",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"tests",
|
"tests",
|
||||||
"index.html",
|
|
||||||
"main.css",
|
|
||||||
"terra.demo.min.js",
|
|
||||||
"gulpfile.js"
|
"gulpfile.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
24
gulpfile.js
24
gulpfile.js
@ -12,14 +12,14 @@ var paths = {
|
|||||||
ext: ['./bower_components/**/*.js', './lodash_custom/**/*.js']
|
ext: ['./bower_components/**/*.js', './lodash_custom/**/*.js']
|
||||||
},
|
},
|
||||||
demo: {
|
demo: {
|
||||||
entry: ['./demo/scripts/main.js'],
|
entry: './demo/scripts/main.js',
|
||||||
scripts: ['./demo/scripts/**/*.js'],
|
scripts: './demo/scripts/**/*.js',
|
||||||
stylesheets: ['./demo/stylesheets/**/*.css', './demo/stylesheets/**/*.sass'],
|
stylesheets: ['./demo/stylesheets/**/*.css', './demo/stylesheets/**/*.sass'],
|
||||||
extras: ['./*.{png,ico,txt,xml}']
|
extras: './*.{png,ico,txt,xml}'
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
scripts: './dist',
|
scripts: './dist',
|
||||||
demo: './'
|
demo: './demo'
|
||||||
},
|
},
|
||||||
tests: './tests'
|
tests: './tests'
|
||||||
};
|
};
|
||||||
@ -72,4 +72,18 @@ gulp.task('watch', function() {
|
|||||||
gulp.watch(paths.demo.stylesheets, ['sass']);
|
gulp.watch(paths.demo.stylesheets, ['sass']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task( 'default', [ 'lint', 'scripts', 'demo', 'sass', 'watch' ] );
|
gulp.task('deploy', function () {
|
||||||
|
gulp.src(paths.dist.demo + '/*.*')
|
||||||
|
.pipe($.ghPages('https://github.com/rileyjshaw/terra.git', 'origin'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('webserver', function() {
|
||||||
|
gulp.src(paths.dist.demo)
|
||||||
|
.pipe($.webserver({
|
||||||
|
host: '0.0.0.0',
|
||||||
|
livereload: true,
|
||||||
|
open: true
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task( 'default', [ 'lint', 'scripts', 'demo', 'sass', 'webserver', 'watch' ] );
|
||||||
|
106
index.html
106
index.html
@ -1,106 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>terra.js</title>
|
|
||||||
<link rel="stylesheet" href="main.css">
|
|
||||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="fullPage splash">
|
|
||||||
<div class="vcent"></div>
|
|
||||||
<header id="header">
|
|
||||||
<h1>terra.js <span>alpha</span></h1>
|
|
||||||
<p>A JavaScript framework for simple biological simulations and cellular automata.</p>
|
|
||||||
<a data-scroll href="#main" class="downArrow">⬇</a>
|
|
||||||
</header>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav>
|
|
||||||
<ul>
|
|
||||||
<li><a data-scroll href="#usage">Usage</a></li>
|
|
||||||
<li><a data-scroll href="#examples">Examples</a></li>
|
|
||||||
<li><a data-scroll href="#options">Options</a></li>
|
|
||||||
<li><a data-scroll href="#methods">Methods</a></li>
|
|
||||||
<li><a data-scroll href="#events">Events</a></li>
|
|
||||||
<li><a href="https://github.com/rileyjshaw/terra">GitHub</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div id="main" class="main">
|
|
||||||
<p>terra is a <strong>super customizable</strong> framework for creating and analyzing biological simulations. It's open-source and licenced under MIT.</p>
|
|
||||||
<p>terra is still in Alpha version, which means...</p>
|
|
||||||
<h2 id="usage">Usage</h2>
|
|
||||||
<p>To get started, we'll create a simple creature using the creatureFactory. Each creature requires a type and a color.</p>
|
|
||||||
<pre>creatureFactory.register({
|
|
||||||
type: 'firstCreature',
|
|
||||||
color: [220, 85, 79]
|
|
||||||
});</pre>
|
|
||||||
<p>This creature is valid, but it's just inheriting the default behaviours. To make a more interesting creature, let's override some of the default <a data-scroll href="#options">options</a> and <a data-scroll href="#methods">methods</a>.</p>
|
|
||||||
<pre>creatureFactory.register({
|
|
||||||
type: 'secondCreature',
|
|
||||||
color: [41, 128, 185],
|
|
||||||
metabolism: 1,
|
|
||||||
sustainability: 3,
|
|
||||||
reproduceLv: 0.60,
|
|
||||||
etc...
|
|
||||||
});</pre>
|
|
||||||
<p>We've just created a creature that will ____.</p>
|
|
||||||
<p>To run a simulation, we'll need to create an environment. Let's make a 25x25 grid and populate 40% of the space with our first creature and 20% with our second.</p>
|
|
||||||
<pre>var ex1 = new Terrarium(25, 25, 'ex1');
|
|
||||||
ex1.populate([['firstCreature', 40], ['secondCreature', 20]]);</pre>
|
|
||||||
|
|
||||||
|
|
||||||
<h2 id="examples">Examples</h2>
|
|
||||||
<h3 id="gol">Conway's Game of Life <a class="question" target="_blank" href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">?</a></h3>
|
|
||||||
<p>terra can also run cellular automata. </p>
|
|
||||||
<pre><code>
|
|
||||||
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h2 id="options">Options</h2>
|
|
||||||
<p>The following options can be passed in an object to creatureFactory.register( ) as the first argument.</p>
|
|
||||||
|
|
||||||
<h3>Required</h3>
|
|
||||||
<ul>
|
|
||||||
<li>(string) type: </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Optional</h3>
|
|
||||||
<ul>
|
|
||||||
<li>(array) color: </li>
|
|
||||||
<li>(int) initialEnergy: </li>
|
|
||||||
<li>(int) maxEnergy: </li>
|
|
||||||
<li>(int) metabolism: </li>
|
|
||||||
<li>(int) size: </li>
|
|
||||||
<li>(int) speed: </li>
|
|
||||||
<li>(int) vision: </li>
|
|
||||||
<li>(int) sustainability: 2</li>
|
|
||||||
<li>(float) reproduceLv: 0.70</li>
|
|
||||||
<li>(float) moveLv: 0.20</li>
|
|
||||||
<li>(char) character: </li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 id="methods">Methods</h2>
|
|
||||||
<ul>
|
|
||||||
<li>queue</li>
|
|
||||||
<li>reproduce</li>
|
|
||||||
<li>move</li>
|
|
||||||
<li>wait</li>
|
|
||||||
<li>isDead</li>
|
|
||||||
<li>boundEnergy</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h2 id="events">Events</h2>
|
|
||||||
<ul>
|
|
||||||
<li>finished</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>Created with ❤ by <a href="http://rileyjshaw.com">rileyjshaw</a>. Inspired by <a href="http://eloquentjavascript.net/">Marijn Haverbeke</a> and <a href="https://www.wolframscience.com/">Stephen Wolfram</a>.</footer>
|
|
||||||
<script src="bower_components/smooth-scroll.js/dist/js/bind-polyfill.min.js"></script>
|
|
||||||
<script src="bower_components/smooth-scroll.js/dist/js/smooth-scroll.min.js"></script>
|
|
||||||
<script src="terra.demo.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -29,7 +29,9 @@
|
|||||||
"gulp-load-plugins": "~0.5.3",
|
"gulp-load-plugins": "~0.5.3",
|
||||||
"vinyl-source-stream": "~0.1.1",
|
"vinyl-source-stream": "~0.1.1",
|
||||||
"browserify": "~5.10.0",
|
"browserify": "~5.10.0",
|
||||||
"gulp-streamify": "0.0.5"
|
"gulp-streamify": "0.0.5",
|
||||||
|
"gulp-gh-pages": "~0.3.3",
|
||||||
|
"gulp-webserver": "~0.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": "~2.4.1"
|
"lodash": "~2.4.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user