Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Vinicius authored and Luis Vinicius committed Dec 28, 2017
1 parent 95e2b93 commit 460ac19
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ init(`#element`, {
init('#element'});
```

Set multiples instances of Ityped at the same time, with different properties:
Set multiples instances of iTyped at the same time, with different properties:

```html

Expand Down
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</div>
<script src="dist/index.js"></script>
<script>
ityped.init("#ityped")
ityped.init("#itypedy", { showCursor: false, disableBackTyping: true, loop: false, onFinished: () => console.log('Yeah')})
ityped.init("#ityped", { strings: ['Nice One', 'Ok'] })
// ityped.init("#itypedy", { showCursor: false, disableBackTyping: true, loop: false, onFinished: () => console.log('Yeah')})
</script>
</body>

Expand Down
6 changes: 4 additions & 2 deletions src/writing.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const typeString = (word, i, el, props) => {
console.log(word, word.length , i)
if (i === word.length - 1) {
return window.setTimeout(() => {
window.setTimeout(() => {
let k = 0
for (let l = word.length - 1; l >= 0; l--) {
k += 1
if (props.disableBackTyping && (props.strings.indexOf(word) === props.strings.length - 1)) {
if (props.disableBackTyping && isLastLetterOfLastString(word, props) && !props.loop) {
return props.onFinished()
}
setTimeout(() => eraseString(l, el, props, word), props.backSpeed * k)
Expand Down Expand Up @@ -43,6 +44,7 @@ const writeString = (el, position, props, time) => {

export const start = (element, props) => {
const times = []
console.log(props)
const { strings, startDelay, typeSpeed, backSpeed, backDelay, loop } = props
const arrLen = strings.length
for (let i = 0; i < arrLen; i++) {
Expand Down

0 comments on commit 460ac19

Please sign in to comment.