Wykres commitów

12 Commity (main)

Autor SHA1 Wiadomość Data
Atul Varma 849afc2906
Add a cluster editor (#230)
Currently it's possible to generate random clusters (formerly known as creatures), but unlike mandalas, there's no way to _edit_ one if you decide that there's something about it that you'd like to change.  This means, for instance, that if a randomly-generated cluster looks nice but needs a hat, or if it has arms you don't like, or if you find something cool in the gallery but want to remix it a bit, you will be able to make those changes.

It also isn't currently possible to randomly generate a cluster with lots of complexity; the data structure to represent a cluster is defined recursively, however, so this editing UI--however horrible this initial version is--allows for the construction of clusters of arbitrary complexity.

Note that the UX for this is currently terrible, but we can improve on it in future PRs.
2021-10-04 15:09:02 -04:00
Atul Varma f7bc1bdc56
Add some hills to the waves page. (#177)
This minimally fixes #143 by adding optional hills to the waves page (they default to being disabled but can be enabled via a checkbox).  It also adds haze to the waves, so that they are blended with the color of the sky as they recede into the distance.
2021-07-04 16:34:17 -04:00
Atul Varma 902dfa23fa
Add support for gradients (#127)
Fixes #121.
2021-05-27 16:09:05 -04:00
mittimithai 7003daeebf
Baseline color rules working (#111)
Made the new rule the default, but its now easy to play with to adjust the exact color rule we are using. This new one pick 3 values (with a bit of randomness), picks a random hue (then picks 2 more with a small chance of taking the opposite hue), and picks a saturation level that tends to be high.
2021-04-30 07:15:38 -04:00
Atul Varma d1c2ae4b02
Always permalink to Mandalas. (#99)
This addresses #61 by making mandalas permalinked.

The URL to a mandala will change whenever the user stops fiddling with it for 250 ms.  This means that the user can always reload the page to get a reasonably recent version of what they were creating, and they can use the browser's "back" and "next" buttons to effectively undo/redo recent changes.  They can also copy the URL to share it with others.

## About the serialization format

Originally, I stored the state of the user's mandala in the URL using JSON.  This had a number of drawbacks, though:

* **It was really long.**  A mandala serialization was almost 1k characters, which was a very big URL, and one that some sharing platforms might even reject.

* **It wasn't type-checked in any way.** Unless I added some kind of JSON schema validation (which I didn't), the serialization was simply deserialized and assumed to be in the proper format.  This could result in confusing exceptions during render time, rather than decisively exploding at deserialization time.

To resolve these limitations, and because I thought it would be fun, I decided to store the mandala state using a serialization format called [Apache Avro][].  I first read about this in Kleppmann's [Designing Data-Intensive Applications][kleppmann] and was intrigued by both its compactness (a serialized mandala is around 80-120 characters) and schema evolution properties.

It might be going a bit overboard, but again, I thought it would be fun and I wanted to play around with Avro.  Also, I tried architecting things in such a way that all the Avro code is in its own file, and can easily be removed (or swapped out for another serialization format) if we decide it's dumb.

[Apache Avro]: http://avro.apache.org/
[kleppmann]: https://dataintensive.net/

## Other changes

This PR also makes a few other changes:

* Tests can now import files with JSX in them (I don't think this was required for the final state of this PR, but I figured I'd leave it in there for its almost inevitable use in the future).

* The value labels for number sliders now have a fixed width, which eliminates a weird "jitter" effect that sometimes occurred when using them.
2021-04-24 08:46:32 -04:00
mittimithai bdc96e8c5a
introduced Interval in random.ts (#91)
This adds a new `Random.inInterval()` method and uses it.
2021-04-13 15:41:47 -04:00
Atul Varma 24eead10f8 Disable 'invert every other symbol' if needed. 2021-04-04 08:46:09 -04:00
Atul Varma 9ce2d8df80 Factor out NumericRange type, inclusiveRange(). 2021-03-27 15:01:58 -04:00
Atul Varma 4bd30bb2a5 Add SVG symbol widget picker to mandala page. 2021-03-27 08:04:40 -04:00
Atul Varma 154f1fe61a
Add multiple complexity levels for creature generation. (#28)
Fixes #18 by adding a random creature complexity slider. Currently slider values are 0, 1, 2, 3, 4, and bonkers.
2021-02-22 21:50:14 -05:00
Atul Varma 2b27ae02a4
Fix math-related bugs in attachment code. (#5)
This fixes a bunch of bugs in our attachment-related code, and in so doing refactors things to make more sense, adds more tests, and also adds documentation.
2021-02-16 11:52:52 -05:00
Atul Varma f70cdbad8d Extract attachment points and nesting boxes. 2021-02-13 20:47:28 -05:00