A custom shader draw 3d cube in colorful ASCII characters.
A Pen by Lingjia Liu on CodePen.
| # define an exception for flow control | |
| class ELSE(Exception): pass | |
| # since we cannot write: `condition or raise ELSE()` => (syntax error) | |
| # we need to define a func to raise an exception | |
| def THEN(): | |
| raise ELSE() | |
| # define our IF to make it looks intuitive | |
| def IF(condition): |
| /** | |
| * Why we need the soucemap path fixer? | |
| * | |
| * 1) postcss-loader + css-loader suck! | |
| * https://github.com/postcss/postcss-loader/issues/390#issuecomment-417584816 | |
| * | |
| * 2) Don't insert absolute paths into the module code as they break hashing when the root for the project is moved. | |
| * https://webpack.js.org/contribute/writing-a-loader/#absolute-paths | |
| */ |
| { | |
| "dev": "cross-env NODE_ENV=development webpack-dev-server --config build/webpack.config.babel.js --env development --hot --inline", | |
| "dev-debug-win": "node %NODE_DEBUG_OPTION% ./node_modules/webpack-dev-server/bin/webpack-dev-server --config build/webpack.config.babel.js --env development --hot --inline", | |
| "dev-debug-osx": "node $NODE_DEBUG_OPTION ./node_modules/webpack-dev-server/bin/webpack-dev-server --config build/webpack.config.babel.js --env development --hot --inline" | |
| } |
A custom shader draw 3d cube in colorful ASCII characters.
A Pen by Lingjia Liu on CodePen.
| <canvas width="200" height="200" id="case1"> | |
| rejection sample | |
| </canvas> | |
| <canvas width="200" height="200" id="case2"> | |
| random theta with random radius sample | |
| </canvas> | |
| <canvas width="200" height="200" id="case3"> | |
| random theta with sqrted random radius sample |
| <div id='container'></div> | |
| <!-- read the blog post for more: https://blog.mutoo.im/2017/09/15/matrix-code-rain-on-web/ --> |
A javascript implementation of Real-Time Fluid Dynamics for Games [Jos Stam, 2003]
A Pen by Lingjia Liu on CodePen.
A javascript implementation of 2D interactive particle-based fluid [Daniel Månsson, 2013].
A Pen by Lingjia Liu on CodePen.
| <canvas id="stage"></canvas> |
| <div id="app"> | |
| <div ref="canvas"> | |
| </div> | |
| <div class="caption"> | |
| {{pathString}} | |
| </div> | |
| </div> |