-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #579 from Adamant-im/feat/vibro
feat: page with sound vibrations
- Loading branch information
Showing
3 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<template> | ||
<div> | ||
<input v-model="vibro" class="input" placeholder="Example 30,20,30" /> | ||
<v-btn @click="vibration" class="btnPlay"> play</v-btn> | ||
<v-btn @click="veryShort" class="btn" append-icon="mdi-play" | ||
>Very short | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="short" class="btn" append-icon="mdi-play" | ||
>Short | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="medium" class="btn" append-icon="mdi-play" | ||
>Medium | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="long" class="btn" append-icon="mdi-play" | ||
>Long | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="doubleVeryShort" class="btn" append-icon="mdi-play" | ||
>Double-v-Short | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="tripleVeryShort" class="btn" append-icon="mdi-play" | ||
>Triple-v-Short | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
<v-btn @click="doubleVeryShort" class="btn" append-icon="mdi-play" | ||
>Double-Short | ||
<template v-slot:append> | ||
<v-icon color="warning"></v-icon> | ||
</template> | ||
</v-btn> | ||
</div> | ||
</template> | ||
<script> | ||
import { vibrate } from '@/lib/vibrate.js' | ||
export default { | ||
data: () => ({ | ||
vibro: undefined | ||
}), | ||
methods: { | ||
vibration() { | ||
let num = this.vibro.split(',').map((i) => Number(i)) | ||
return navigator.vibrate(num) | ||
}, | ||
veryShort() { | ||
return vibrate.veryShort() | ||
}, | ||
short() { | ||
return vibrate.short() | ||
}, | ||
medium() { | ||
return vibrate.medium() | ||
}, | ||
long() { | ||
return vibrate.long() | ||
}, | ||
doubleVeryShort() { | ||
return vibrate.doubleVeryShort() | ||
}, | ||
tripleVeryShort() { | ||
return vibrate.tripleVeryShort() | ||
}, | ||
doubleShort() { | ||
return vibrate.doubleShort() | ||
} | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
@import 'vuetify/settings'; | ||
@import '@/assets/styles/settings/_colors.scss'; | ||
.input { | ||
border: 2px solid orange; | ||
margin-right: 16px; | ||
} | ||
.btnPlay { | ||
background-color: rgba(205, 144, 31, 0.93); | ||
height: 32px; | ||
} | ||
.btn { | ||
display: flex; | ||
margin-top: 12px; | ||
background-color: map-get($adm-colors, 'regular'); | ||
} | ||
</style> |