Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit 0a619f5

Browse files
author
Viktor Pöntinen
committed
pre-release
1 parent 548b279 commit 0a619f5

File tree

5 files changed

+55
-75
lines changed

5 files changed

+55
-75
lines changed

.gitignore

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
1-
# Logs
2-
logs
3-
*.log
4-
5-
# Runtime data
6-
pids
7-
*.pid
8-
*.seed
9-
10-
# Directory for instrumented libs generated by jscoverage/JSCover
11-
lib-cov
12-
13-
# Coverage directory used by tools like istanbul
14-
coverage
15-
16-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17-
.grunt
18-
19-
# node-waf configuration
20-
.lock-wscript
21-
22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
24-
25-
# Dependency directory
26-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27-
node_modules
1+
node_modules

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 Korney Vasilchenko
3+
Copyright (c) 2018 Viktor Pöntinen
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,63 @@
1-
## ⌨️ TinyTyper - a tiny library for creating a typing effect on specified text element.
2-
[![npm version](https://badge.fury.io/js/tinytyper.svg)](https://badge.fury.io/js/tinytyper)
3-
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
4-
[![Build Status](https://travis-ci.org/lourenc/tinytyper.svg?branch=develop)](https://travis-ci.org/lourenc/tinytyper)
5-
[![Dependency Status](https://gemnasium.com/badges/github.com/lourenc/tinytyper.svg)](https://gemnasium.com/github.com/lourenc/tinytyper)
1+
## VueTinyTyper - a vue component for creating a typing effect element.
2+
3+
#### Credits
4+
This project is forked from https://github.com/lourenc/tinytyper
5+
Some parts of the readme are also originally from above repository.
6+
7+
#### Why
8+
This project was created because I was missing events in non-vue version.
69

710
#### Demo
811
<img align="center" src="https://s28.postimg.org/4qva5c1f1/tinytyper2.gif">
912

10-
#### Size (It's really tiny)
11-
- *Minimized: 2.9KB*
12-
- *Gziped: 1.1KB*
13-
1413
#### Installation
15-
Library can be easily installed via either NPM or Bower:
16-
17-
`npm i tinytyper --save`
14+
Library can be easily installed via either Yarn or NPM:
1815

16+
`npm i vue-tinytyper --save`
1917
OR
20-
21-
`bower i tinytyper --save`
18+
`yarn add vue-tinytyper`
2219

2320
#### Usage
2421

2522
Basic setup looks like this:
2623

2724
```js
28-
import TinyTyper from 'tinytyper';
29-
30-
const el = document.querySelector('.text-el')
31-
const options = { /* . . . */ }
32-
const instance = new TinyTyper(el, options)
25+
import VueTinytyper from 'vue-tinytyper';
3326
```
34-
35-
In case you need to run animation again:
27+
THEN
3628
```js
37-
instance.animate()
29+
<vue-tinytyper text="Hello, please type this out."></vue-tinytyper>
3830
```
31+
OR
32+
```js
33+
<vue-tinytyper>Hello, please type this out.</vue-tinytyper>
34+
```
35+
36+
Available `props`:
37+
38+
Prop | Default | Type | Description
39+
---------------- | ------------- | ----------- | --------------
40+
`text` | `` | String | The text to animate
41+
`textSpeed` | `95` | Number | Defines text speed animation
42+
`cursor` | `&#9612;` | String | Defines current cursor symbol
43+
`blinkSpeed` | `0.05` | Number | Defines blink speed of a cursor
44+
`containerClass` | 'tiny-typer-container' | String | A CSS class for the container element
45+
`cursorClass` | `tiny-typer-cursor` | String | A CSS class for cursor element
46+
`textClass` | `tiny-typer-text` | String | A CSS class for text element
47+
`staticCursor` | `false` | Boolean | Makes cursor static (disables blinking)
48+
`staticText` | `false` | Boolean | Makes text static (disables animation)
49+
`customEvents` | `{}` | Object | Pass custom "on-character" events. Example: `{ '!': 'my-event' }`, where the event 'my-event' will be triggered every time the current animation character matches the object key, eg. "!".
50+
3951

40-
Available `options`:
52+
Available `events`
4153

42-
Option | Default | Description
43-
------------- | -------------|--------------
44-
`text` | `innerText` of specifed `el`ement | Sets a text to be displayed
45-
`textSpeed` | `95` | Defines text speed animation
46-
`cursor` | ` &#9612;` | Defines current cursor symbol
47-
`blinkSpeed` | `0.05` | Defines blink speed of a cursor
48-
`cursorClass` | `tiny-typer-cursor` | A CSS class for cursor element
49-
`textClass` | `tiny-typer-text` | A CSS class for text element
50-
`staticCursor`| `false` | Makes cursor static (disables blinking)
51-
`staticText` | `false` | Makes text static (disables animation)
54+
Eventname | Trigger | Payload
55+
------------- | ---------- | ----------
56+
`animation-finished` | When animation doesn't have any more characters to animate | None
5257

5358
#### Contributions
5459

55-
Contributions are welcome. Feel free to create [issues](https://github.com/lourenc/tinytyper/issues) and [PRs](https://github.com/lourenc/tinytyper/pulls)
60+
Contributions are welcome. Feel free to create [issues](https://github.com/ViktorPontinen/vue-tinytyper/issues) and [PRs](https://github.com/ViktorPontinen/vue-tinytyper/pulls)
5661

5762
#### License
5863

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"blinking"
2222
],
2323
"license": "MIT",
24-
"main": "dist/vue-tiny-typer.js",
24+
"main": "dist/vue-tinytyper.min.js",
2525
"devDependencies": {
2626
"babel-core": "^6.26.0",
2727
"babel-loader": "^7.1.2",
@@ -33,6 +33,7 @@
3333
"webpack-merge": "^4.1.1"
3434
},
3535
"scripts": {
36-
"build": "yarn run rimraf ./dist && webpack --config ./webpack.config.js"
36+
"cleanbuild": "yarn run rimraf ./dist && webpack --config ./webpack.config.js",
37+
"build": "yarn run webpack --config ./webpack.config.js"
3738
}
3839
}

webpack.config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ var commonConfig = {
3333
module.exports = [
3434

3535
// Config 1: For browser environment
36-
merge(commonConfig, {
37-
entry: path.resolve(__dirname + '/src/plugin.js'),
38-
output: {
39-
filename: 'vue-tiny-typer.min.js',
40-
libraryTarget: 'window',
41-
library: 'VueTinyTyper'
42-
}
43-
}),
36+
// merge(commonConfig, {
37+
// entry: path.resolve(__dirname + '/src/plugin.js'),
38+
// output: {
39+
// filename: 'vue-tinytyper.min.js',
40+
// libraryTarget: 'window',
41+
// library: 'VueTinyTyper'
42+
// }
43+
// }),
4444

4545
// Config 2: For Node-based development environments
4646
merge(commonConfig, {
47-
entry: path.resolve(__dirname + '/src/VueTinyTyper.vue'),
47+
entry: path.resolve(__dirname + '/src/VueTinytyper.vue'),
4848
output: {
49-
filename: 'vue-tiny-typer.js',
49+
filename: 'vue-tinytyper.min.js',
5050
libraryTarget: 'umd',
51-
library: 'vue-tiny-typer',
51+
library: 'vue-tinytyper',
5252
umdNamedDefine: true
5353
}
5454
})

0 commit comments

Comments
 (0)