diff --git a/css/controls.scss b/css/controls.scss new file mode 100644 index 0000000..a2e77e7 --- /dev/null +++ b/css/controls.scss @@ -0,0 +1,38 @@ +.controls-label { + cursor: pointer; + font-size: 13px; + margin-bottom: 5px; + padding: 10px; + + &:hover { + background: #fff; + } +} + +.controls-label-checkbox { + margin-right: 5px; +} + +.controls-label-text { + +} + +.controls-slider { + cursor: pointer; + width: 100%; +} + +.controls-button { + border: 0; + cursor: pointer; + font-size: 18px; + padding: 10px; + + &:hover { + background: #fff; + } +} + +.controls-bottom { + margin-top: auto; +} diff --git a/css/index.scss b/css/index.scss index be39488..4f08b55 100644 --- a/css/index.scss +++ b/css/index.scss @@ -1,16 +1,33 @@ -.particles { - background: rgba(102, 51, 153, 0.1); - // background: url('../res/seigaiha.svg'); - // background-size: 100px 50px; - // border-radius: 50px; - // box-shadow: 2px 2px 0 #aaa; +.outerContainer { height: 400px; margin: 10px auto; overflow: hidden; position: relative; width: 90%; } -// + +.controlsContainer { + background: #ccc; + border-left: 2px groove #c0c0c0; + bottom: 0; + display: flex; + flex-direction: column; + padding: 10px; + position: absolute; + right: 0; + top: 0; + width: 170px; + z-index: 1; +} + +.animationContainer { + background: rgba(102, 51, 153, 0.1); + height: 100%; + margin-right: 170px; + position: relative; + z-index: 0; +} + // .palette { // background: url('../res/palette.svg'); // background-size: 167px 100px; diff --git a/css/particle.scss b/css/particle.scss index e128bd4..cc11192 100644 --- a/css/particle.scss +++ b/css/particle.scss @@ -48,33 +48,33 @@ width: 4px; } } -// -// .anim3-vision-grid { -// height: 100px; -// // margin-top: 50px; -// // margin-left: 50px; -// position: absolute; -// transform-origin: left top; -// width: 100px; -// z-index: 99; -// } -// -// .anim3-dot { -// $s: 2px; -// -// background: red; -// // border-radius: 2px; -// height: $s; -// position: absolute; -// width: $s; -// z-index: 99; -// -// &.removed { -// // background: purple; -// background: green; -// } -// -// &.touching { -// outline: 2px solid yellow; -// } -// } + +.particle-vision-grid { + height: 100px; + // margin-top: 50px; + // margin-left: 50px; + position: absolute; + transform-origin: left top; + width: 100px; + z-index: 99; +} + +.particle-vision-dot { + $s: 2px; + + background: red; + // border-radius: 2px; + height: $s; + position: absolute; + width: $s; + z-index: 99; + + &.removed { + // background: purple; + background: green; + } + + &.touching { + outline: 2px solid yellow; + } +} diff --git a/css/style.css b/css/style.css index 317b3fa..d59b64b 100644 --- a/css/style.css +++ b/css/style.css @@ -5,13 +5,32 @@ body { font-family: sans-serif; } -.particles { - background: rgba(102, 51, 153, 0.1); +.outerContainer { height: 400px; margin: 10px auto; overflow: hidden; position: relative; width: 90%; } + +.controlsContainer { + background: #ccc; + border-left: 2px groove #c0c0c0; + bottom: 0; + display: flex; + flex-direction: column; + padding: 10px; + position: absolute; + right: 0; + top: 0; + width: 170px; + z-index: 1; } + +.animationContainer { + background: rgba(102, 51, 153, 0.1); + height: 100%; + margin-right: 170px; + position: relative; + z-index: 0; } .particle { background: url(../res/seahorse.svg) no-repeat center center #aaa; background-size: 20px 20px; @@ -54,3 +73,46 @@ body { position: absolute; top: 50%; width: 4px; } + +.particle-vision-grid { + height: 100px; + position: absolute; + transform-origin: left top; + width: 100px; + z-index: 99; } + +.particle-vision-dot { + background: red; + height: 2px; + position: absolute; + width: 2px; + z-index: 99; } + .particle-vision-dot.removed { + background: green; } + .particle-vision-dot.touching { + outline: 2px solid yellow; } +.controls-label { + cursor: pointer; + font-size: 13px; + margin-bottom: 5px; + padding: 10px; } + .controls-label:hover { + background: #fff; } + +.controls-label-checkbox { + margin-right: 5px; } + +.controls-slider { + cursor: pointer; + width: 100%; } + +.controls-button { + border: 0; + cursor: pointer; + font-size: 18px; + padding: 10px; } + .controls-button:hover { + background: #fff; } + +.controls-bottom { + margin-top: auto; } diff --git a/index.html b/index.html index bb52094..87ca976 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@

Dust

-

AI Swarm Movement with RxJs

+

AI Swarms with RxJs


Project Goal

@@ -24,13 +24,16 @@

- The trickiest portion of this iteration was animating the curved paths. I explored elliptical geometry, + The trickiest portion of this iteration was animating the curved paths. Elliptical geometry was the initial goal, but calculating arc length (to maintain a scalar speed) is quite difficult. Smoothstep cubic curves were also an option, but maintaining consistent entry and exit angles could affect performance for large - groups. The current design uses circular paths that smoothly change direction and rotation. + groups. The current design uses circular paths that allow smooth changes in both direction and rotation.

-
+
+
+
+