@hapticjs/core 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +120 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -8
- package/dist/index.d.ts +2 -8
- package/dist/index.js +120 -149
- package/dist/index.js.map +1 -1
- package/dist/presets/index.cjs +76 -77
- package/dist/presets/index.cjs.map +1 -1
- package/dist/presets/index.js +76 -77
- package/dist/presets/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32,29 +32,16 @@ var NoopAdapter = class {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
// src/utils/scheduling.ts
|
|
36
|
-
function delay(ms) {
|
|
37
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
38
|
-
}
|
|
39
|
-
function clamp(value, min, max) {
|
|
40
|
-
return Math.min(Math.max(value, min), max);
|
|
41
|
-
}
|
|
42
|
-
function normalizeIntensity(intensity) {
|
|
43
|
-
return clamp(intensity, 0, 1);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
35
|
// src/adapters/web-vibration.adapter.ts
|
|
47
36
|
var WebVibrationAdapter = class {
|
|
48
37
|
constructor() {
|
|
49
38
|
this.name = "web-vibration";
|
|
50
|
-
this._cancelled = false;
|
|
51
39
|
this.supported = typeof navigator !== "undefined" && "vibrate" in navigator;
|
|
52
40
|
}
|
|
53
41
|
capabilities() {
|
|
54
42
|
return {
|
|
55
43
|
maxIntensityLevels: 1,
|
|
56
|
-
|
|
57
|
-
minDuration: 10,
|
|
44
|
+
minDuration: 20,
|
|
58
45
|
maxDuration: 1e4,
|
|
59
46
|
supportsPattern: true,
|
|
60
47
|
supportsIntensity: false,
|
|
@@ -63,36 +50,39 @@ var WebVibrationAdapter = class {
|
|
|
63
50
|
}
|
|
64
51
|
async pulse(_intensity, duration) {
|
|
65
52
|
if (!this.supported) return;
|
|
66
|
-
navigator.vibrate(duration);
|
|
53
|
+
navigator.vibrate(Math.max(duration, 20));
|
|
67
54
|
}
|
|
68
55
|
async playSequence(steps) {
|
|
69
56
|
if (!this.supported || steps.length === 0) return;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (this._canUseNativePattern(steps)) {
|
|
73
|
-
navigator.vibrate(pattern);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
57
|
+
const pattern = [];
|
|
58
|
+
let lastType = null;
|
|
76
59
|
for (const step of steps) {
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
await this._pwmVibrate(step.duration, step.intensity);
|
|
82
|
-
} else {
|
|
83
|
-
navigator.vibrate(step.duration);
|
|
84
|
-
await delay(step.duration);
|
|
85
|
-
}
|
|
60
|
+
if (step.type === "vibrate" && step.intensity > 0.05) {
|
|
61
|
+
const dur = Math.max(step.duration, 20);
|
|
62
|
+
if (lastType === "vibrate") {
|
|
63
|
+
pattern[pattern.length - 1] += dur;
|
|
86
64
|
} else {
|
|
87
|
-
|
|
65
|
+
pattern.push(dur);
|
|
88
66
|
}
|
|
67
|
+
lastType = "vibrate";
|
|
89
68
|
} else {
|
|
90
|
-
|
|
69
|
+
const dur = Math.max(step.duration, 10);
|
|
70
|
+
if (lastType === "pause") {
|
|
71
|
+
pattern[pattern.length - 1] += dur;
|
|
72
|
+
} else {
|
|
73
|
+
pattern.push(dur);
|
|
74
|
+
}
|
|
75
|
+
lastType = "pause";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (pattern.length > 0) {
|
|
79
|
+
if (steps[0]?.type === "pause" || steps[0]?.type === "vibrate" && steps[0]?.intensity <= 0.05) {
|
|
80
|
+
pattern.unshift(0);
|
|
91
81
|
}
|
|
82
|
+
navigator.vibrate(pattern);
|
|
92
83
|
}
|
|
93
84
|
}
|
|
94
85
|
cancel() {
|
|
95
|
-
this._cancelled = true;
|
|
96
86
|
if (this.supported) {
|
|
97
87
|
navigator.vibrate(0);
|
|
98
88
|
}
|
|
@@ -100,37 +90,19 @@ var WebVibrationAdapter = class {
|
|
|
100
90
|
dispose() {
|
|
101
91
|
this.cancel();
|
|
102
92
|
}
|
|
103
|
-
/** Convert steps to Vibration API pattern array */
|
|
104
|
-
_toVibrationPattern(steps) {
|
|
105
|
-
const pattern = [];
|
|
106
|
-
for (const step of steps) {
|
|
107
|
-
pattern.push(step.duration);
|
|
108
|
-
}
|
|
109
|
-
return pattern;
|
|
110
|
-
}
|
|
111
|
-
/** Check if all steps can be played with native pattern (no intensity variation) */
|
|
112
|
-
_canUseNativePattern(steps) {
|
|
113
|
-
return steps.every(
|
|
114
|
-
(s) => s.type === "pause" || s.type === "vibrate" && s.intensity >= 0.5
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
/** Simulate lower intensity via pulse-width modulation */
|
|
118
|
-
async _pwmVibrate(duration, intensity) {
|
|
119
|
-
const cycleTime = 20;
|
|
120
|
-
const onTime = Math.round(cycleTime * intensity);
|
|
121
|
-
const offTime = cycleTime - onTime;
|
|
122
|
-
const cycles = Math.floor(duration / cycleTime);
|
|
123
|
-
const pattern = [];
|
|
124
|
-
for (let i = 0; i < cycles; i++) {
|
|
125
|
-
pattern.push(onTime, offTime);
|
|
126
|
-
}
|
|
127
|
-
if (pattern.length > 0) {
|
|
128
|
-
navigator.vibrate(pattern);
|
|
129
|
-
await delay(duration);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
93
|
};
|
|
133
94
|
|
|
95
|
+
// src/utils/scheduling.ts
|
|
96
|
+
function delay(ms) {
|
|
97
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
98
|
+
}
|
|
99
|
+
function clamp(value, min, max) {
|
|
100
|
+
return Math.min(Math.max(value, min), max);
|
|
101
|
+
}
|
|
102
|
+
function normalizeIntensity(intensity) {
|
|
103
|
+
return clamp(intensity, 0, 1);
|
|
104
|
+
}
|
|
105
|
+
|
|
134
106
|
// src/adapters/ios-audio.adapter.ts
|
|
135
107
|
var IoSAudioAdapter = class {
|
|
136
108
|
constructor() {
|
|
@@ -734,9 +706,9 @@ var HapticEngine = class _HapticEngine {
|
|
|
734
706
|
/** Double tap */
|
|
735
707
|
async doubleTap(intensity = 0.6) {
|
|
736
708
|
await this._playSteps([
|
|
737
|
-
{ type: "vibrate", duration:
|
|
709
|
+
{ type: "vibrate", duration: 25, intensity },
|
|
738
710
|
{ type: "pause", duration: 80, intensity: 0 },
|
|
739
|
-
{ type: "vibrate", duration:
|
|
711
|
+
{ type: "vibrate", duration: 25, intensity }
|
|
740
712
|
]);
|
|
741
713
|
}
|
|
742
714
|
/** Long press feedback */
|
|
@@ -771,24 +743,24 @@ var HapticEngine = class _HapticEngine {
|
|
|
771
743
|
}
|
|
772
744
|
/** Selection change feedback */
|
|
773
745
|
async selection() {
|
|
774
|
-
await this._playSteps([{ type: "vibrate", duration:
|
|
746
|
+
await this._playSteps([{ type: "vibrate", duration: 25, intensity: 0.5 }]);
|
|
775
747
|
}
|
|
776
748
|
/** Toggle feedback */
|
|
777
749
|
async toggle(on) {
|
|
778
750
|
if (on) {
|
|
779
|
-
await this._playSteps([{ type: "vibrate", duration:
|
|
751
|
+
await this._playSteps([{ type: "vibrate", duration: 30, intensity: 0.6 }]);
|
|
780
752
|
} else {
|
|
781
|
-
await this._playSteps([{ type: "vibrate", duration:
|
|
753
|
+
await this._playSteps([{ type: "vibrate", duration: 25, intensity: 0.4 }]);
|
|
782
754
|
}
|
|
783
755
|
}
|
|
784
756
|
/** Impact with style (matches iOS UIImpactFeedbackGenerator) */
|
|
785
757
|
async impact(style = "medium") {
|
|
786
758
|
const presets2 = {
|
|
787
|
-
light: [{ type: "vibrate", duration:
|
|
788
|
-
medium: [{ type: "vibrate", duration:
|
|
789
|
-
heavy: [{ type: "vibrate", duration:
|
|
790
|
-
rigid: [{ type: "vibrate", duration:
|
|
791
|
-
soft: [{ type: "vibrate", duration:
|
|
759
|
+
light: [{ type: "vibrate", duration: 25, intensity: 0.4 }],
|
|
760
|
+
medium: [{ type: "vibrate", duration: 35, intensity: 0.7 }],
|
|
761
|
+
heavy: [{ type: "vibrate", duration: 50, intensity: 1 }],
|
|
762
|
+
rigid: [{ type: "vibrate", duration: 30, intensity: 0.9 }],
|
|
763
|
+
soft: [{ type: "vibrate", duration: 35, intensity: 0.5 }]
|
|
792
764
|
};
|
|
793
765
|
await this._playSteps(presets2[style]);
|
|
794
766
|
}
|
|
@@ -1029,15 +1001,15 @@ var ui = {
|
|
|
1029
1001
|
/** Light button tap */
|
|
1030
1002
|
tap: {
|
|
1031
1003
|
name: "ui.tap",
|
|
1032
|
-
steps: [{ type: "vibrate", duration:
|
|
1004
|
+
steps: [{ type: "vibrate", duration: 30, intensity: 0.6 }]
|
|
1033
1005
|
},
|
|
1034
1006
|
/** Double tap */
|
|
1035
1007
|
doubleTap: {
|
|
1036
1008
|
name: "ui.doubleTap",
|
|
1037
1009
|
steps: [
|
|
1038
|
-
{ type: "vibrate", duration:
|
|
1010
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 },
|
|
1039
1011
|
{ type: "pause", duration: 80, intensity: 0 },
|
|
1040
|
-
{ type: "vibrate", duration:
|
|
1012
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 }
|
|
1041
1013
|
]
|
|
1042
1014
|
},
|
|
1043
1015
|
/** Long press acknowledgment */
|
|
@@ -1048,58 +1020,58 @@ var ui = {
|
|
|
1048
1020
|
/** Toggle switch on */
|
|
1049
1021
|
toggleOn: {
|
|
1050
1022
|
name: "ui.toggleOn",
|
|
1051
|
-
steps: [{ type: "vibrate", duration:
|
|
1023
|
+
steps: [{ type: "vibrate", duration: 30, intensity: 0.6 }]
|
|
1052
1024
|
},
|
|
1053
1025
|
/** Toggle switch off */
|
|
1054
1026
|
toggleOff: {
|
|
1055
1027
|
name: "ui.toggleOff",
|
|
1056
|
-
steps: [{ type: "vibrate", duration:
|
|
1028
|
+
steps: [{ type: "vibrate", duration: 25, intensity: 0.4 }]
|
|
1057
1029
|
},
|
|
1058
1030
|
/** Slider snap to value */
|
|
1059
1031
|
sliderSnap: {
|
|
1060
1032
|
name: "ui.sliderSnap",
|
|
1061
|
-
steps: [{ type: "vibrate", duration:
|
|
1033
|
+
steps: [{ type: "vibrate", duration: 25, intensity: 0.5 }]
|
|
1062
1034
|
},
|
|
1063
1035
|
/** Selection changed */
|
|
1064
1036
|
selection: {
|
|
1065
1037
|
name: "ui.selection",
|
|
1066
|
-
steps: [{ type: "vibrate", duration:
|
|
1038
|
+
steps: [{ type: "vibrate", duration: 25, intensity: 0.5 }]
|
|
1067
1039
|
},
|
|
1068
1040
|
/** Pull to refresh threshold reached */
|
|
1069
1041
|
pullToRefresh: {
|
|
1070
1042
|
name: "ui.pullToRefresh",
|
|
1071
1043
|
steps: [
|
|
1072
|
-
{ type: "vibrate", duration:
|
|
1044
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1073
1045
|
{ type: "pause", duration: 40, intensity: 0 },
|
|
1074
|
-
{ type: "vibrate", duration:
|
|
1046
|
+
{ type: "vibrate", duration: 40, intensity: 0.7 }
|
|
1075
1047
|
]
|
|
1076
1048
|
},
|
|
1077
1049
|
/** Swipe action triggered */
|
|
1078
1050
|
swipe: {
|
|
1079
1051
|
name: "ui.swipe",
|
|
1080
1052
|
steps: [
|
|
1081
|
-
{ type: "vibrate", duration:
|
|
1053
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1082
1054
|
{ type: "pause", duration: 30, intensity: 0 },
|
|
1083
|
-
{ type: "vibrate", duration:
|
|
1055
|
+
{ type: "vibrate", duration: 25, intensity: 0.4 }
|
|
1084
1056
|
]
|
|
1085
1057
|
},
|
|
1086
1058
|
/** Context menu appearance */
|
|
1087
1059
|
contextMenu: {
|
|
1088
1060
|
name: "ui.contextMenu",
|
|
1089
|
-
steps: [{ type: "vibrate", duration:
|
|
1061
|
+
steps: [{ type: "vibrate", duration: 35, intensity: 0.7 }]
|
|
1090
1062
|
},
|
|
1091
1063
|
/** Drag start */
|
|
1092
1064
|
dragStart: {
|
|
1093
1065
|
name: "ui.dragStart",
|
|
1094
|
-
steps: [{ type: "vibrate", duration:
|
|
1066
|
+
steps: [{ type: "vibrate", duration: 30, intensity: 0.5 }]
|
|
1095
1067
|
},
|
|
1096
1068
|
/** Drag drop */
|
|
1097
1069
|
drop: {
|
|
1098
1070
|
name: "ui.drop",
|
|
1099
1071
|
steps: [
|
|
1100
|
-
{ type: "vibrate", duration:
|
|
1072
|
+
{ type: "vibrate", duration: 30, intensity: 0.8 },
|
|
1101
1073
|
{ type: "pause", duration: 30, intensity: 0 },
|
|
1102
|
-
{ type: "vibrate", duration:
|
|
1074
|
+
{ type: "vibrate", duration: 25, intensity: 0.5 }
|
|
1103
1075
|
]
|
|
1104
1076
|
}
|
|
1105
1077
|
};
|
|
@@ -1110,9 +1082,9 @@ var notifications = {
|
|
|
1110
1082
|
success: {
|
|
1111
1083
|
name: "notifications.success",
|
|
1112
1084
|
steps: [
|
|
1113
|
-
{ type: "vibrate", duration:
|
|
1085
|
+
{ type: "vibrate", duration: 35, intensity: 0.5 },
|
|
1114
1086
|
{ type: "pause", duration: 60, intensity: 0 },
|
|
1115
|
-
{ type: "vibrate", duration:
|
|
1087
|
+
{ type: "vibrate", duration: 45, intensity: 0.8 }
|
|
1116
1088
|
]
|
|
1117
1089
|
},
|
|
1118
1090
|
/** Warning — three even pulses */
|
|
@@ -1139,16 +1111,16 @@ var notifications = {
|
|
|
1139
1111
|
info: {
|
|
1140
1112
|
name: "notifications.info",
|
|
1141
1113
|
steps: [
|
|
1142
|
-
{ type: "vibrate", duration:
|
|
1114
|
+
{ type: "vibrate", duration: 35, intensity: 0.5 }
|
|
1143
1115
|
]
|
|
1144
1116
|
},
|
|
1145
1117
|
/** Message received */
|
|
1146
1118
|
messageReceived: {
|
|
1147
1119
|
name: "notifications.messageReceived",
|
|
1148
1120
|
steps: [
|
|
1149
|
-
{ type: "vibrate", duration:
|
|
1121
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1150
1122
|
{ type: "pause", duration: 100, intensity: 0 },
|
|
1151
|
-
{ type: "vibrate", duration:
|
|
1123
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 }
|
|
1152
1124
|
]
|
|
1153
1125
|
},
|
|
1154
1126
|
/** Alarm — urgent repeating pattern */
|
|
@@ -1172,9 +1144,9 @@ var notifications = {
|
|
|
1172
1144
|
reminder: {
|
|
1173
1145
|
name: "notifications.reminder",
|
|
1174
1146
|
steps: [
|
|
1175
|
-
{ type: "vibrate", duration:
|
|
1147
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1176
1148
|
{ type: "pause", duration: 150, intensity: 0 },
|
|
1177
|
-
{ type: "vibrate", duration:
|
|
1149
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 }
|
|
1178
1150
|
]
|
|
1179
1151
|
}
|
|
1180
1152
|
};
|
|
@@ -1188,26 +1160,25 @@ var gaming = {
|
|
|
1188
1160
|
{ type: "vibrate", duration: 100, intensity: 1 },
|
|
1189
1161
|
{ type: "vibrate", duration: 80, intensity: 0.8 },
|
|
1190
1162
|
{ type: "vibrate", duration: 60, intensity: 0.5 },
|
|
1191
|
-
{ type: "vibrate", duration: 40, intensity: 0.3 }
|
|
1192
|
-
{ type: "vibrate", duration: 30, intensity: 0.1 }
|
|
1163
|
+
{ type: "vibrate", duration: 40, intensity: 0.3 }
|
|
1193
1164
|
]
|
|
1194
1165
|
},
|
|
1195
1166
|
/** Collision — sharp impact */
|
|
1196
1167
|
collision: {
|
|
1197
1168
|
name: "gaming.collision",
|
|
1198
1169
|
steps: [
|
|
1199
|
-
{ type: "vibrate", duration:
|
|
1200
|
-
{ type: "pause", duration:
|
|
1201
|
-
{ type: "vibrate", duration:
|
|
1170
|
+
{ type: "vibrate", duration: 40, intensity: 1 },
|
|
1171
|
+
{ type: "pause", duration: 30, intensity: 0 },
|
|
1172
|
+
{ type: "vibrate", duration: 25, intensity: 0.5 }
|
|
1202
1173
|
]
|
|
1203
1174
|
},
|
|
1204
1175
|
/** Heartbeat — rhythmic pulse */
|
|
1205
1176
|
heartbeat: {
|
|
1206
1177
|
name: "gaming.heartbeat",
|
|
1207
1178
|
steps: [
|
|
1208
|
-
{ type: "vibrate", duration:
|
|
1179
|
+
{ type: "vibrate", duration: 30, intensity: 0.8 },
|
|
1209
1180
|
{ type: "pause", duration: 80, intensity: 0 },
|
|
1210
|
-
{ type: "vibrate", duration:
|
|
1181
|
+
{ type: "vibrate", duration: 40, intensity: 1 },
|
|
1211
1182
|
{ type: "pause", duration: 400, intensity: 0 }
|
|
1212
1183
|
]
|
|
1213
1184
|
},
|
|
@@ -1215,17 +1186,17 @@ var gaming = {
|
|
|
1215
1186
|
gunshot: {
|
|
1216
1187
|
name: "gaming.gunshot",
|
|
1217
1188
|
steps: [
|
|
1218
|
-
{ type: "vibrate", duration:
|
|
1219
|
-
{ type: "vibrate", duration:
|
|
1189
|
+
{ type: "vibrate", duration: 30, intensity: 1 },
|
|
1190
|
+
{ type: "vibrate", duration: 40, intensity: 0.4 }
|
|
1220
1191
|
]
|
|
1221
1192
|
},
|
|
1222
1193
|
/** Sword clash — metallic ring */
|
|
1223
1194
|
swordClash: {
|
|
1224
1195
|
name: "gaming.swordClash",
|
|
1225
1196
|
steps: [
|
|
1226
|
-
{ type: "vibrate", duration:
|
|
1227
|
-
{ type: "pause", duration:
|
|
1228
|
-
{ type: "vibrate", duration:
|
|
1197
|
+
{ type: "vibrate", duration: 25, intensity: 1 },
|
|
1198
|
+
{ type: "pause", duration: 20, intensity: 0 },
|
|
1199
|
+
{ type: "vibrate", duration: 40, intensity: 0.6 },
|
|
1229
1200
|
{ type: "vibrate", duration: 50, intensity: 0.3 }
|
|
1230
1201
|
]
|
|
1231
1202
|
},
|
|
@@ -1233,10 +1204,10 @@ var gaming = {
|
|
|
1233
1204
|
powerUp: {
|
|
1234
1205
|
name: "gaming.powerUp",
|
|
1235
1206
|
steps: [
|
|
1236
|
-
{ type: "vibrate", duration: 40, intensity: 0.
|
|
1237
|
-
{ type: "vibrate", duration: 40, intensity: 0.
|
|
1238
|
-
{ type: "vibrate", duration: 40, intensity: 0.
|
|
1239
|
-
{ type: "vibrate", duration: 40, intensity: 0.
|
|
1207
|
+
{ type: "vibrate", duration: 40, intensity: 0.3 },
|
|
1208
|
+
{ type: "vibrate", duration: 40, intensity: 0.5 },
|
|
1209
|
+
{ type: "vibrate", duration: 40, intensity: 0.7 },
|
|
1210
|
+
{ type: "vibrate", duration: 40, intensity: 0.9 },
|
|
1240
1211
|
{ type: "vibrate", duration: 60, intensity: 1 }
|
|
1241
1212
|
]
|
|
1242
1213
|
},
|
|
@@ -1244,46 +1215,46 @@ var gaming = {
|
|
|
1244
1215
|
damage: {
|
|
1245
1216
|
name: "gaming.damage",
|
|
1246
1217
|
steps: [
|
|
1247
|
-
{ type: "vibrate", duration:
|
|
1248
|
-
{ type: "pause", duration:
|
|
1249
|
-
{ type: "vibrate", duration:
|
|
1250
|
-
{ type: "pause", duration:
|
|
1251
|
-
{ type: "vibrate", duration:
|
|
1218
|
+
{ type: "vibrate", duration: 50, intensity: 0.9 },
|
|
1219
|
+
{ type: "pause", duration: 25, intensity: 0 },
|
|
1220
|
+
{ type: "vibrate", duration: 40, intensity: 0.6 },
|
|
1221
|
+
{ type: "pause", duration: 25, intensity: 0 },
|
|
1222
|
+
{ type: "vibrate", duration: 30, intensity: 0.4 }
|
|
1252
1223
|
]
|
|
1253
1224
|
},
|
|
1254
1225
|
/** Item pickup — light cheerful */
|
|
1255
1226
|
pickup: {
|
|
1256
1227
|
name: "gaming.pickup",
|
|
1257
1228
|
steps: [
|
|
1258
|
-
{ type: "vibrate", duration:
|
|
1229
|
+
{ type: "vibrate", duration: 25, intensity: 0.4 },
|
|
1259
1230
|
{ type: "pause", duration: 40, intensity: 0 },
|
|
1260
|
-
{ type: "vibrate", duration:
|
|
1231
|
+
{ type: "vibrate", duration: 30, intensity: 0.7 }
|
|
1261
1232
|
]
|
|
1262
1233
|
},
|
|
1263
1234
|
/** Level complete — celebratory */
|
|
1264
1235
|
levelComplete: {
|
|
1265
1236
|
name: "gaming.levelComplete",
|
|
1266
1237
|
steps: [
|
|
1267
|
-
{ type: "vibrate", duration:
|
|
1238
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1268
1239
|
{ type: "pause", duration: 60, intensity: 0 },
|
|
1269
|
-
{ type: "vibrate", duration:
|
|
1240
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1270
1241
|
{ type: "pause", duration: 60, intensity: 0 },
|
|
1271
|
-
{ type: "vibrate", duration:
|
|
1242
|
+
{ type: "vibrate", duration: 40, intensity: 0.7 },
|
|
1272
1243
|
{ type: "pause", duration: 60, intensity: 0 },
|
|
1273
|
-
{ type: "vibrate", duration:
|
|
1244
|
+
{ type: "vibrate", duration: 60, intensity: 1 }
|
|
1274
1245
|
]
|
|
1275
1246
|
},
|
|
1276
1247
|
/** Engine rumble — continuous vibration */
|
|
1277
1248
|
engineRumble: {
|
|
1278
1249
|
name: "gaming.engineRumble",
|
|
1279
1250
|
steps: [
|
|
1280
|
-
{ type: "vibrate", duration:
|
|
1281
|
-
{ type: "pause", duration:
|
|
1282
|
-
{ type: "vibrate", duration:
|
|
1283
|
-
{ type: "pause", duration:
|
|
1284
|
-
{ type: "vibrate", duration:
|
|
1285
|
-
{ type: "pause", duration:
|
|
1286
|
-
{ type: "vibrate", duration:
|
|
1251
|
+
{ type: "vibrate", duration: 40, intensity: 0.5 },
|
|
1252
|
+
{ type: "pause", duration: 15, intensity: 0 },
|
|
1253
|
+
{ type: "vibrate", duration: 40, intensity: 0.6 },
|
|
1254
|
+
{ type: "pause", duration: 15, intensity: 0 },
|
|
1255
|
+
{ type: "vibrate", duration: 40, intensity: 0.5 },
|
|
1256
|
+
{ type: "pause", duration: 15, intensity: 0 },
|
|
1257
|
+
{ type: "vibrate", duration: 40, intensity: 0.6 }
|
|
1287
1258
|
]
|
|
1288
1259
|
}
|
|
1289
1260
|
};
|
|
@@ -1294,9 +1265,9 @@ var accessibility = {
|
|
|
1294
1265
|
confirm: {
|
|
1295
1266
|
name: "accessibility.confirm",
|
|
1296
1267
|
steps: [
|
|
1297
|
-
{ type: "vibrate", duration:
|
|
1268
|
+
{ type: "vibrate", duration: 35, intensity: 0.7 },
|
|
1298
1269
|
{ type: "pause", duration: 100, intensity: 0 },
|
|
1299
|
-
{ type: "vibrate", duration:
|
|
1270
|
+
{ type: "vibrate", duration: 35, intensity: 0.7 }
|
|
1300
1271
|
]
|
|
1301
1272
|
},
|
|
1302
1273
|
/** Deny/reject — long single buzz */
|
|
@@ -1310,41 +1281,41 @@ var accessibility = {
|
|
|
1310
1281
|
boundary: {
|
|
1311
1282
|
name: "accessibility.boundary",
|
|
1312
1283
|
steps: [
|
|
1313
|
-
{ type: "vibrate", duration:
|
|
1284
|
+
{ type: "vibrate", duration: 30, intensity: 1 }
|
|
1314
1285
|
]
|
|
1315
1286
|
},
|
|
1316
1287
|
/** Focus change — subtle tick */
|
|
1317
1288
|
focusChange: {
|
|
1318
1289
|
name: "accessibility.focusChange",
|
|
1319
1290
|
steps: [
|
|
1320
|
-
{ type: "vibrate", duration:
|
|
1291
|
+
{ type: "vibrate", duration: 25, intensity: 0.5 }
|
|
1321
1292
|
]
|
|
1322
1293
|
},
|
|
1323
1294
|
/** Counting rhythm — one tick per count */
|
|
1324
1295
|
countTick: {
|
|
1325
1296
|
name: "accessibility.countTick",
|
|
1326
1297
|
steps: [
|
|
1327
|
-
{ type: "vibrate", duration:
|
|
1298
|
+
{ type: "vibrate", duration: 25, intensity: 0.5 }
|
|
1328
1299
|
]
|
|
1329
1300
|
},
|
|
1330
1301
|
/** Navigation landmark reached */
|
|
1331
1302
|
landmark: {
|
|
1332
1303
|
name: "accessibility.landmark",
|
|
1333
1304
|
steps: [
|
|
1334
|
-
{ type: "vibrate", duration:
|
|
1305
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 },
|
|
1335
1306
|
{ type: "pause", duration: 40, intensity: 0 },
|
|
1336
|
-
{ type: "vibrate", duration:
|
|
1307
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 },
|
|
1337
1308
|
{ type: "pause", duration: 40, intensity: 0 },
|
|
1338
|
-
{ type: "vibrate", duration:
|
|
1309
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 }
|
|
1339
1310
|
]
|
|
1340
1311
|
},
|
|
1341
1312
|
/** Progress checkpoint — escalating feedback */
|
|
1342
1313
|
progressCheckpoint: {
|
|
1343
1314
|
name: "accessibility.progressCheckpoint",
|
|
1344
1315
|
steps: [
|
|
1345
|
-
{ type: "vibrate", duration:
|
|
1316
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1346
1317
|
{ type: "pause", duration: 60, intensity: 0 },
|
|
1347
|
-
{ type: "vibrate", duration:
|
|
1318
|
+
{ type: "vibrate", duration: 35, intensity: 0.7 }
|
|
1348
1319
|
]
|
|
1349
1320
|
}
|
|
1350
1321
|
};
|
|
@@ -1354,51 +1325,51 @@ var system = {
|
|
|
1354
1325
|
/** Keyboard key press */
|
|
1355
1326
|
keyPress: {
|
|
1356
1327
|
name: "system.keyPress",
|
|
1357
|
-
steps: [{ type: "vibrate", duration:
|
|
1328
|
+
steps: [{ type: "vibrate", duration: 25, intensity: 0.5 }]
|
|
1358
1329
|
},
|
|
1359
1330
|
/** Scroll tick (detent-like) */
|
|
1360
1331
|
scrollTick: {
|
|
1361
1332
|
name: "system.scrollTick",
|
|
1362
|
-
steps: [{ type: "vibrate", duration:
|
|
1333
|
+
steps: [{ type: "vibrate", duration: 20, intensity: 0.4 }]
|
|
1363
1334
|
},
|
|
1364
1335
|
/** Scroll boundary reached */
|
|
1365
1336
|
scrollBounce: {
|
|
1366
1337
|
name: "system.scrollBounce",
|
|
1367
1338
|
steps: [
|
|
1368
|
-
{ type: "vibrate", duration:
|
|
1369
|
-
{ type: "vibrate", duration:
|
|
1339
|
+
{ type: "vibrate", duration: 25, intensity: 0.6 },
|
|
1340
|
+
{ type: "vibrate", duration: 30, intensity: 0.4 }
|
|
1370
1341
|
]
|
|
1371
1342
|
},
|
|
1372
1343
|
/** Delete action */
|
|
1373
1344
|
delete: {
|
|
1374
1345
|
name: "system.delete",
|
|
1375
1346
|
steps: [
|
|
1376
|
-
{ type: "vibrate", duration:
|
|
1347
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1377
1348
|
{ type: "pause", duration: 50, intensity: 0 },
|
|
1378
|
-
{ type: "vibrate", duration:
|
|
1349
|
+
{ type: "vibrate", duration: 40, intensity: 0.8 }
|
|
1379
1350
|
]
|
|
1380
1351
|
},
|
|
1381
1352
|
/** Undo action */
|
|
1382
1353
|
undo: {
|
|
1383
1354
|
name: "system.undo",
|
|
1384
1355
|
steps: [
|
|
1385
|
-
{ type: "vibrate", duration:
|
|
1356
|
+
{ type: "vibrate", duration: 30, intensity: 0.5 },
|
|
1386
1357
|
{ type: "pause", duration: 80, intensity: 0 },
|
|
1387
|
-
{ type: "vibrate", duration:
|
|
1358
|
+
{ type: "vibrate", duration: 25, intensity: 0.4 }
|
|
1388
1359
|
]
|
|
1389
1360
|
},
|
|
1390
1361
|
/** Copy to clipboard */
|
|
1391
1362
|
copy: {
|
|
1392
1363
|
name: "system.copy",
|
|
1393
|
-
steps: [{ type: "vibrate", duration:
|
|
1364
|
+
steps: [{ type: "vibrate", duration: 30, intensity: 0.5 }]
|
|
1394
1365
|
},
|
|
1395
1366
|
/** Paste from clipboard */
|
|
1396
1367
|
paste: {
|
|
1397
1368
|
name: "system.paste",
|
|
1398
1369
|
steps: [
|
|
1399
|
-
{ type: "vibrate", duration:
|
|
1370
|
+
{ type: "vibrate", duration: 25, intensity: 0.4 },
|
|
1400
1371
|
{ type: "pause", duration: 30, intensity: 0 },
|
|
1401
|
-
{ type: "vibrate", duration:
|
|
1372
|
+
{ type: "vibrate", duration: 30, intensity: 0.6 }
|
|
1402
1373
|
]
|
|
1403
1374
|
}
|
|
1404
1375
|
};
|