]>
git.r.bdr.sh - rbdr/lissajous/blob - lib/systems/global_adjuster.js
7f6df91f8f4dbfb6d96584180b300f37c69c3c65
1 import { System
} from '@serpentity/serpentity';
2 import Frequent
from '../nodes/configurable';
3 import { settingsContainer
, slider
} from '../factories/ui';
5 export default class GlobalAdjuster
extends System
{
7 constructor(container
) {
10 this.container
= container
;
15 this.nodes
= engine
.getNodes(Frequent
);
16 const container
= document
.getElementById('settings');
17 this.adjusterContainer
= settingsContainer({
18 id: 'global-adjuster',
23 for (const node
of this.nodes
) {
24 const nodeElement
= settingsContainer({
25 id: `global-adjuster-${i}`,
30 nodeElement
.appendChild(slider({
35 className: 'lineLength',
36 get: () => node
.configuration
.lineLength
.toString(),
37 set: (value
) => (node
.configuration
.lineLength
= parseFloat(value
))
40 this.adjusterContainer
.appendChild(nodeElement
);
44 this.container
.appendChild(this.adjusterContainer
);
49 this.container
.removeChild(this.adjusterContainer
);
50 delete this.adjusterContainer
;