Skip to content

Commit

Permalink
fixed conflicts and tested demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mattboldt committed May 26, 2018
2 parents be0edd0 + 99d12e0 commit 60227e4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/demos.js
Expand Up @@ -93,4 +93,4 @@ function toggleLoop(typed) {
} else {
typed.loop = true;
}
}
}
11 changes: 7 additions & 4 deletions lib/typed.js
Expand Up @@ -439,8 +439,11 @@ return /******/ (function(modules) { // webpackBootstrap
if (this.pause.status) return;
if (this.cursorBlinking === isBlinking) return;
this.cursorBlinking = isBlinking;
var status = isBlinking ? 'infinite' : 0;
this.cursor.style.animationIterationCount = status;
if (isBlinking) {
this.cursor.classList.add('typed-cursor--blink');
} else {
this.cursor.classList.remove('typed-cursor--blink');
}
}

/**
Expand Down Expand Up @@ -749,10 +752,10 @@ return /******/ (function(modules) { // webpackBootstrap
css.type = 'text/css';
var innerCss = '';
if (self.showCursor) {
innerCss += '\n .typed-cursor{\n opacity: 1;\n animation: typedjsBlink 0.7s infinite;\n -webkit-animation: typedjsBlink 0.7s infinite;\n animation: typedjsBlink 0.7s infinite;\n }\n @keyframes typedjsBlink{\n 50% { opacity: 0.0; }\n }\n @-webkit-keyframes typedjsBlink{\n 0% { opacity: 1; }\n 50% { opacity: 0.0; }\n 100% { opacity: 1; }\n }\n ';
innerCss += '\n .typed-cursor{\n opacity: 1;\n }\n .typed-cursor.typed-cursor--blink{\n animation: typedjsBlink 0.7s infinite;\n -webkit-animation: typedjsBlink 0.7s infinite;\n animation: typedjsBlink 0.7s infinite;\n }\n @keyframes typedjsBlink{\n 50% { opacity: 0.0; }\n }\n @-webkit-keyframes typedjsBlink{\n 0% { opacity: 1; }\n 50% { opacity: 0.0; }\n 100% { opacity: 1; }\n }\n ';
}
if (self.fadeOut) {
innerCss += '\n .typed-fade-out{\n opacity: 0;\n transition: opacity .25s;\n -webkit-animation: 0;\n animation: 0;\n }\n ';
innerCss += '\n .typed-fade-out{\n opacity: 0;\n transition: opacity .25s;\n }\n .typed-cursor.typed-cursor--blink.typed-fade-out{\n -webkit-animation: 0;\n animation: 0;\n }\n ';
}
if (css.length === 0) {
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/typed.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/typed.min.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/initializer.js
Expand Up @@ -156,6 +156,8 @@ export default class Initializer {
innerCss += `
.typed-cursor{
opacity: 1;
}
.typed-cursor.typed-cursor--blink{
animation: typedjsBlink 0.7s infinite;
-webkit-animation: typedjsBlink 0.7s infinite;
animation: typedjsBlink 0.7s infinite;
Expand All @@ -175,8 +177,10 @@ export default class Initializer {
.typed-fade-out{
opacity: 0;
transition: opacity .25s;
}
.typed-cursor.typed-cursor--blink.typed-fade-out{
-webkit-animation: 0;
animation: 0;
animation: 0;
}
`;
}
Expand Down
7 changes: 5 additions & 2 deletions src/typed.js
Expand Up @@ -323,8 +323,11 @@ export default class Typed {
if (this.pause.status) return;
if (this.cursorBlinking === isBlinking) return;
this.cursorBlinking = isBlinking;
const status = isBlinking ? 'infinite' : 0;
this.cursor.style.animationIterationCount = status;
if (isBlinking) {
this.cursor.classList.add('typed-cursor--blink');
} else {
this.cursor.classList.remove('typed-cursor--blink');
}
}

/**
Expand Down

0 comments on commit 60227e4

Please sign in to comment.