|
|
|
@ -16,7 +16,7 @@ export default function(destroy$, { |
|
|
|
|
|
|
|
|
|
const observables = { |
|
|
|
|
fps$: new Rx.Subject(), |
|
|
|
|
count$: createCountControl(container, 0, maxCount), |
|
|
|
|
count$: createCountControl(container, count, maxCount), |
|
|
|
|
speed$: createSpeedControl(container), |
|
|
|
|
circle$: showCircleControl && createCircleControl(container), |
|
|
|
|
randomize$: showRandomizeControl && createRandomizeControl(container), |
|
|
|
@ -27,10 +27,7 @@ export default function(destroy$, { |
|
|
|
|
observables.animating$.subscribe((isAnimating) => { |
|
|
|
|
if (isAnimating === true) { |
|
|
|
|
destroy$.next(id); |
|
|
|
|
|
|
|
|
|
if (observables.count$.getValue() === 0) { |
|
|
|
|
observables.count$.next(count); |
|
|
|
|
} |
|
|
|
|
observables.count$.next(count); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -80,7 +77,7 @@ function createCountControl(container, initialValue, max) { |
|
|
|
|
label.className = 'controls-range'; |
|
|
|
|
|
|
|
|
|
const text = document.createElement('span'); |
|
|
|
|
text.innerHTML = (initialValue == 1) ? '1 particle' : `${initialValue} particles`; |
|
|
|
|
// text.innerHTML = (initialValue == 1) ? '1 particle' : `${initialValue} particles`;
|
|
|
|
|
text.className = 'controls-range-text'; |
|
|
|
|
|
|
|
|
|
const slider = document.createElement('input'); |
|
|
|
@ -102,7 +99,8 @@ function createCountControl(container, initialValue, max) { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
count$.subscribe((value) => { |
|
|
|
|
text.innerHTML = (value == 1) ? '1 particle' : `${value} particles`; |
|
|
|
|
console.warn('count changed! ', value) |
|
|
|
|
text.innerHTML = (value === 1) ? '1 particle' : `${value} particles`; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return count$; |
|
|
|
|