├── .gitignore
├── LICENSE
├── README.md
├── demo.html
├── jquery.textavatar.js
├── package-lock.json
├── package.json
├── textavatar.css
├── textavatar.iife.js
└── textavatar.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2013 Knovour
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | jQuery Text Avatar (include vanillajs version)
2 | =================
3 | Let user name become a simple text avatar
4 | #### [Demo]
5 |
6 | ## Usage
7 |
8 | For older version check [here](https://github.com/Knovour/jquery-textavatar/tree/old)
9 |
10 | ```bash
11 | npm i jquery.textavatar
12 | ```
13 |
14 | Load **textavatar.css** or just merge to your css file.
15 |
16 | ### jQuery
17 | ```html
18 |
19 |
20 | ```
21 | ```javascript
22 | $('.textavatar').textAvatar()
23 | ```
24 | #### Auto Create
25 | ```html
26 |
27 | ```
28 |
29 |
30 | #### Options
31 | There is only **width** and **name** now.
32 | ```javascript
33 | $('DIV-NAME').textAvatar({
34 | width: 120, //no need to type 'px'
35 | name: NAME HERE
36 | })
37 | ```
38 |
39 | ### VanillaJS
40 | ```html
41 |
42 | ```
43 |
44 | For es6 module
45 | ```javascript
46 | import textAvatar from 'textavatar.js'
47 |
48 | textAvatar(document.querySelector('.textavatar'))
49 | ```
50 |
51 | For normal usage
52 | ```html
53 |
54 | ```
55 |
56 |
57 | #### Auto Create
58 | ```html
59 |
60 | ```
61 |
62 |
63 | #### Options
64 | There is only **width** and **name** now.
65 | ```javascript
66 | textAvatar(document.querySelector('DIV-NAME'), {
67 | width: 120, //no need to type 'px'
68 | name: NAME HERE
69 | })
70 | ```
71 |
72 | ## MIT License
73 |
74 | [Demo]: http://knovour.github.io/jquery-textavatar
75 |
--------------------------------------------------------------------------------
/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | text avatar demo
6 |
7 |
26 |
27 |
28 |
Try it!
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
English
38 |
It will show only one word in small size(width < 26px)