You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
460 B
26 lines
460 B
|
3 years ago
|
const _isSupport = !!window.navigator.vibrate
|
||
|
|
|
||
|
|
export function vibrateLong () {
|
||
|
|
if (_isSupport && window.navigator.vibrate(400)) {
|
||
|
|
return {
|
||
|
|
errMsg: 'vibrateLong:ok'
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
return {
|
||
|
|
errMsg: 'vibrateLong:fail'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export function vibrateShort () {
|
||
|
|
if (_isSupport && window.navigator.vibrate(15)) {
|
||
|
|
return {
|
||
|
|
errMsg: 'vibrateShort:ok'
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
return {
|
||
|
|
errMsg: 'vibrateShort:fail'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|