ADD: Scramble delay prop
This commit is contained in:
@@ -4,7 +4,7 @@ import click from '@/assets/click.mp3'
|
|||||||
|
|
||||||
function playClick() {
|
function playClick() {
|
||||||
const audio = new Audio(click)
|
const audio = new Audio(click)
|
||||||
audio.volume = 0.01 * (1 + Math.random() * 0.75 - 0.375 )
|
audio.volume = 0.01 * (1 + Math.random() * 0.75 - 0.375)
|
||||||
audio.play()
|
audio.play()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +37,10 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
delay: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const content = ref('')
|
const content = ref('')
|
||||||
@@ -107,7 +111,9 @@ defineExpose({ scramble })
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.scrambleOnMount) {
|
if (props.scrambleOnMount) {
|
||||||
|
setTimeout(() => {
|
||||||
scramble()
|
scramble()
|
||||||
|
}, props.delay)
|
||||||
} else {
|
} else {
|
||||||
content.value = props.text
|
content.value = props.text
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user