Skip to content

Commit

Permalink
Merge pull request #6 from Nathanjms/v1.0.2
Browse files Browse the repository at this point in the history
V1.0.2 - Update cursor styling
  • Loading branch information
Nathanjms authored Sep 25, 2022
2 parents 3d24f03 + c3307c4 commit f3111d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,30 @@ The cursor styling by default is the following:
.auto-typer-vue::after {
content: "";
position: inline-block;
border: 1px solid rgba(255, 255, 255, 0.8);
border: 1px solid;
opacity: 0.5;
margin-left: 1px;
animation: cursor-blink 1.5s steps(2) infinite;
animation: cursor-blink 1.5s step-start infinite;
}

@keyframes cursor-blink {
0% {
50% {
opacity: 0;
}
}

```

This can be completely overridden, or certain parts can be altered by adding additional styles below the import of `style.css`, targetting the element `.auto-typer-vue::after`.

#### Example: Changing the cursor colour
#### Example: Changing the cursor colour/opacity

```vue
<style scoped>
@import "auto-typer-vue3/dist/style.css";
.auto-typer-vue::after {
border-color: rgba(0, 0, 0, 0.8);
border-color: rgb(0, 0, 0);
opacity: 1;
}
</style>
```
Expand All @@ -99,7 +102,7 @@ You could also give an ID attribute to auto typer component, and then target the
<script setup>
import { AutoTyperVue } from "auto-typer-vue";
let text = [
let textArray = [
'This is a demo.',
'And this is another Demo!'
];
Expand All @@ -109,14 +112,15 @@ let text = [
<AutoTyperVue
componentTag="h1"
id="main-auto-typer"
:text="text"
:text="textArray"
/>
</template>
<style scoped>
@import "auto-typer-vue3/dist/style.css";
#main-auto-typer::after {
border-color: rgba(0, 0, 0, 0.8);
border-color: rgb(0, 0, 0);
opacity: 0.8;
}
</style>
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-typer-vue3",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple Autotyper for Vue 3, with some customisation options.",
"keywords": [
"vue3",
Expand Down
3 changes: 2 additions & 1 deletion src/styles/main.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.auto-typer-vue::after {
content: "";
position: inline-block;
border: 1px solid rgba(255, 255, 255, 0.5);
border: 1px solid;
opacity: 0.5;
margin-left: 1px;
animation: cursor-blink 1.5s step-start infinite;
}
Expand Down

0 comments on commit f3111d1

Please sign in to comment.