├── python-flask-server
├── README.md
├── src
│ ├── server
│ │ ├── __init__.py
│ │ ├── api.py
│ │ ├── app.py
│ │ └── cli.py
│ └── x_x
│ │ ├── splashes
│ │ ├── frog.txt
│ │ └── sword.txt
│ │ └── __init__.py
├── pyproject.toml
├── .gitignore
├── tests
│ └── server
│ │ └── flask_test.py
├── setup.cfg
├── LICENSE
└── UNLICENSE
├── .gitignore
├── worm-food
├── .gitignore
├── .babelrc
├── app
│ ├── favicon.ico
│ ├── style.css
│ ├── index.html
│ └── dat.gui.min.js
├── webpack.config.js
├── src
│ ├── Bas3d.js
│ ├── objs
│ │ └── WeirdRing.js
│ └── index.js
└── package.json
├── python-lib
├── pyproject.toml
├── README.md
├── src
│ └── x_x
│ │ ├── cli.py
│ │ ├── splashes
│ │ ├── cat.txt
│ │ ├── tails.txt
│ │ └── sword.txt
│ │ └── __init__.py
├── tests
│ └── x_x
│ │ ├── cli_test.py
│ │ └── x_x_test.py
├── setup.cfg
├── LICENSE
└── UNLICENSE
└── python-sanic-server
├── pyproject.toml
├── README.md
├── src
├── x_x
│ ├── cli.py
│ ├── splashes
│ │ ├── cat.txt
│ │ ├── tails.txt
│ │ └── sword.txt
│ └── __init__.py
└── server
│ ├── cli.py
│ ├── static
│ └── index.html
│ └── app.py
├── tests
├── server
│ └── server_test.py
└── x_x
│ └── x_x_test.py
├── setup.cfg
├── LICENSE
└── UNLICENSE
/python-flask-server/README.md:
--------------------------------------------------------------------------------
1 | :hocho:
2 |
--------------------------------------------------------------------------------
/python-flask-server/src/server/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.egg-info
2 | *.swp
3 | .DS_Store
4 | __pycache__
5 |
--------------------------------------------------------------------------------
/worm-food/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | .DS_Store
3 | node_modules/
4 | dist/
5 | dist-zipped/
6 | yarn.lock
7 |
--------------------------------------------------------------------------------
/worm-food/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "@babel/preset-env"
5 | ]
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/worm-food/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/whatever/templates/main/worm-food/app/favicon.ico
--------------------------------------------------------------------------------
/python-lib/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["setuptools"]
3 | build-backend = "setuptools.build_meta"
4 |
--------------------------------------------------------------------------------
/python-flask-server/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["setuptools"]
3 | build-backend = "setuptools.build_meta"
4 |
--------------------------------------------------------------------------------
/python-sanic-server/pyproject.toml:
--------------------------------------------------------------------------------
1 | [build-system]
2 | requires = ["setuptools"]
3 | build-backend = "setuptools.build_meta"
4 |
--------------------------------------------------------------------------------
/python-flask-server/.gitignore:
--------------------------------------------------------------------------------
1 | *.bak
2 | *.db
3 | *.egg-info
4 | *.sqlite
5 | *.swp
6 | .DS_Store
7 | __pycache__
8 | node_modules
9 |
--------------------------------------------------------------------------------
/python-flask-server/src/server/api.py:
--------------------------------------------------------------------------------
1 | import flask
2 |
3 |
4 | def blueprint():
5 | """Register basic api routes"""
6 |
7 | blueprint = flask.Blueprint("api", __name__)
8 |
9 | @blueprint.route("/api/1/")
10 | def index():
11 | return {"status":" ok"}, 200
12 |
13 | return blueprint
14 |
--------------------------------------------------------------------------------
/worm-food/app/style.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | margin: 0;
3 | padding: 0;
4 | height: 100%;
5 | width: 100%;
6 | }
7 |
8 | body {
9 | background-color: black;
10 | }
11 |
12 | .app {
13 | width: 100%;
14 | height: 100%;
15 | margin: 0;
16 | padding: 0;
17 | position: fixed;
18 | top: 0;
19 | left: 0;
20 | z-index: -666;
21 | }
22 |
--------------------------------------------------------------------------------
/python-lib/README.md:
--------------------------------------------------------------------------------
1 | # :cake:
2 |
3 | Not-really opinionated python project template
4 |
5 |
6 | ## Install
7 |
8 | ```bash
9 | pip3 intall -e .
10 | pip3 install -e ".[dev]"
11 | ```
12 |
13 |
14 | ## Test
15 |
16 | WIP: Should this be tox nowadays?
17 |
18 | ```bash
19 | pytest
20 | ```
21 |
22 |
23 | ## Lint
24 |
25 | WIP: What should this be?
26 |
27 | ```bash
28 | flake8 src
29 | ```
30 |
--------------------------------------------------------------------------------
/python-flask-server/src/x_x/splashes/frog.txt:
--------------------------------------------------------------------------------
1 | .--._.--.
2 | ( O O )
3 | / . . \
4 | .`._______.'.
5 | /( )\
6 | _/ \ \ / / \_
7 | .~ ` \ \ / / ' ~.
8 | { -. \ V / .- }
9 | _ _`. \ | | | / .'_ _
10 | >_ _} | | | {_ _<
11 | /. - ~ ,_-' .^. `-_, ~ - .\
12 | '-'|/ \|`-`
13 |
--------------------------------------------------------------------------------
/python-lib/src/x_x/cli.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 |
4 | from x_x import splash, x_x
5 |
6 |
7 | def main():
8 | """CLI stub"""
9 |
10 | parser = argparse.ArgumentParser()
11 | parser.add_argument("--splash", action="store_true", help="show splash screen")
12 | args = parser.parse_args()
13 |
14 | if args.splash:
15 | print(splash("sword"))
16 | else:
17 | print(x_x())
18 |
--------------------------------------------------------------------------------
/python-sanic-server/README.md:
--------------------------------------------------------------------------------
1 | # :cake:
2 |
3 | Not-really opinionated python project template
4 |
5 |
6 | ## Install
7 |
8 | ```bash
9 | pip3 intall -e .
10 | pip3 install -e ".[dev]"
11 | ```
12 |
13 |
14 | ## Test
15 |
16 | WIP: Should this be tox nowadays?
17 |
18 | ```bash
19 | pytest
20 | ```
21 |
22 |
23 | ## Lint
24 |
25 | WIP: What should this be?
26 |
27 | ```bash
28 | flake8 src
29 | ```
30 |
--------------------------------------------------------------------------------
/python-sanic-server/src/x_x/cli.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 |
4 | from x_x import splash, x_x
5 |
6 |
7 | def main():
8 | """CLI stub"""
9 |
10 | parser = argparse.ArgumentParser()
11 | parser.add_argument("--splash", action="store_true", help="show splash screen")
12 | args = parser.parse_args()
13 |
14 | if args.splash:
15 | print(splash("sword"))
16 | else:
17 | print(x_x())
18 |
--------------------------------------------------------------------------------
/python-lib/tests/x_x/cli_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 | from x_x.cli import (
4 | main,
5 | splash,
6 | )
7 |
8 |
9 | class TestCLI(unittest.TestCase):
10 | """Test that the CLI tool still works"""
11 |
12 | def test_splash(self):
13 | """Test whether the splash screen returns"""
14 |
15 | self.assertTrue(splash("sword"))
16 |
17 | def test_main(self):
18 | """Test whether the main function runs"""
19 |
20 | main()
21 |
--------------------------------------------------------------------------------
/python-flask-server/tests/server/flask_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | from server.app import get_app
5 |
6 |
7 | class TestFlaskServer(unittest.TestCase):
8 | def test_can_init(self):
9 | """Test whether we can initialize the flask app and hit some pre-defined routes"""
10 |
11 | app = get_app()
12 |
13 | with app.test_client() as c:
14 | response = c.get("/api/1/")
15 | self.assertEqual(response.status_code, 200)
16 |
--------------------------------------------------------------------------------
/python-sanic-server/tests/server/server_test.py:
--------------------------------------------------------------------------------
1 | import pytest
2 | from sanic import request, response
3 | import unittest
4 |
5 | from server.app import get_app
6 | from sanic_testing.testing import SanicTestClient
7 |
8 |
9 | # XXX: Is this necessay?
10 | @pytest.fixture
11 | def app():
12 | return get_app(0)
13 |
14 |
15 | class TestServer(unittest.TestCase):
16 | def test_server(self):
17 | app = get_app(0)
18 | client = SanicTestClient(app)
19 | request, response = app.test_client.get("/static/index.html")
20 | self.assertEqual(200, response.status)
21 |
--------------------------------------------------------------------------------
/python-lib/tests/x_x/x_x_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | from x_x import x_x
5 |
6 |
7 | class TestX_X(unittest.TestCase):
8 | """Test x_x"""
9 |
10 | def test_x_x_structure(self):
11 | """Test whether x_x() is structured correctly."""
12 |
13 | for i in range(1000):
14 | smiley = x_x()
15 | self.assertEqual(len(smiley), 3)
16 | self.assertEqual(smiley[1], "_")
17 | self.assertIn(smiley[0], "xXOo0Uu@*^-")
18 | self.assertIn(smiley[2], "xXOo0Uu@*^-")
19 |
20 |
21 | if __name__ == "__main__":
22 | unittest.main()
23 |
--------------------------------------------------------------------------------
/python-sanic-server/tests/x_x/x_x_test.py:
--------------------------------------------------------------------------------
1 | import unittest
2 |
3 |
4 | from x_x import x_x
5 |
6 |
7 | class TestX_X(unittest.TestCase):
8 | """Test x_x"""
9 |
10 | def test_x_x_structure(self):
11 | """Test whether x_x() is structured correctly."""
12 |
13 | for i in range(1000):
14 | smiley = x_x()
15 | self.assertEqual(len(smiley), 3)
16 | self.assertEqual(smiley[1], "_")
17 | self.assertIn(smiley[0], "xXOo0Uu@*^-")
18 | self.assertIn(smiley[2], "xXOo0Uu@*^-")
19 |
20 |
21 | if __name__ == "__main__":
22 | unittest.main()
23 |
--------------------------------------------------------------------------------
/python-lib/src/x_x/splashes/cat.txt:
--------------------------------------------------------------------------------
1 |
2 | .__....._ _.....__,
3 | .": o :': ;': o :".
4 | `. `-' .'. .'. `-' .'
5 | `---' `---'
6 |
7 | _...----... ... ... ...----..._
8 | .-'__..-""'---- `. `"` .' ----'""-..__`-.
9 | '.-' _.--"""' `-._.-' '"""--._ `-.`
10 | ' .-"' : `"-. `
11 | ' `. _.'"'._ .' `
12 | `. ,.-'" "'-., .'
13 | `. .'
14 | `-._ _.-'
15 | `"'--...___...--'"`
16 |
--------------------------------------------------------------------------------
/python-sanic-server/src/x_x/splashes/cat.txt:
--------------------------------------------------------------------------------
1 |
2 | .__....._ _.....__,
3 | .": o :': ;': o :".
4 | `. `-' .'. .'. `-' .'
5 | `---' `---'
6 |
7 | _...----... ... ... ...----..._
8 | .-'__..-""'---- `. `"` .' ----'""-..__`-.
9 | '.-' _.--"""' `-._.-' '"""--._ `-.`
10 | ' .-"' : `"-. `
11 | ' `. _.'"'._ .' `
12 | `. ,.-'" "'-., .'
13 | `. .'
14 | `-._ _.-'
15 | `"'--...___...--'"`
16 |
--------------------------------------------------------------------------------
/python-lib/src/x_x/__init__.py:
--------------------------------------------------------------------------------
1 | import os.path
2 | import random
3 |
4 |
5 | EYES = [
6 | "x",
7 | "X",
8 | "O",
9 | "o",
10 | "0",
11 | "U",
12 | "u",
13 | "@",
14 | "*",
15 | "^",
16 | "-",
17 | ]
18 |
19 |
20 | def x_x():
21 | """Return a random face with an eye."""
22 | return random.choice(EYES) + "_" + random.choice(EYES)
23 |
24 |
25 | def splash(choice: str) -> str:
26 | """Return a splash screen"""
27 |
28 | fname = os.path.join(
29 | os.path.dirname(__file__),
30 | "splashes",
31 | f"{choice}.txt",
32 | )
33 |
34 | with open(fname, "r") as fi:
35 | return fi.read()
36 |
--------------------------------------------------------------------------------
/python-flask-server/src/x_x/__init__.py:
--------------------------------------------------------------------------------
1 | import os.path
2 | import random
3 |
4 |
5 | EYES = [
6 | "x",
7 | "X",
8 | "O",
9 | "o",
10 | "0",
11 | "U",
12 | "u",
13 | "@",
14 | "*",
15 | "^",
16 | "-",
17 | ]
18 |
19 |
20 | def x_x():
21 | """Return a random face with an eye."""
22 | return random.choice(EYES) + "_" + random.choice(EYES)
23 |
24 |
25 | def splash(choice: str) -> str:
26 | """Return a splash screen"""
27 |
28 | fname = os.path.join(
29 | os.path.dirname(__file__),
30 | "splashes",
31 | f"{choice}.txt",
32 | )
33 |
34 | with open(fname, "r") as fi:
35 | return fi.read()
36 |
--------------------------------------------------------------------------------
/python-sanic-server/src/x_x/__init__.py:
--------------------------------------------------------------------------------
1 | import os.path
2 | import random
3 |
4 |
5 | EYES = [
6 | "x",
7 | "X",
8 | "O",
9 | "o",
10 | "0",
11 | "U",
12 | "u",
13 | "@",
14 | "*",
15 | "^",
16 | "-",
17 | ]
18 |
19 |
20 | def x_x():
21 | """Return a random face with an eye."""
22 | return random.choice(EYES) + "_" + random.choice(EYES)
23 |
24 |
25 | def splash(choice: str) -> str:
26 | """Return a splash screen"""
27 |
28 | fname = os.path.join(
29 | os.path.dirname(__file__),
30 | "splashes",
31 | f"{choice}.txt",
32 | )
33 |
34 | with open(fname, "r") as fi:
35 | return fi.read()
36 |
--------------------------------------------------------------------------------
/worm-food/webpack.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 |
3 | module.exports = {
4 | context: __dirname + "/src",
5 | entry: './index.js',
6 | output: {
7 | path: __dirname + '/dist',
8 | filename: 'pool-water.bundled.js',
9 | libraryTarget: 'var',
10 | library: 'svv',
11 | },
12 | module: {
13 | rules: [
14 | {
15 | test: /\.gltf$/,
16 | loader: 'raw-loader',
17 | },
18 | {
19 | test: /\.(frag|vert)?$/,
20 | loader: 'raw-loader',
21 | },
22 | {
23 | test: /\.js$/,
24 | exclude: /node_modules/,
25 | use: ['babel-loader'],
26 | }
27 | ],
28 | },
29 | resolve: {
30 | extensions: ['*', '.js'],
31 | },
32 | mode: "development",
33 | };
34 |
--------------------------------------------------------------------------------
/python-flask-server/src/server/app.py:
--------------------------------------------------------------------------------
1 | from .api import blueprint
2 | from .db import CustomerRequests
3 | from flask import Flask
4 | from flask_sqlalchemy import SQLAlchemy
5 | from x_x import x_x
6 |
7 |
8 | def get_app(debug=False):
9 |
10 | app = Flask(__name__)
11 | app.config["DEBUG"] = True
12 | app.config["SECRET_KEY"] = "WHATEVER"
13 | app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
14 | app.config["TEMPLATES_AUTO_RELOAD"] = True
15 | app.config["TESTING"] = True
16 | app.jinja_env.globals["x_x"] = x_x
17 |
18 | db = SQLAlchemy()
19 |
20 | db.init_app(app)
21 |
22 | if debug:
23 | app.config["SQLALCHEMY_ECHO"] = True
24 | logger = app.logger
25 | logger.setLevel("DEBUG")
26 |
27 | # ...
28 | app.register_blueprint(blueprint())
29 |
30 | return app
31 |
--------------------------------------------------------------------------------
/python-lib/src/x_x/splashes/tails.txt:
--------------------------------------------------------------------------------
1 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜
2 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬛⬜⬜⬜⬜⬜⬛🟧⬛⬜⬜⬜
3 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧⬛⬜⬛⬛⬛🟧🟧⬛🟧🟧🟧
4 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬛🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛⬛
5 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬜⬛🟧🟧🟧🟧🟧🟧🟧⬛⬛⬛
6 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧🟧⬜
7 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜🟧🟧🟧⬜⬜🟧⬜⬛⬜⬜
8 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧🟧🟧⬜⬜🟦🟧🟦⬛⬜⬜
9 | ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧🟧⬜⬜⬛🟧⬛⬛⬜⬜
10 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜🟧🟧⬜🟦⬜🟦⬛⬜⬜
11 | ⬜⬜⬜⬜⬜⬜⬜⬛⬜⬛🟧⬜⬜⬜⬜⬜⬜⬛⬛⬛⬜
12 | ⬜⬜⬜⬜⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜
13 | ⬜⬜⬛⬛⬜⬜⬜⬜⬛⬜⬛🟧⬜⬜⬜⬜⬜⬜⬛⬜⬜
14 | ⬜⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬛🟧🟧🟧🟧⬛⬛⬜⬜⬜
15 | ⬛⬜⬛⬛⬜⬜⬜⬜⬜🟧⬛🟧🟧🟧🟧⬜⬜⬛⬜⬜⬜
16 | ⬜⬛⬛⬛⬜⬜⬜⬜🟧⬛⬛🟧⬛🟧⬜⬜⬜⬜⬛⬜⬜
17 | ⬜⬜⬛⬛⬜⬜🟧🟧🟧⬛🟧⬛🟧🟧⬜⬜⬜⬜⬛⬜⬜
18 | ⬜⬛🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛🟧🟧⬜⬜⬜⬜⬛⬜⬜
19 | ⬜⬛🟧⬛🟧🟧🟧🟧⬛⬜⬜⬜⬛🟧⬛⬜⬜⬛⬜⬛⬜
20 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬜⬜⬜⬛🟧⬛⬛⬛⬜⬜⬜⬛
21 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬜⬜⬛⬛🟧⬛🟧⬛⬜⬜⬛⬜
22 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬛⬛🟧⬛🟧⬛🟧⬛⬛⬛⬜⬜
23 | ⬛🟧🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛⬜⬜⬛⬛⬜⬛⬛⬜⬜
24 | ⬛⬛🟧🟧⬛⬛🟧🟧🟧🟧⬛🟥🟥🟥⬜⬜🟥⬜⬜⬛⬜
25 | ⬜⬛⬛🟧🟧🟧⬛⬛⬛⬛🟥🟥🟥⬜⬜⬜⬜🟥⬜⬜⬛
26 | ⬜⬜⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
27 |
--------------------------------------------------------------------------------
/python-sanic-server/src/x_x/splashes/tails.txt:
--------------------------------------------------------------------------------
1 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜⬜⬜
2 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬛⬜⬜⬜⬜⬜⬛🟧⬛⬜⬜⬜
3 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧⬛⬜⬛⬛⬛🟧🟧⬛🟧🟧🟧
4 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬛🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛⬛
5 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬜⬛🟧🟧🟧🟧🟧🟧🟧⬛⬛⬛
6 | ⬜⬜⬜⬜⬜⬜⬜⬛🟧⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧🟧⬜
7 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜🟧🟧🟧⬜⬜🟧⬜⬛⬜⬜
8 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧🟧🟧⬜⬜🟦🟧🟦⬛⬜⬜
9 | ⬜⬜⬜⬜⬜⬜⬜⬜⬜⬛🟧🟧🟧⬜⬜⬛🟧⬛⬛⬜⬜
10 | ⬜⬜⬜⬜⬜⬜⬜⬜⬛⬜⬜⬜🟧🟧⬜🟦⬜🟦⬛⬜⬜
11 | ⬜⬜⬜⬜⬜⬜⬜⬛⬜⬛🟧⬜⬜⬜⬜⬜⬜⬛⬛⬛⬜
12 | ⬜⬜⬜⬜⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬛⬛⬜
13 | ⬜⬜⬛⬛⬜⬜⬜⬜⬛⬜⬛🟧⬜⬜⬜⬜⬜⬜⬛⬜⬜
14 | ⬜⬛⬜⬜⬜⬜⬜⬜⬜⬛⬛⬛🟧🟧🟧🟧⬛⬛⬜⬜⬜
15 | ⬛⬜⬛⬛⬜⬜⬜⬜⬜🟧⬛🟧🟧🟧🟧⬜⬜⬛⬜⬜⬜
16 | ⬜⬛⬛⬛⬜⬜⬜⬜🟧⬛⬛🟧⬛🟧⬜⬜⬜⬜⬛⬜⬜
17 | ⬜⬜⬛⬛⬜⬜🟧🟧🟧⬛🟧⬛🟧🟧⬜⬜⬜⬜⬛⬜⬜
18 | ⬜⬛🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛🟧🟧⬜⬜⬜⬜⬛⬜⬜
19 | ⬜⬛🟧⬛🟧🟧🟧🟧⬛⬜⬜⬜⬛🟧⬛⬜⬜⬛⬜⬛⬜
20 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬜⬜⬜⬛🟧⬛⬛⬛⬜⬜⬜⬛
21 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬜⬜⬛⬛🟧⬛🟧⬛⬜⬜⬛⬜
22 | ⬛🟧⬛🟧🟧🟧🟧🟧⬛⬛⬛🟧⬛🟧⬛🟧⬛⬛⬛⬜⬜
23 | ⬛🟧🟧⬛🟧🟧🟧🟧🟧🟧🟧⬛⬜⬜⬛⬛⬜⬛⬛⬜⬜
24 | ⬛⬛🟧🟧⬛⬛🟧🟧🟧🟧⬛🟥🟥🟥⬜⬜🟥⬜⬜⬛⬜
25 | ⬜⬛⬛🟧🟧🟧⬛⬛⬛⬛🟥🟥🟥⬜⬜⬜⬜🟥⬜⬜⬛
26 | ⬜⬜⬜⬛⬛⬛⬛⬛⬜⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
27 |
--------------------------------------------------------------------------------
/python-lib/src/x_x/splashes/sword.txt:
--------------------------------------------------------------------------------
1 | ,--.
2 | { }
3 | K, }
4 | / ~Y`
5 | , / /
6 | {_'-K.__/
7 | `/-.__L._
8 | / ' /`\_}
9 | / ' /
10 | ____ / ' /
11 | ,-'~~~~ ~~/ ' /_
12 | ,' ``~~~ ',
13 | ( Y
14 | { I
15 | { - `,
16 | | ', )
17 | | | ,..__ __. Y
18 | | .,_./ Y ' / ^Y J )|
19 | \ |' / | | ||
20 | \ L_/ . _ (_,.'(
21 | \, , ^^""' / | )
22 | \_ \ /,L] /
23 | '-_~-, ` ` ./`
24 | `'{_ )
25 | ^^\..___,.--` ZEUS
26 |
--------------------------------------------------------------------------------
/python-flask-server/src/x_x/splashes/sword.txt:
--------------------------------------------------------------------------------
1 | ,--.
2 | { }
3 | K, }
4 | / ~Y`
5 | , / /
6 | {_'-K.__/
7 | `/-.__L._
8 | / ' /`\_}
9 | / ' /
10 | ____ / ' /
11 | ,-'~~~~ ~~/ ' /_
12 | ,' ``~~~ ',
13 | ( Y
14 | { I
15 | { - `,
16 | | ', )
17 | | | ,..__ __. Y
18 | | .,_./ Y ' / ^Y J )|
19 | \ |' / | | ||
20 | \ L_/ . _ (_,.'(
21 | \, , ^^""' / | )
22 | \_ \ /,L] /
23 | '-_~-, ` ` ./`
24 | `'{_ )
25 | ^^\..___,.--` ZEUS
26 |
--------------------------------------------------------------------------------
/python-sanic-server/src/x_x/splashes/sword.txt:
--------------------------------------------------------------------------------
1 | ,--.
2 | { }
3 | K, }
4 | / ~Y`
5 | , / /
6 | {_'-K.__/
7 | `/-.__L._
8 | / ' /`\_}
9 | / ' /
10 | ____ / ' /
11 | ,-'~~~~ ~~/ ' /_
12 | ,' ``~~~ ',
13 | ( Y
14 | { I
15 | { - `,
16 | | ', )
17 | | | ,..__ __. Y
18 | | .,_./ Y ' / ^Y J )|
19 | \ |' / | | ||
20 | \ L_/ . _ (_,.'(
21 | \, , ^^""' / | )
22 | \_ \ /,L] /
23 | '-_~-, ` ` ./`
24 | `'{_ )
25 | ^^\..___,.--` ZEUS
26 |
--------------------------------------------------------------------------------
/python-lib/setup.cfg:
--------------------------------------------------------------------------------
1 | [metadata]
2 | name = x_x
3 | version = 1.0.0
4 | author = Matt <3
5 | author_email = matt@worldshadowgovernment.com
6 | url = https://github.com/whatever/x_x
7 | description = wip
8 | long_description = file: README.md
9 | long_description_content_type = text/markdown
10 | keywords = x_x
11 | license = UNLICENSE
12 | classifiers =
13 | Programming Language :: Python :: 3
14 | License :: UNLICENSE
15 |
16 | [options]
17 | package_dir =
18 | = src
19 | packages = find:
20 | install_requires =
21 |
22 | [options.packages.find]
23 | where = src
24 | exclude =
25 | examples*
26 | tools*
27 | docs*
28 | x_x.tests*
29 |
30 | [options.entry_points]
31 | console_scripts =
32 | x_x = x_x.cli:main
33 |
34 | [options.package_data]
35 | * = README.md
36 |
37 | [options.extras_require]
38 | dev =
39 | pyright >= 1.1.0
40 | pytest >= 7.0.0
41 | flake8 >= 7.0.0
42 |
43 | [flake8]
44 | max-line-length = 120
45 |
46 |
--------------------------------------------------------------------------------
/python-sanic-server/src/server/cli.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import argparse
4 |
5 | import random
6 |
7 | from sanic import Sanic
8 | from sanic.worker.loader import AppLoader
9 | from .app import get_app
10 |
11 | from x_x import splash
12 |
13 |
14 | def parameterized_app():
15 | return get_app(random.randint(0, 666_666))
16 |
17 |
18 | def main():
19 | parser = argparse.ArgumentParser(description='Run the Sanic app')
20 | parser.add_argument("--host", type=str)
21 | parser.add_argument("--port", type=int)
22 | parser.add_argument("--workers", type=int, default=5)
23 | parser.add_argument("--message", type=str)
24 | args = parser.parse_args()
25 |
26 | print(splash("tails"))
27 |
28 | loader = AppLoader(factory=parameterized_app)
29 |
30 | app = loader.load()
31 |
32 | app.prepare(
33 | host=args.host,
34 | port=args.port,
35 | workers=args.workers,
36 | dev=True,
37 | )
38 |
39 | Sanic.serve(primary=app, app_loader=loader)
40 |
--------------------------------------------------------------------------------
/python-sanic-server/src/server/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | believe in me because i believe in you
5 |
6 |
7 |
12 |
13 |
14 |
15 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/worm-food/src/Bas3d.js:
--------------------------------------------------------------------------------
1 | import * as THREE from "three";
2 |
3 | import {App} from "@pool-water/secret-sauce";
4 |
5 | export class Bas3d extends App {
6 | constructor({el}) {
7 | super({el: el});
8 |
9 | this.el = el;
10 |
11 | this.clock = new THREE.Clock();
12 |
13 | this.ctx = el.getContext("webgl", {preserveDrawingBuffer: true});
14 |
15 | this.renderer = new THREE.WebGLRenderer({
16 | canvas: el,
17 | antialias: true,
18 | });
19 |
20 | this.camera = new THREE.PerspectiveCamera(
21 | 80,
22 | window.innerWidth/window.innerHeight,
23 | 0.1,
24 | 1000,
25 | );
26 |
27 | this.renderer.setPixelRatio(window.devicePixelRation);
28 |
29 | this.renderer.setSize(el.width, el.height);
30 |
31 | this.scene = new THREE.Scene();
32 | }
33 |
34 | update() {
35 | }
36 |
37 | draw() {
38 | this.renderer.render(this.scene, this.camera);
39 | }
40 |
41 | setSize(w, h) {
42 | this.renderer.setSize(w, h);
43 | this.camera.aspect = w/h;
44 | this.camera.updateProjectionMatrix();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/python-sanic-server/setup.cfg:
--------------------------------------------------------------------------------
1 | [metadata]
2 | name = x_x
3 | version = 1.0.0
4 | author = Matt <3
5 | author_email = matt@worldshadowgovernment.com
6 | url = https://github.com/whatever/templates/
7 | description = gotta go fast
8 | long_description = file: README.md
9 | long_description_content_type = text/markdown
10 | keywords = x_x
11 | license = UNLICENSE
12 | classifiers =
13 | Programming Language :: Python :: 3
14 | License :: UNLICENSE
15 |
16 | [options]
17 | package_dir =
18 | = src
19 | packages = find:
20 | install_requires =
21 | python-socketio[asyncio_client] >= 5.11.2
22 | sanic >= 23.12.1
23 |
24 | [options.packages.find]
25 | where = src
26 | exclude =
27 | examples*
28 | tools*
29 | docs*
30 | x_x.tests*
31 |
32 | [options.entry_points]
33 | console_scripts =
34 | gotta-go-fast = server.cli:main
35 |
36 | [options.package_data]
37 | * = README.md
38 |
39 | [options.extras_require]
40 | dev =
41 | flake8 >= 7.0.0
42 | pyright >= 1.1.0
43 | pytest >= 7.0.0
44 | pytest-asyncio >= 0.23.6
45 | sanic-testing >= 23.12.0
46 |
47 | [flake8]
48 | max-line-length = 120
49 |
50 |
--------------------------------------------------------------------------------
/python-flask-server/setup.cfg:
--------------------------------------------------------------------------------
1 | [metadata]
2 | name = server
3 | version = 1.0.0
4 | author = Matt <3
5 | author_email = matt@worldshadowgovernment.com
6 | url = https://github.com/whatever/templates/
7 | description = x_x
8 | long_description = file: README.md
9 | long_description_content_type = text/markdown
10 | keywords = x_x
11 | license = UNLICENSED
12 | classifiers =
13 | Programming Language :: Python :: 3
14 |
15 | [options]
16 | package_dir =
17 | = src
18 | packages = find:
19 | install_requires =
20 | Flask >= 3.0.2
21 | Flask-Login >= 0.6.3
22 | Flask-SQLAlchemy >= 3.1.1
23 | gunicorn >= 21.2.0
24 |
25 | [options.packages.find]
26 | where = src
27 | exclude =
28 | examples*
29 | tools*
30 | docs*
31 | x_x.tests*
32 |
33 | [options.entry_points]
34 | console_scripts =
35 | server = server.cli:main
36 | # x_x = x_x.cli:main
37 | # knockknock = knock_knock.cli:main
38 | # knock = knock_knock.cli:register
39 |
40 | [options.package_data]
41 | * = README.md
42 |
43 | [options.extras_require]
44 | dev =
45 | pyright >= 1.1.0
46 | pytest >= 7.0.0
47 | flake8 >= 7.0.0
48 |
49 | [flake8]
50 | max-line-length = 120
51 |
52 |
--------------------------------------------------------------------------------
/python-sanic-server/src/server/app.py:
--------------------------------------------------------------------------------
1 | import os.path
2 | import socketio
3 |
4 | from sanic import Sanic
5 | from sanic.response import json
6 |
7 |
8 | def get_app(r):
9 |
10 | app = Sanic("x_x")
11 |
12 | sio = socketio.AsyncServer(async_mode='sanic')
13 |
14 | sio.attach(app)
15 |
16 | @app.listener('before_server_start')
17 | async def setup_background(app, loop):
18 | # app.add_task(background(sio))
19 | pass
20 |
21 | @app.route("/lmk/status")
22 | def status(request):
23 | return json({"status": "ok"})
24 |
25 | @app.route("/lmk/ping")
26 | def ping(request):
27 | return json({"ping": "pong"})
28 |
29 | @sio.on("connect")
30 | async def connect(sid, environ):
31 | print("connect ", sid)
32 |
33 | @sio.event
34 | async def disconnect(sid):
35 | print("disconnect ", sid)
36 |
37 | @sio.event
38 | async def update(sid, data):
39 | print("update ", data)
40 | await sio.emit("update", {"weom": "meow"})
41 |
42 | dirname = os.path.join(
43 | os.path.dirname(__file__),
44 | "static",
45 | )
46 |
47 | app.static('/static', dirname)
48 |
49 | return app
50 |
--------------------------------------------------------------------------------
/python-lib/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/python-lib/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/python-flask-server/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/python-flask-server/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/python-sanic-server/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/python-sanic-server/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/worm-food/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "art-practice",
3 | "version": "0.0.2",
4 | "description": "a boilerplate to create a generative token on fxhash",
5 | "main": "src/index.js",
6 | "author": "fxhash",
7 | "license": "MIT",
8 | "scripts": {
9 | "ayy": "webpack",
10 | "bleach": "javascript-obfuscator dist/pool-water.bundled.js",
11 | "livest": "node ./node_modules/webpack/bin/webpack.js --watch --progresswebpack",
12 | "lmao": "webpack serve --static app --no-hot --open",
13 | "test": "mocha --require @babel/register tests"
14 | },
15 | "dependencies": {
16 | "alea": "^1.0.1",
17 | "assert": "^2.0.0",
18 | "npm": "^9.2.0",
19 | "three": "^0.135.0"
20 | },
21 | "devDependencies": {
22 | "@babel/core": "^7.2.2",
23 | "@babel/preset-env": "^7.1.6",
24 | "@babel/register": "^7.0.0",
25 | "@eslint/create-config": "^0.1.2",
26 | "@pool-water/math": "file:../../pool-water/math",
27 | "@pool-water/secret-sauce": "file:../../pool-water/secret-sauce",
28 | "babel-loader": "^8.0.4",
29 | "chai": "^4.3.6",
30 | "copy-webpack-plugin": "^9.0.1",
31 | "css-loader": "^6.4.0",
32 | "deep-eql": "^4.0.0",
33 | "eslint": "^8.8.0",
34 | "html-webpack-plugin": "^5.4.0",
35 | "javascript-obfuscator": "^4.0.0",
36 | "mocha": "^9.2.0",
37 | "raw-loader": "4.0.2",
38 | "simplex-noise": "^4.0.1",
39 | "webpack": "^5.59.0",
40 | "webpack-cli": "^4.9.1",
41 | "webpack-dev-server": "^4.3.1"
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/python-flask-server/src/server/cli.py:
--------------------------------------------------------------------------------
1 | import argparse
2 |
3 | from getpass import getpass
4 | from .app import get_app
5 | from .wsgi import KnockKnockApp
6 | from werkzeug.security import generate_password_hash
7 |
8 | from x_x import splash
9 |
10 |
11 | def main():
12 |
13 | parser = argparse.ArgumentParser(description="knock*knock")
14 | parser.add_argument("--host", default="0.0.0.0", help="host address")
15 | parser.add_argument("--port", default=8181, help="port number")
16 | parser.add_argument("--workers", default=2, help="number of workers")
17 | parser.add_argument("--bootstrap", action="store_true", help="bootstrap the database")
18 | args = parser.parse_args()
19 |
20 | print(f"\033[92m{splash('frog')}\033[0m", end="\n\n")
21 |
22 | options = {
23 | "bind": f"{args.host}:{args.port}",
24 | "workers": args.workers,
25 | }
26 |
27 | app = get_app()
28 |
29 | KnockKnockApp(app, options).run()
30 |
31 |
32 | # def register():
33 | # """Register an email with a password"""
34 | #
35 | # parser = argparse.ArgumentParser(description="register user/password")
36 | # parser.add_argument("email", type=str, help="email address")
37 | # args = parser.parse_args()
38 | #
39 | # email = args.email
40 | # hashword = generate_password_hash(
41 | # getpass("enter password:"),
42 | # # method="sha256",
43 | # )
44 | #
45 | # user = AdminUser(
46 | # email=email,
47 | # password=hashword,
48 | # )
49 | #
50 | # app = get_app(None, False)
51 | #
52 | # with app.app_context():
53 | # try:
54 | # auth_db.session.add(user)
55 | # auth_db.session.commit()
56 | # except Exception as e:
57 | # print("Failed with error:", e)
58 |
--------------------------------------------------------------------------------
/worm-food/src/objs/WeirdRing.js:
--------------------------------------------------------------------------------
1 | import * as THREE from "three";
2 |
3 | export class Rod extends THREE.BufferGeometry {
4 | constructor(w, h, d, segments, twist) {
5 | super();
6 |
7 | let hinc = h / segments;
8 |
9 | let positions = [];
10 |
11 | let normals = [];
12 |
13 | for (let i=0; i < segments+1; i++) {
14 |
15 | let x1 = -w/2.0;
16 | let x2 = +w/2.0;
17 | let z1 = -d/2.0;
18 | let z2 = +d/2.0;
19 |
20 | let y = hinc*i - h/2.0;
21 |
22 | // Circle
23 | for (let j=0; j < 4; j++) {
24 | let theta = j/4 * 2 * Math.PI;
25 | let x = w*Math.cos(-theta+twist*i);
26 | let y = hinc*i - h/2.0;
27 | let z = w*Math.sin(-theta+twist*i);
28 | positions.push(x, y, z);
29 | }
30 |
31 | /*
32 | positions.push(
33 | x1, y, z1, // 0
34 | x1, y, z2, // 1
35 | x2, y, z2, // 2
36 | x2, y, z1, // 3
37 | );
38 | */
39 |
40 | normals.push(
41 | x1, 0, z1, // 0
42 | x1, 0, z2, // 1
43 | x2, 0, z2, // 2
44 | x2, 0, z1, // 3
45 | );
46 |
47 | }
48 |
49 | let indices = []
50 |
51 | for (let i=0; i < segments; i++) {
52 | let j = 4*i;
53 | indices.push(
54 | // Face 1
55 | j+0, j+1, j+4,
56 | j+1, j+5, j+4,
57 |
58 | // Face 2
59 | j+1, j+2, j+5,
60 | j+2, j+6, j+5,
61 |
62 | // Face 3
63 | j+2, j+3, j+7,
64 | j+2, j+7, j+6,
65 |
66 | // Face 4
67 | j+3, j+0, j+7,
68 | j+0, j+4, j+7,
69 | );
70 | }
71 |
72 | this.setAttribute("position", new THREE.Float32BufferAttribute(positions, 3));
73 | // this.setAttribute("normal", new THREE.Float32BufferAttribute(normals, 3));
74 | this.setIndex(indices);
75 | this.computeVertexNormals();
76 | }
77 | }
78 |
79 | export class WeirdRing extends THREE.Object3D {
80 | constructor() {
81 | super();
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/worm-food/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | i wanna be your joey ramone
5 |
6 |
7 |
8 |
9 |
10 |
11 |
124 |
125 |
126 |
--------------------------------------------------------------------------------
/worm-food/src/index.js:
--------------------------------------------------------------------------------
1 | import * as THREE from "three";
2 | import {Bas3d} from "/Bas3d.js";
3 | import {Rod, WeirdRing} from "/objs/WeirdRing.js";
4 |
5 | import {OBJLoader} from "three/examples/jsm/loaders/ObjLoader.js";
6 | import {EffectComposer} from "three/examples/jsm/postprocessing/EffectComposer.js";
7 | import {RenderPass} from "three/examples/jsm/postprocessing/RenderPass.js";
8 | import {UnrealBloomPass} from "three/examples/jsm/postprocessing/UnrealBloomPass.js";
9 | import {VertexNormalsHelper} from "three/examples/jsm/helpers/VertexNormalsHelper.js";
10 |
11 |
12 | export class WorldShadowGovernmentApp extends Bas3d {
13 |
14 | constructor({el}) {
15 | super({el: el});
16 |
17 | this.outsider = new THREE.PerspectiveCamera(
18 | 80,
19 | window.innerWidth/window.innerHeight,
20 | 0.1,
21 | 1000,
22 | );
23 |
24 | const bloomParams = {
25 | exposure: 1.0,
26 | bloomStrength: 2.5,
27 | bloomThreshold: 0.2,
28 | bloomRadius: 3.0,
29 | };
30 |
31 | this.bloomPass = new UnrealBloomPass(
32 | new THREE.Vector2(window.innerWidth, window.innerHeight),
33 | 1.5, 0.4, 0.85,
34 | );
35 |
36 | const renderScene = new RenderPass(this.scene, this.outsider);
37 |
38 | this.composer = new EffectComposer(this.renderer);
39 | this.composer.addPass(renderScene);
40 | this.composer.addPass(this.bloomPass);
41 |
42 | this.bloomPass.threshold = bloomParams.bloomThreshold;
43 | this.bloomPass.strength = bloomParams.bloomStrength;
44 | this.bloomPass.radius = bloomParams.bloomRadius;
45 |
46 | this.renderer.shadowMap.enabled = true;
47 | this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
48 |
49 | let fake_props = {
50 | color: 0x775555,
51 | emissive: 0x000000,
52 | roughness: 0.524,
53 | metalness: 0.7,
54 | reflectivity: 0.8,
55 | clearcoat: 0.67,
56 | clearcoatRoughness: 0.0,
57 | // flatShading: true,
58 | };
59 |
60 | let props = {
61 | color: 0x000000,
62 | emissive: 0x000000,
63 | roughness: 0.524,
64 | metalness: 0.7,
65 | reflectivity: 0.8,
66 | clearcoat: 0.67,
67 | clearcoatRoughness: 0.0,
68 | // flatShading: true,
69 | };
70 |
71 | this.mat = new THREE.MeshPhysicalMaterial(props);
72 |
73 | let mat = new THREE.MeshPhysicalMaterial(props);
74 |
75 | let s = 3.0;
76 |
77 | this.mesh = new THREE.Mesh(
78 | new THREE.IcosahedronGeometry(1.0),
79 | mat,
80 | );
81 |
82 | // this.scene.add(this.mesh);
83 |
84 | let amb = new THREE.AmbientLight(0xCCCCCC);
85 | this.scene.add(amb);
86 |
87 | let intensity = 4.0;
88 | this.distance = 0.4;
89 |
90 | this.hot = new THREE.DirectionalLight(0xCC00CC, intensity);
91 | this.hot.position.set(10.0, 4.0, this.distance/2.0);
92 | this.scene.add(this.hot);
93 |
94 | this.cold = new THREE.DirectionalLight(0x00CCCC, intensity);
95 | this.cold.position.set(10.0, 4.0, -this.distance/2.0);
96 | this.scene.add(this.cold);
97 |
98 | this.rings = [];
99 |
100 | this.group = new THREE.Object3D();
101 |
102 | for (let i=0; i < 5; i++) {
103 |
104 | if (i == 2) {
105 | continue;
106 | }
107 |
108 | let radius = 6*(i+1);
109 | let mesh = new THREE.Mesh(
110 | new THREE.TorusGeometry(radius, Math.sqrt(radius)/2.0, 16 , 128),
111 | // new THREE.MeshBasicMaterial({color: 0xFF00FF}),
112 | new THREE.MeshPhysicalMaterial(props),
113 |
114 | );
115 | mesh.receiveShadow = true;
116 | mesh.castShadow = true;
117 |
118 | this.rings.push(mesh);
119 | this.group.add(mesh);
120 | }
121 |
122 | this.scene.add(this.group);
123 |
124 | this.getHandObj();
125 |
126 |
127 | this.helpers = new THREE.Group();
128 | this.helpers.add(new THREE.CameraHelper(this.camera));
129 | this.scene.add(this.helpers);
130 |
131 | this.outsiderView = true;
132 | this.bloom = true;
133 |
134 | let testProps = new THREE.MeshPhysicalMaterial({
135 | color: 0x333333,
136 | emissive: 0x000000,
137 | flatShading: true,
138 | side: THREE.DoubleSide,
139 | });
140 |
141 | // XXX: DEBUG CODE
142 | this.group.visible = true;
143 | this.ring = new THREE.Mesh(
144 | new Rod(1.0, 10.0, 1.0, 3, 3/2/Math.PI),
145 | props,
146 | );
147 | // this.ring.add(new VertexNormalsHelper(this.ring));
148 |
149 |
150 | this.scene.add(this.ring);
151 | }
152 |
153 | update() {
154 |
155 | this.composer.passes[0].camera = this.outsiderView ? this.outsider : this.camera;
156 | this.helpers.visible = this.outsiderView;
157 |
158 | let s = 40.0;
159 | this.camera.position.set(0.0, 0.0, 20.0);
160 | this.camera.lookAt(new THREE.Vector3(0, 0, 0));
161 |
162 | this.outsider.position.set(s, s, s);
163 | this.outsider.lookAt(new THREE.Vector3(0, 0, 0));
164 |
165 |
166 | let t = +new Date();
167 | let u = t / 1000.0 / 30.0;
168 |
169 | this.ring.rotation.x = Math.PI/8;
170 | this.ring.rotation.y = +2*t/1000.0;
171 |
172 | this.mesh.rotation.set(3*u, -2*u, 1*u);
173 |
174 | this.rings.forEach((v, i) => {
175 | const c = t / 1000.0 / 69.0;
176 | const x = (11*(i+0))%7 - 4;
177 | const y = (17*(i+1))%7 - 4;
178 | const z = (29*(i+2))%7 - 4;
179 | v.rotation.set(c*x, c*y, c*z);
180 | });
181 | }
182 |
183 | draw() {
184 |
185 | if (this.bloom) {
186 | this.composer.render(this.scene, undefined);
187 | } else {
188 | this.renderer.render(this.scene, this.composer.passes[0].camera);
189 | }
190 | }
191 |
192 | setSize(w, h) {
193 | this.renderer.setSize(w, h);
194 | this.composer.setSize(w, h);
195 | this.camera.aspect = w/h;
196 | this.camera.updateProjectionMatrix();
197 | this.outsider.aspect = w/h;
198 | this.outsider.updateProjectionMatrix();
199 | }
200 |
201 | getHandObj() {
202 |
203 | const loader = new OBJLoader();
204 |
205 | // load a resource
206 | loader.load(
207 | // resource URL
208 | 'hand.obj',
209 |
210 | (object) => {
211 | let geo = object.children[0].geometry;
212 | let mat = new THREE.MeshPhysicalMaterial({
213 | color: 0x000000,
214 | emissive: 0x000000,
215 | roughness: 0.524,
216 | metalness: 0.7,
217 | reflectivity: 0.8,
218 | clearcoat: 0.67,
219 | clearcoatRoughness: 0.0,
220 | // flatShading: true,
221 | });
222 | let mesh = new THREE.Mesh(geo, mat);
223 | mesh.scale.set(3, 3, 3);
224 | // this.scene.add(mesh);
225 | },
226 | (xhr) => {
227 | },
228 | (error) => {
229 | console.log(error);
230 | },
231 | );
232 | }
233 |
234 | tweak({bloomThreshold, bloomStrength, bloomRadius, outsiderView, bloom, hot, cold, distance}) {
235 | this.bloomPass["threshold"] = bloomThreshold;
236 | this.bloomPass["strength"] = bloomStrength;
237 | this.bloomPass["radius"] = bloomRadius;
238 | this.outsiderView = outsiderView;
239 | this.bloom = bloom;
240 | this.hot.intensity = hot;
241 | this.cold.intensity = cold;
242 | this.distance = distance;
243 | this.hot.position.set(10.0, 4.0, this.distance/2.0);
244 | this.cold.position.set(10.0, 4.0, -this.distance/2.0);
245 | }
246 |
247 | }
248 |
--------------------------------------------------------------------------------
/worm-food/app/dat.gui.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * dat-gui JavaScript Controller Library
3 | * https://github.com/dataarts/dat.gui
4 | *
5 | * Copyright 2011 Data Arts Team, Google Creative Lab
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | */
13 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.dat={})}(this,function(e){"use strict";function t(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),s=e.a,a=Math.round(e.h),l=e.s.toFixed(1),d=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var c=e.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+s+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+s+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+a+",s:"+l+",v:"+d+"}":"HSVA_OBJ"===n?"{h:"+a+",s:"+l+",v:"+d+",a:"+s+"}":"unknown format"}function n(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(I.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(I.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function o(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(I.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(I.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}function i(e){if("0"===e||S.isUndefined(e))return 0;var t=e.match(U);return S.isNull(t)?0:parseFloat(t[1])}function r(e){var t=e.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}function s(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}function a(e,t,n,o,i){return o+(e-t)/(n-t)*(i-o)}function l(e,t,n,o){e.style.background="",S.each(ee,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function d(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}function c(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function u(e){X.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&X.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function _(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];n.innerHTML=t?n.value+"*":n.value}function h(e,t,n){if(n.__li=t,n.__gui=e,S.extend(n,{options:function(t){if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),f(e,n.object,n.property,{before:o,factoryArgs:[S.toArray(arguments)]})}if(S.isArray(t)||S.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),f(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof q){var o=new Q(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});S.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),X.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof Q){var i=function(t){if(S.isNumber(n.__min)&&S.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=f(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=S.compose(i,n.min),n.max=S.compose(i,n.max)}else n instanceof K?(X.bind(t,"click",function(){X.fakeEvent(n.__checkbox,"click")}),X.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof Z?(X.bind(t,"click",function(){X.fakeEvent(n.__button,"click")}),X.bind(t,"mouseover",function(){X.addClass(n.__button,"hover")}),X.bind(t,"mouseout",function(){X.removeClass(n.__button,"hover")})):n instanceof $&&(X.addClass(t,"color"),n.updateDisplay=S.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=S.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&_(e.getRoot(),!0),t},n.setValue)}function p(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(-1!==o){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,s=void 0;if(r[e.preset])s=r[e.preset];else{if(!r[se])return;s=r[se]}if(s[o]&&void 0!==s[o][t.property]){var a=s[o][t.property];t.initialValue=a,t.setValue(a)}}}}function f(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var i=void 0;if(o.color)i=new $(t,n);else{var r=[t,n].concat(o.factoryArgs);i=ne.apply(e,r)}o.before instanceof z&&(o.before=o.before.__li),p(e,i),X.addClass(i.domElement,"c");var s=document.createElement("span");X.addClass(s,"property-name"),s.innerHTML=i.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(i.domElement);var l=c(e,a,o.before);return X.addClass(l,he.CLASS_CONTROLLER_ROW),i instanceof $?X.addClass(l,"color"):X.addClass(l,H(i.getValue())),h(e,l,i),e.__controllers.push(i),i}function m(e,t){return document.location.href+"."+t}function g(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function b(e,t){t.style.display=e.useLocalStorage?"block":"none"}function v(e){var t=e.__save_row=document.createElement("li");X.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),X.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",X.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",X.addClass(o,"button"),X.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",X.addClass(i,"button"),X.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",X.addClass(r,"button"),X.addClass(r,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?S.each(e.load.remembered,function(t,n){g(e,n,n===e.preset)}):g(e,se,!1),X.bind(s,"change",function(){for(var t=0;t=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(A&&e.forEach&&e.forEach===A)e.forEach(t,n);else if(e.length===e.length+0){var o=void 0,i=void 0;for(o=0,i=e.length;o1?S.toArray(arguments):arguments[0];return S.each(O,function(t){if(t.litmus(e))return S.each(t.conversions,function(t,n){if(T=t.read(e),!1===L&&!1!==T)return L=T,T.conversionName=n,T.conversion=t,S.BREAK}),S.BREAK}),L},B=void 0,N={hsv_to_rgb:function(e,t,n){var o=Math.floor(e/60)%6,i=e/60-Math.floor(e/60),r=n*(1-t),s=n*(1-i*t),a=n*(1-(1-i)*t),l=[[n,a,r],[s,n,r],[r,n,a],[r,s,n],[a,r,n],[n,r,s]][o];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var o=Math.min(e,t,n),i=Math.max(e,t,n),r=i-o,s=void 0,a=void 0;return 0===i?{h:NaN,s:0,v:0}:(a=r/i,s=e===i?(t-n)/r:t===i?2+(n-e)/r:4+(e-t)/r,(s/=6)<0&&(s+=1),{h:360*s,s:a,v:i/255})},rgb_to_hex:function(e,t,n){var o=this.hex_with_component(0,2,e);return o=this.hex_with_component(o,1,t),o=this.hex_with_component(o,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(B=8*t)|e&~(255<this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),D(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=r(e),this}}]),t}(),Q=function(e){function t(e,n,o){function i(){l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function r(e){var t=d-e.clientY;l.setValue(l.getValue()+t*l.__impliedStep),d=e.clientY}function s(){X.unbind(window,"mousemove",r),X.unbind(window,"mouseup",s),i()}F(this,t);var a=V(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,o));a.__truncationSuspended=!1;var l=a,d=void 0;return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),X.bind(a.__input,"change",function(){var e=parseFloat(l.__input.value);S.isNaN(e)||l.setValue(e)}),X.bind(a.__input,"blur",function(){i()}),X.bind(a.__input,"mousedown",function(e){X.bind(window,"mousemove",r),X.bind(window,"mouseup",s),d=e.clientY}),X.bind(a.__input,"keydown",function(e){13===e.keyCode&&(l.__truncationSuspended=!0,this.blur(),l.__truncationSuspended=!1,i())}),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return j(t,W),P(t,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():s(this.getValue(),this.__precision),D(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(),q=function(e){function t(e,n,o,i,r){function s(e){e.preventDefault();var t=_.__background.getBoundingClientRect();return _.setValue(a(e.clientX,t.left,t.right,_.__min,_.__max)),!1}function l(){X.unbind(window,"mousemove",s),X.unbind(window,"mouseup",l),_.__onFinishChange&&_.__onFinishChange.call(_,_.getValue())}function d(e){var t=e.touches[0].clientX,n=_.__background.getBoundingClientRect();_.setValue(a(t,n.left,n.right,_.__min,_.__max))}function c(){X.unbind(window,"touchmove",d),X.unbind(window,"touchend",c),_.__onFinishChange&&_.__onFinishChange.call(_,_.getValue())}F(this,t);var u=V(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:o,max:i,step:r})),_=u;return u.__background=document.createElement("div"),u.__foreground=document.createElement("div"),X.bind(u.__background,"mousedown",function(e){document.activeElement.blur(),X.bind(window,"mousemove",s),X.bind(window,"mouseup",l),s(e)}),X.bind(u.__background,"touchstart",function(e){1===e.touches.length&&(X.bind(window,"touchmove",d),X.bind(window,"touchend",c),d(e))}),X.addClass(u.__background,"slider"),X.addClass(u.__foreground,"slider-fg"),u.updateDisplay(),u.__background.appendChild(u.__foreground),u.domElement.appendChild(u.__background),u}return j(t,W),P(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",D(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(),Z=function(e){function t(e,n,o){F(this,t);var i=V(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),r=i;return i.__button=document.createElement("div"),i.__button.innerHTML=void 0===o?"Fire":o,X.bind(i.__button,"click",function(e){return e.preventDefault(),r.fire(),!1}),X.addClass(i.__button,"button"),i.domElement.appendChild(i.__button),i}return j(t,z),P(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(),$=function(e){function t(e,n){function o(e){u(e),X.bind(window,"mousemove",u),X.bind(window,"touchmove",u),X.bind(window,"mouseup",r),X.bind(window,"touchend",r)}function i(e){_(e),X.bind(window,"mousemove",_),X.bind(window,"touchmove",_),X.bind(window,"mouseup",s),X.bind(window,"touchend",s)}function r(){X.unbind(window,"mousemove",u),X.unbind(window,"touchmove",u),X.unbind(window,"mouseup",r),X.unbind(window,"touchend",r),c()}function s(){X.unbind(window,"mousemove",_),X.unbind(window,"touchmove",_),X.unbind(window,"mouseup",s),X.unbind(window,"touchend",s),c()}function a(){var e=R(this.value);!1!==e?(p.__color.__state=e,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function c(){p.__onFinishChange&&p.__onFinishChange.call(p,p.__color.toOriginal())}function u(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=p.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,o=n.clientX,i=n.clientY,r=(o-t.left)/(t.right-t.left),s=1-(i-t.top)/(t.bottom-t.top);return s>1?s=1:s<0&&(s=0),r>1?r=1:r<0&&(r=0),p.__color.v=s,p.__color.s=r,p.setValue(p.__color.toOriginal()),!1}function _(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=p.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),p.__color.h=360*n,p.setValue(p.__color.toOriginal()),!1}F(this,t);var h=V(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));h.__color=new I(h.getValue()),h.__temp=new I(0);var p=h;h.domElement=document.createElement("div"),X.makeSelectable(h.domElement,!1),h.__selector=document.createElement("div"),h.__selector.className="selector",h.__saturation_field=document.createElement("div"),h.__saturation_field.className="saturation-field",h.__field_knob=document.createElement("div"),h.__field_knob.className="field-knob",h.__field_knob_border="2px solid ",h.__hue_knob=document.createElement("div"),h.__hue_knob.className="hue-knob",h.__hue_field=document.createElement("div"),h.__hue_field.className="hue-field",h.__input=document.createElement("input"),h.__input.type="text",h.__input_textShadow="0 1px 1px ",X.bind(h.__input,"keydown",function(e){13===e.keyCode&&a.call(this)}),X.bind(h.__input,"blur",a),X.bind(h.__selector,"mousedown",function(){X.addClass(this,"drag").bind(window,"mouseup",function(){X.removeClass(p.__selector,"drag")})}),X.bind(h.__selector,"touchstart",function(){X.addClass(this,"drag").bind(window,"touchend",function(){X.removeClass(p.__selector,"drag")})});var f=document.createElement("div");return S.extend(h.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),S.extend(h.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:h.__field_knob_border+(h.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),S.extend(h.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),S.extend(h.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),S.extend(f.style,{width:"100%",height:"100%",background:"none"}),l(f,"top","rgba(0,0,0,0)","#000"),S.extend(h.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),d(h.__hue_field),S.extend(h.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:h.__input_textShadow+"rgba(0,0,0,0.7)"}),X.bind(h.__saturation_field,"mousedown",o),X.bind(h.__saturation_field,"touchstart",o),X.bind(h.__field_knob,"mousedown",o),X.bind(h.__field_knob,"touchstart",o),X.bind(h.__hue_field,"mousedown",i),X.bind(h.__hue_field,"touchstart",i),h.__saturation_field.appendChild(f),h.__selector.appendChild(h.__field_knob),h.__selector.appendChild(h.__saturation_field),h.__selector.appendChild(h.__hue_field),h.__hue_field.appendChild(h.__hue_knob),h.domElement.appendChild(h.__input),h.domElement.appendChild(h.__selector),h.updateDisplay(),h}return j(t,z),P(t,[{key:"updateDisplay",value:function(){var e=R(this.getValue());if(!1!==e){var t=!1;S.each(I.COMPONENTS,function(n){if(!S.isUndefined(e[n])&&!S.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&S.extend(this.__color.__state,e)}S.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;S.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),S.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}}]),t}(),ee=["-moz-","-o-","-webkit-","-ms-",""],te={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}},ne=function(e,t){var n=e[t];return S.isArray(arguments[2])||S.isObject(arguments[2])?new Y(e,t,arguments[2]):S.isNumber(n)?S.isNumber(arguments[2])&&S.isNumber(arguments[3])?S.isNumber(arguments[4])?new q(e,t,arguments[2],arguments[3],arguments[4]):new q(e,t,arguments[2],arguments[3]):S.isNumber(arguments[4])?new Q(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Q(e,t,{min:arguments[2],max:arguments[3]}):S.isString(n)?new J(e,t):S.isFunction(n)?new Z(e,t,""):S.isBoolean(n)?new K(e,t):null},oe=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ie=function(){function e(){F(this,e),this.backgroundElement=document.createElement("div"),S.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),X.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),S.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;X.bind(this.backgroundElement,"click",function(){t.hide()})}return P(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),S.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",X.unbind(e.domElement,"webkitTransitionEnd",t),X.unbind(e.domElement,"transitionend",t),X.unbind(e.domElement,"oTransitionEnd",t)};X.bind(this.domElement,"webkitTransitionEnd",t),X.bind(this.domElement,"transitionend",t),X.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-X.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-X.getHeight(this.domElement)/2+"px"}}]),e}(),re=function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");te.inject(re);var se="Default",ae=function(){try{return!!window.localStorage}catch(e){return!1}}(),le=void 0,de=!0,ce=void 0,ue=!1,_e=[],he=function e(t){var n=this,o=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),X.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],o=S.defaults(o,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),o=S.defaults(o,{resizable:o.autoPlace,hideable:o.autoPlace}),S.isUndefined(o.load)?o.load={preset:se}:o.preset&&(o.load.preset=o.preset),S.isUndefined(o.parent)&&o.hideable&&_e.push(this),o.resizable=S.isUndefined(o.parent)&&o.resizable,o.autoPlace&&S.isUndefined(o.scrollable)&&(o.scrollable=!0);var i=ae&&"true"===localStorage.getItem(m(this,"isLocal")),r=void 0,s=void 0;if(Object.defineProperties(this,{parent:{get:function(){return o.parent}},scrollable:{get:function(){return o.scrollable}},autoPlace:{get:function(){return o.autoPlace}},closeOnTop:{get:function(){return o.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:o.load.preset},set:function(e){n.parent?n.getRoot().preset=e:o.load.preset=e,E(this),n.revert()}},width:{get:function(){return o.width},set:function(e){o.width=e,w(n,e)}},name:{get:function(){return o.name},set:function(e){o.name=e,s&&(s.innerHTML=o.name)}},closed:{get:function(){return o.closed},set:function(t){o.closed=t,o.closed?X.addClass(n.__ul,e.CLASS_CLOSED):X.removeClass(n.__ul,e.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return o.load}},useLocalStorage:{get:function(){return i},set:function(e){ae&&(i=e,e?X.bind(window,"unload",r):X.unbind(window,"unload",r),localStorage.setItem(m(n,"isLocal"),e))}}}),S.isUndefined(o.parent)){if(this.closed=o.closed||!1,X.addClass(this.domElement,e.CLASS_MAIN),X.makeSelectable(this.domElement,!1),ae&&i){n.useLocalStorage=!0;var a=localStorage.getItem(m(this,"gui"));a&&(o.load=JSON.parse(a))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,X.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),o.closeOnTop?(X.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(X.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),X.bind(this.__closeButton,"click",function(){n.closed=!n.closed})}else{void 0===o.closed&&(o.closed=!0);var l=document.createTextNode(o.name);X.addClass(l,"controller-name"),s=c(n,l);X.addClass(this.__ul,e.CLASS_CLOSED),X.addClass(s,"title"),X.bind(s,"click",function(e){return e.preventDefault(),n.closed=!n.closed,!1}),o.closed||(this.closed=!1)}o.autoPlace&&(S.isUndefined(o.parent)&&(de&&(ce=document.createElement("div"),X.addClass(ce,"dg"),X.addClass(ce,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ce),de=!1),ce.appendChild(this.domElement),X.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||w(n,o.width)),this.__resizeHandler=function(){n.onResizeDebounced()},X.bind(window,"resize",this.__resizeHandler),X.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),X.bind(this.__ul,"transitionend",this.__resizeHandler),X.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),o.resizable&&y(this),r=function(){ae&&"true"===localStorage.getItem(m(n,"isLocal"))&&localStorage.setItem(m(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=r,o.parent||function(){var e=n.getRoot();e.width+=1,S.defer(function(){e.width-=1})}()};he.toggleHide=function(){ue=!ue,S.each(_e,function(e){e.domElement.style.display=ue?"none":""})},he.CLASS_AUTO_PLACE="a",he.CLASS_AUTO_PLACE_CONTAINER="ac",he.CLASS_MAIN="main",he.CLASS_CONTROLLER_ROW="cr",he.CLASS_TOO_TALL="taller-than-window",he.CLASS_CLOSED="closed",he.CLASS_CLOSE_BUTTON="close-button",he.CLASS_CLOSE_TOP="close-top",he.CLASS_CLOSE_BOTTOM="close-bottom",he.CLASS_DRAG="drag",he.DEFAULT_WIDTH=245,he.TEXT_CLOSED="Close Controls",he.TEXT_OPEN="Open Controls",he._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||he.toggleHide()},X.bind(window,"keydown",he._keydownHandler,!1),S.extend(he.prototype,{add:function(e,t){return f(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return f(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;S.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ce.removeChild(this.domElement);var e=this;S.each(this.__folders,function(t){e.removeFolder(t)}),X.unbind(window,"keydown",he._keydownHandler,!1),u(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new he(t);this.__folders[e]=n;var o=c(this,n.domElement);return X.addClass(o,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],u(e);var t=this;S.each(e.__folders,function(t){e.removeFolder(t)}),S.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=X.getOffset(e.__ul).top,n=0;S.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=X.getHeight(t))}),window.innerHeight-t-20\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n \n\n
Automatically save\n values to
localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n'),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;S.each(Array.prototype.slice.call(arguments),function(t){0===e.__rememberedObjects.length&&v(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&w(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=x(this)),e.folders={},S.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=x(this),_(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[se]=x(this,!0)),this.load.remembered[e]=x(this),this.preset=e,g(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){S.each(this.__controllers,function(t){this.getRoot().load.remembered?p(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),S.each(this.__folders,function(e){e.revert(e)}),e||_(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&C(this.__listening)},updateDisplay:function(){S.each(this.__controllers,function(e){e.updateDisplay()}),S.each(this.__folders,function(e){e.updateDisplay()})}});var pe={Color:I,math:N,interpret:R},fe={Controller:z,BooleanController:K,OptionController:Y,StringController:J,NumberController:W,NumberControllerBox:Q,NumberControllerSlider:q,FunctionController:Z,ColorController:$},me={dom:X},ge={GUI:he},be=he,ve={color:pe,controllers:fe,dom:me,gui:ge,GUI:be};e.color=pe,e.controllers=fe,e.dom=me,e.gui=ge,e.GUI=be,e.default=ve,Object.defineProperty(e,"__esModule",{value:!0})});
14 |
--------------------------------------------------------------------------------