Skip to content

Commit

Permalink
Merge pull request #8 from Nathanjms/v1.1.1
Browse files Browse the repository at this point in the history
v1.1.1
  • Loading branch information
Nathanjms authored Sep 29, 2022
2 parents 7713f10 + ab6a5a9 commit 2c7aa9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ Then import the module and css file into your Vue component (see usage/example b

## Props

| Prop | Type | Default | Description | Validation |
| :---------------------- | :----------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------- |
| `componentTag` | `string` | 'span' | The HTML tag that the element will be. | Currently accepts any of the following: `span`, `p`, `a`, `h*` (where * is any number). |
| `beginningWord` | `string` | `''` | A string prepended to every text item. _If you would like to have a space at the end, I recommend using the ` ` character if you are inputting strings directly, and the javascript escape code `\xa0` if you are inputting it into a bound tag_. | N/A. |
| `writtenBeginningWord` | `string` | `''` | A word that will be typed when the auto-typer begins, and then will stay there. _If you would like to have a space at the end, I recommend using the ` ` character if you are inputting strings directly, and the javascript escape code `\xa0` if you are inputting it bound taginto a _. | N/A. |
| `text` | `string \|array<string>` | `''` | Either a string to be auto-typed, or an array of strings to be auto-typed. | |
| `startDelay` | `number` | `500` | Time (ms) before the auto-typer begins. | Number >= 0. |
| `betweenWordDelay` | `number` | `500` | Time (ms) before the next `text` string is typed. | Number >= 0. |
| `typingDelay` | `number` | `300` | Time (ms) between each character is typed. | Number >= 0. |
| `deletingDelay` | `number` | `100` | Time (ms) between each character is deleted after the text has been typed. | Number >= 0. |
| `waitBeforeDeleteDelay` | `number` | `500` | Time (ms) after the text has been typed before deleting it begins. | Number >= 0. |
| `startByDefault` | `bool` | `true` | Whether to start the auto-typer by default. If set to false, the `begin()` method must be called manually. | Number >= 0. |
| `repeat` | `bool` | `true` | Whether to repeat the text once all of them have been typed. | N/A. | |
| Prop | Type | Default | Description | Validation |
| :---------------------- | :----------------------- | :------ | :--------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
| `componentTag` | `string` | 'span' | The HTML tag that the element will be. | Currently accepts any of the following: `span`, `p`, `a`, `h*` (where * is any number). |
| `beginningWord` | `string` | `''` | A string prepended to every text item. | N/A. |
| `writtenBeginningWord` | `string` | `''` | A word that will be typed when the auto-typer begins, and then will stay there. | N/A. |
| `text` | `string \|array<string>` | `''` | Either a string to be auto-typed, or an array of strings to be auto-typed. | |
| `startDelay` | `number` | `500` | Time (ms) before the auto-typer begins. | Number >= 0. |
| `betweenWordDelay` | `number` | `500` | Time (ms) before the next `text` string is typed. | Number >= 0. |
| `typingDelay` | `number` | `300` | Time (ms) between each character is typed. | Number >= 0. |
| `deletingDelay` | `number` | `100` | Time (ms) between each character is deleted after the text has been typed. | Number >= 0. |
| `waitBeforeDeleteDelay` | `number` | `500` | Time (ms) after the text has been typed before deleting it begins. | Number >= 0. |
| `startByDefault` | `bool` | `true` | Whether to start the auto-typer by default. If set to false, the `begin()` method must be called manually. | Number >= 0. |
| `repeat` | `bool` | `true` | Whether to repeat the text once all of them have been typed. | N/A. | |
## Usage/Example

### Basic Example
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.1.0",
"version": "1.1.1",
"description": "A simple Autotyper for Vue 3, with some customisation options.",
"keywords": [
"vue3",
Expand Down
6 changes: 5 additions & 1 deletion src/components/auto-typer-vue/AutoTyperVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ export default defineComponent({
// No word to write, stop here!
return;
}
for (let char of [...this.writtenBeginningWord]) {
let spacedWrittenBeginningWord = this.writtenBeginningWord.replace(
/\s/g,
"\xa0"
);
for (let char of [...spacedWrittenBeginningWord]) {
this.typedBeginningWord += char;
await this.delay(this.typingDelay);
}
Expand Down

0 comments on commit 2c7aa9c

Please sign in to comment.