mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
feat: 타이핑 스크립트 제거
This commit is contained in:
parent
c3acfb006f
commit
0c949e5c98
1 changed files with 0 additions and 43 deletions
|
@ -174,47 +174,4 @@
|
|||
});
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
var typeText = document.querySelector(".typeText")
|
||||
var textToBeTyped = "Hello, World"
|
||||
var textToBeTypedArr = ["Java", "Spring", "Rust", "Kotlin"]
|
||||
var index = 0, isAdding = true, textToBeTypedIndex = 0
|
||||
|
||||
function playAnim() {
|
||||
setTimeout(function () {
|
||||
// set the text of typeText to a substring of the text to be typed using index.
|
||||
typeText.innerText = textToBeTypedArr[textToBeTypedIndex].slice(0, index)
|
||||
if (isAdding) {
|
||||
// adding text
|
||||
if (index > textToBeTypedArr[textToBeTypedIndex].length) {
|
||||
// no more text to add
|
||||
isAdding = false
|
||||
//break: wait 2s before playing again
|
||||
setTimeout(function () {
|
||||
playAnim()
|
||||
}, 2000)
|
||||
return
|
||||
} else {
|
||||
// increment index by 1
|
||||
index++
|
||||
}
|
||||
} else {
|
||||
// removing text
|
||||
if (index === 0) {
|
||||
// no more text to remove
|
||||
isAdding = true
|
||||
//switch to next text in text array
|
||||
textToBeTypedIndex = (textToBeTypedIndex + 1) % textToBeTypedArr.length
|
||||
} else {
|
||||
// decrement index by 1
|
||||
index--
|
||||
}
|
||||
}
|
||||
// call itself
|
||||
playAnim()
|
||||
}, isAdding ? 120 : 60)
|
||||
}
|
||||
// start animation
|
||||
playAnim()
|
||||
</script>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue