UPD: OFFLINE State

This commit is contained in:
Robert Kossessa
2024-02-05 00:44:46 +01:00
parent ae25ff6fd4
commit e5cc9875fe
6 changed files with 75 additions and 14 deletions

View File

@@ -77,6 +77,8 @@ function replaceContent(text = props.text, replaceInterval = props.replaceInterv
setTimeout(() => {
replaceContent(text, replaceInterval, steps + 1)
}, replaceInterval * (1 + Math.random()))
} else {
emit('finish')
}
}
@@ -113,6 +115,8 @@ function scramble(scrambleAmount = props.scrambleAmount, replaceInterval = props
defineExpose({ scramble })
const emit = defineEmits(['finish'])
onMounted(() => {
if (props.scrambleOnMount) {
setTimeout(() => {
@@ -124,7 +128,11 @@ onMounted(() => {
})
watch(() => props.text, () => {
replaceContent()
if (content.value === '') {
scramble()
} else {
replaceContent()
}
})
</script>