├── .gitignore ├── README.md ├── bower.json ├── demo ├── app-theme.html └── index.html ├── index.html ├── test └── typed-text_test.html └── typed-text.html /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # <typed-text> 2 | 3 | Polymer 2.0 element that simulates typing similar to [typed.js](https://github.com/mattboldt/typed.js/) for jQuery. 4 | 5 | Check out the [demo and full documentation](https://www.webcomponents.org/element/sespiros/typed-text) 6 | 7 | 24 | 25 | ## Install 26 | ```bash 27 | bower install --save sespiros/typed-text 28 | ``` 29 | Install with bower or [download the zip](https://github.com/sespiros/typed-text/archive/v1.0.0.zip) 30 | 31 | ## Import 32 | ```html 33 | 34 | ``` 35 | 36 | ## Usage 37 | ```html 38 | 39 | ``` 40 | where `options` can be any of: 41 | * `strings`: an array of strings to be typed one after the other i.e. `["Hello world!", "typed-text is awesome"]` 42 | * `cursor`: specify a cursor string. `|` by default 43 | * `noretype`: only backspaces to erase the part of the string that is different 44 | * `noloop`: stops typing after the last string 45 | * `noblink`: stops the cursor from blinking 46 | 47 | ### Strings 48 | The typed-text strings can be set in one of two ways: 49 | * Using the strings property: 50 | ```html 51 | 52 | ``` 53 | * Writing directly into the HTML element: 54 | ```html 55 | 56 |

Here is the first sentence.

57 |

Here is another one!

58 |
59 | ``` 60 | 61 | ### Cursor 62 | ```html 63 | 64 | ``` 65 | 66 | ## Features 67 | - Can **type** and **delete** text 68 | - Supports constant **looping** between text 69 | - Cursor **blinking** and customization with custom-style 70 | - Smart **noretype** to keep common parts of consecutive strings 71 | - Style it however you want for cool effects! 72 | 73 | ## Contribute 74 | Feel free to extend it or propose new functionality 75 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typed-text", 3 | "description": "An element that simulates typing.", 4 | "keywords": [ 5 | "web-component", 6 | "web-components", 7 | "polymer", 8 | "typed" 9 | ], 10 | "version": "2.0.0", 11 | "homepage": "https://github.com/sespiros/typed-text/", 12 | "license": "MIT", 13 | "authors": [ 14 | "Seimenis Spyros ", 15 | "Dimitris Moraitis " 16 | ], 17 | "ignore": [ 18 | "**/.*", 19 | "node_modules", 20 | "bower_components", 21 | "test", 22 | "tests" 23 | ], 24 | "dependencies": { 25 | "polymer": "Polymer/polymer#^2.0.0", 26 | "iron-component-page": "PolymerElements/iron-component-page#^2.0.0", 27 | "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0" 28 | }, 29 | "devDependencies": { 30 | "web-component-tester": "^6.0.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /demo/app-theme.html: -------------------------------------------------------------------------------- 1 | 2 | 31 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | typed-text Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |

An example of <typed-text>:

18 | 19 | 20 | 21 | Strings can be placed directly inside the element! 22 |

They can even be be nested!

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | typed-text 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/typed-text_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | typed-text test 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /typed-text.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 78 | 79 | 226 | 227 | --------------------------------------------------------------------------------