diff --git a/public/assets/patterns.json b/public/assets/patterns.json index df90c86..52e3a1f 100644 --- a/public/assets/patterns.json +++ b/public/assets/patterns.json @@ -1,57 +1,116 @@ [ { - "name": "Dotted Weak", + "name": "Constant Weak", "type": "Simple", - "icon": "๐Ÿ˜Œ", + "icon": "๐Ÿ˜", "pattern": [ { - "startDelay": 200, - "duration": 100, + "startDelay": 0, + "duration": 1000, "weakMagnitude": 1.0, "strongMagnitude": 0.0 } ] }, { - "name": "Dotted Strong", + "name": "Constant Strong", "type": "Simple", - "icon": "๐Ÿ˜‰", + "icon": "๐Ÿคฉ", "pattern": [ { - "startDelay": 200, - "duration": 100, + "startDelay": 0, + "duration": 1000, "weakMagnitude": 0.0, "strongMagnitude": 1.0 } ] }, { - "name": "Dotted Max", + "name": "Constant Max", "type": "Simple", - "icon": "๐Ÿ™ƒ", + "icon": "๐Ÿ˜", "pattern": [ { - "startDelay": 200, - "duration": 100, + "startDelay": 0, + "duration": 1000, "weakMagnitude": 1.0, "strongMagnitude": 1.0 } ] }, { - "name": "Dotted AC", + "name": "Constant AC", "type": "Complex", - "icon": "๐Ÿคจ", + "icon": "๐Ÿ˜ต", + "pattern": [ + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + }, + { + "startDelay": 0, + "duration": 1000, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + + { + "name": "Long Dashed Weak", + "type": "Simple", + "icon": "๐Ÿ˜‹", "pattern": [ { "startDelay": 200, - "duration": 100, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 0.0 + } + ] + }, + { + "name": "Long Dashed Strong", + "type": "Simple", + "icon": "๐Ÿ˜œ", + "pattern": [ + { + "startDelay": 100, + "duration": 500, + "weakMagnitude": 0.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed Max", + "type": "Simple", + "icon": "๐Ÿคช", + "pattern": [ + { + "startDelay": 200, + "duration": 500, + "weakMagnitude": 1.0, + "strongMagnitude": 1.0 + } + ] + }, + { + "name": "Long Dashed AC", + "type": "Complex", + "icon": "๐Ÿ˜", + "pattern": [ + { + "startDelay": 200, + "duration": 500, "weakMagnitude": 1.0, "strongMagnitude": 0.0 }, { "startDelay": 200, - "duration": 100, + "duration": 500, "weakMagnitude": 0.0, "strongMagnitude": 1.0 } @@ -116,116 +175,58 @@ ] }, { - "name": "Long Dashed Weak", + "name": "Dotted Weak", "type": "Simple", - "icon": "๐Ÿ˜‹", + "icon": "๐Ÿ˜Œ", "pattern": [ { "startDelay": 200, - "duration": 500, + "duration": 100, "weakMagnitude": 1.0, "strongMagnitude": 0.0 } ] }, { - "name": "Long Dashed Strong", + "name": "Dotted Strong", "type": "Simple", - "icon": "๐Ÿ˜œ", + "icon": "๐Ÿ˜‰", "pattern": [ { - "startDelay": 100, - "duration": 500, + "startDelay": 200, + "duration": 100, "weakMagnitude": 0.0, "strongMagnitude": 1.0 } ] }, { - "name": "Long Dashed Max", + "name": "Dotted Max", "type": "Simple", - "icon": "๐Ÿคช", + "icon": "๐Ÿ™ƒ", "pattern": [ { "startDelay": 200, - "duration": 500, + "duration": 100, "weakMagnitude": 1.0, "strongMagnitude": 1.0 } ] }, { - "name": "Long Dashed AC", + "name": "Dotted AC", "type": "Complex", - "icon": "๐Ÿ˜", + "icon": "๐Ÿคจ", "pattern": [ { "startDelay": 200, - "duration": 500, + "duration": 100, "weakMagnitude": 1.0, "strongMagnitude": 0.0 }, { "startDelay": 200, - "duration": 500, - "weakMagnitude": 0.0, - "strongMagnitude": 1.0 - } - ] - }, - { - "name": "Constant Weak", - "type": "Simple", - "icon": "๐Ÿ˜", - "pattern": [ - { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 1.0, - "strongMagnitude": 0.0 - } - ] - }, - { - "name": "Constant Strong", - "type": "Simple", - "icon": "๐Ÿคฉ", - "pattern": [ - { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 0.0, - "strongMagnitude": 1.0 - } - ] - }, - { - "name": "Constant Max", - "type": "Simple", - "icon": "๐Ÿ˜", - "pattern": [ - { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 1.0, - "strongMagnitude": 1.0 - } - ] - }, - { - "name": "Constant AC", - "type": "Complex", - "icon": "๐Ÿ˜ต", - "pattern": [ - { - "startDelay": 0, - "duration": 1000, - "weakMagnitude": 1.0, - "strongMagnitude": 0.0 - }, - { - "startDelay": 0, - "duration": 1000, + "duration": 100, "weakMagnitude": 0.0, "strongMagnitude": 1.0 } diff --git a/src/models/Vibrator.ts b/src/models/Vibrator.ts index e4fd4a3..62198e1 100644 --- a/src/models/Vibrator.ts +++ b/src/models/Vibrator.ts @@ -38,7 +38,7 @@ class Vibrator implements IVibrator { for (let i = 0; i < this.pattern.length; i++) { if (this.isVibrating === true) { this.unit.vibrationActuator.playEffect('dual-rumble', this.pattern[i]); - await this.sleep(this.pattern[i].startDelay + this.pattern[i].duration); + await this.sleep(this.pattern[i].startDelay + this.pattern[i].duration - 10); } else { return; }