Skip to content

Commit

Permalink
Merge branch 'feature/ghi-#7-make-cursor-blink-toggleable' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed Mar 9, 2017
2 parents ac0f26d + 852d630 commit 27820cf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ hpm install nord-hyper

<p align="center"><strong>Non-obtrusive cursor blinking.</strong><br><img src="https://raw.githubusercontent.com/arcticicestudio/nord-hyper/develop/assets/scrcast-feature-cursor-blink.gif"/></p>

## Configuration
All configurations are set in the `nordHyper` object in your `~/.hyper.js` file.

### Cursor Blinking
The cursor blinking can be set with the `cursorBlink` attribute.
The default value is `true` to enable the non-obtrusive cursor blinking feature.
```js
module.exports = {
config: {
//...
nordHyper: {
cursorBlink: true,
}
//...
}
}
```

## Development
[![](https://img.shields.io/badge/Changelog-0.2.0-81A1C1.svg)](https://github.com/arcticicestudio/nord-hyper/blob/v0.2.0/CHANGELOG.md) [![](https://img.shields.io/badge/Workflow-gitflow--branching--model-81A1C1.svg)](http://nvie.com/posts/a-successful-git-branching-model) [![](https://img.shields.io/badge/Versioning-ArcVer_0.8.0-81A1C1.svg)](https://github.com/arcticicestudio/arcver)

Expand Down
28 changes: 17 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,23 @@ const colors = {
grayscale: foregroundColor
};

let cursorBlinkCSS = `
@keyframes blink {
10%, 50% { opacity: 0 }
60%, 100% { opacity: 1 }
}
.cursor-node[focus=true] {
mix-blend-mode: difference;
}
.cursor-node[focus=true]:not([hyper-blink-moving]) {
box-sizing: content-box !important;
animation: blink 1s ease infinite;
}
`;

exports.decorateConfig = config => {
const nordHyper = Object.assign({cursorBlink: true}, config.nordHyper);

return Object.assign({}, config, {
foregroundColor,
backgroundColor,
Expand All @@ -71,17 +87,7 @@ exports.decorateConfig = config => {
.cursor-node {
border-left-width: 2px;
}
@keyframes blink {
10%, 50% { opacity: 0 }
60%, 100% { opacity: 1 }
}
.cursor-node[focus=true] {
mix-blend-mode: difference;
}
.cursor-node[focus=true]:not([hyper-blink-moving]) {
box-sizing: content-box !important;
animation: blink 1s ease infinite;
}
${nordHyper.cursorBlink ? cursorBlinkCSS : ""}
`,
css: `
${config.css || ""}
Expand Down

0 comments on commit 27820cf

Please sign in to comment.