diff --git a/public/data/images/compress.svg b/public/data/images/compress.svg
new file mode 100644
index 0000000..b7d2a5b
--- /dev/null
+++ b/public/data/images/compress.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/public/data/scripts/ts/manager.ts b/public/data/scripts/ts/manager.ts
index a2241ff..be73b06 100644
--- a/public/data/scripts/ts/manager.ts
+++ b/public/data/scripts/ts/manager.ts
@@ -7,6 +7,8 @@ class Manager {
playing = false;
+ static Size = 20;
+
constructor() {
p.colorMode(p.HSB, 100);
let count = 100;
@@ -54,6 +56,7 @@ class Manager {
data(){
return {
segmentCount: 1,
+ maxSegmentCount: 30,
masses: [],
lengths: [],
startAngle: 90,
@@ -70,12 +73,27 @@ class Manager {
add() {
},
+ resetMasses(){
+ for (let i = 0; i < this.maxSegmentCount; i++)
+ this.masses[i] = 1;
+ },
+ resetLengths() {
+ for (let i = 0; i < this.maxSegmentCount; i++)
+ this.lengths[i] = 1;
+ },
+ normalize(){
+ let L: [number] = this.lengths;
+ let sum = L.slice(0, this.segmentCount).reduce((p, n) => p + n);
+ let maxLength = Manager.Size / 2;
+ let factor = maxLength / sum;
+
+ for (let i = 0; i < this.segmentCount; i++)
+ this.lengths[i] *= factor;
+ }
},
mounted() {
- for (let i = 0; i < 20; i++){
- this.masses.push(1);
- this.lengths.push(1);
- }
+ this.resetMasses();
+ this.resetLengths();
},
name: "Preparation"
}).mount("#preparation");
diff --git a/public/index.html b/public/index.html
index 8b46170..e9874b9 100644
--- a/public/index.html
+++ b/public/index.html
@@ -19,7 +19,7 @@
@@ -28,9 +28,14 @@
{{ masses[i - 1] }}kg
{{ lengths[i - 1] }}m
-
+
+
+
+
+
+
-
-
-
Property to change slightly:
-
-
-
-