Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
g1eb committed Dec 15, 2016
2 parents 6449e30 + cf1237d commit f6029c5
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cli-plugin",
"version": "0.0.1",
"version": "0.0.2",
"description": "Command line interface plugin for web applications.",
"homepage": "https://github.com/g1eb/cli-plugin#readme",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion dist/cli-plugin.min.css

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

2 changes: 1 addition & 1 deletion dist/cli-plugin.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cli-plugin",
"version": "0.0.1",
"version": "0.0.2",
"description": "Command line interface plugin for web applications.",
"homepage": "https://github.com/g1eb/cli-plugin#readme",
"author": "g1eb",
Expand Down
53 changes: 37 additions & 16 deletions src/cli-plugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
.cli-plugin {
display: block;
position: absolute;
position: fixed;
top: 50px;
left: 50px;
bottom: 50px;
Expand Down Expand Up @@ -89,39 +89,60 @@
top: 0;
right: 0;
bottom: 0;
opacity: 1;
background-color: black;

-webkit-animation: blink 1.5s ease-in-out 0s infinite;
-moz-animation: blink 1.5s ease-in-out 0s infinite;
-ms-animation: blink 1.5s ease-in-out 0s infinite;
-o-animation: blink 1.5s ease-in-out 0s infinite;
animation: blink 1.5s ease-in-out 0s infinite;
-webkit-animation: blink 1.5s linear 0s infinite;
-moz-animation: blink 1.5s linear 0s infinite;
-ms-animation: blink 1.5s linear 0s infinite;
-o-animation: blink 1.5s linear 0s infinite;
animation: blink 1.5s linear 0s infinite;
}
.cli-plugin .input.active .cursor {
display: none;
}

@-webkit-keyframes blink {
40% { background-color: transparent; }
60% { background-color: transparent; }
0% { opacity: 0; }
30% { opacity: 0; }
35% { opacity: 1; }
65% { opacity: 1; }
70% { opacity: 0; }
100% { opacity: 0; }
}

@-moz-keyframes blink {
40% { background-color: transparent; }
60% { background-color: transparent; }
0% { opacity: 0; }
30% { opacity: 0; }
35% { opacity: 1; }
65% { opacity: 1; }
70% { opacity: 0; }
100% { opacity: 0; }
}

@-ms-keyframes blink {
40% { background-color: transparent; }
60% { background-color: transparent; }
0% { opacity: 0; }
30% { opacity: 0; }
35% { opacity: 1; }
65% { opacity: 1; }
70% { opacity: 0; }
100% { opacity: 0; }
}

@-o-keyframes blink {
40% { background-color: transparent; }
60% { background-color: transparent; }
0% { opacity: 0; }
30% { opacity: 0; }
35% { opacity: 1; }
65% { opacity: 1; }
70% { opacity: 0; }
100% { opacity: 0; }
}

@keyframes blink {
40% { background-color: transparent; }
60% { background-color: transparent; }
0% { opacity: 0; }
30% { opacity: 0; }
35% { opacity: 1; }
65% { opacity: 1; }
70% { opacity: 0; }
100% { opacity: 0; }
}
9 changes: 9 additions & 0 deletions src/cli-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ var cliPlugin = {
cliPlugin.inputElement.setAttribute('spellcheck', 'false');
cliPlugin.containerElement.appendChild(cliPlugin.inputElement);

cliPlugin.addCursor();
},

/**
* Add blinking cursor to input element
*/
addCursor: function () {
cliPlugin.cursorElement = document.createElement('div');
cliPlugin.cursorElement.setAttribute('class', 'cursor');
cliPlugin.cursorElement.setAttribute('style', 'background:'+cliPlugin.settings.cursorColor);
Expand Down Expand Up @@ -127,6 +134,7 @@ var cliPlugin = {
cmd = cliPlugin.history[--cliPlugin.index];
}
cliPlugin.inputElement.innerHTML = cmd;
cliPlugin.addCursor();
},

/**
Expand All @@ -138,6 +146,7 @@ var cliPlugin = {
cmd = cliPlugin.history[++cliPlugin.index] || '';
}
cliPlugin.inputElement.innerHTML = cmd;
cliPlugin.addCursor();
},

/**
Expand Down

0 comments on commit f6029c5

Please sign in to comment.