├── .gitignore ├── LICENSE ├── README.md ├── package-lock.json ├── package.json └── src └── TagsBall.vue /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 yanthems 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VueTagsBall 2 | 3 | ## Description 4 | create a 3d tags ball for vue2 5 | 6 | ## Demo 7 | 8 | [demo](https://test.yanthems.com/) 9 | 10 | ## Install 11 | ``` 12 | npm install --save vue-tags-ball 13 | ``` 14 | ## Usage 15 | ```javascript 16 | //Gobal method 17 | import TagsBall from 'vue-tags-ball' 18 | Vue.use(TagsBall) 19 | 20 | //Component method 21 | import TagsBall from 'vue-tags-ball' 22 | //... 23 | components: { 24 | "tags-ball":TagsBall 25 | }, 26 | ``` 27 | ## Example 28 | ```html 29 | 30 | ``` 31 | `tags` is a String[],like `{"tag1","tag2","tag3"}`.and you can bind your own style. 32 | 33 | Warning: just watching the `tags` and `stop`,other props only init. 34 | 35 | ## Props 36 | | Property | Type | Description | Default | 37 | | -------- | ------- | ------------------------------ | ------------- | 38 | | tags | Array | all the tag | [] | 39 | | stop | Boolean | stop the animation | false | 40 | | width | Number | init the canvas widht | 200 | 41 | | height | Number | init the canvas height | 200 | 42 | | radius | Number | init the ball radius | 100 | 43 | | font | String | init the tag's label font | "24px monaco" | 44 | | fontMax | Number | init the tag's label max width | 60 | 45 | | color | String | init the label's color | "#fc8457" | 46 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-tags-ball", 3 | "version": "1.2.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "color": { 8 | "version": "3.0.0", 9 | "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", 10 | "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", 11 | "requires": { 12 | "color-convert": "1.9.2", 13 | "color-string": "1.5.3" 14 | } 15 | }, 16 | "color-convert": { 17 | "version": "1.9.2", 18 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", 19 | "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", 20 | "requires": { 21 | "color-name": "1.1.1" 22 | } 23 | }, 24 | "color-name": { 25 | "version": "1.1.1", 26 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", 27 | "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=" 28 | }, 29 | "color-string": { 30 | "version": "1.5.3", 31 | "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz", 32 | "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==", 33 | "requires": { 34 | "color-name": "1.1.1", 35 | "simple-swizzle": "0.2.2" 36 | } 37 | }, 38 | "is-arrayish": { 39 | "version": "0.3.2", 40 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", 41 | "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" 42 | }, 43 | "simple-swizzle": { 44 | "version": "0.2.2", 45 | "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", 46 | "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", 47 | "requires": { 48 | "is-arrayish": "0.3.2" 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-tags-ball", 3 | "version": "1.2.0", 4 | "description": "a 3d tags ball for vue2", 5 | "main": "src/TagsBall.vue", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" " 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/yanthems/vue-tags-ball.git" 12 | }, 13 | "keywords": [ 14 | "vue", 15 | "3d", 16 | "tags" 17 | ], 18 | "author": "yanthems@gmail.com", 19 | "license": "MIT", 20 | "bugs": { 21 | "url": "https://github.com/yanthems/vue-tags-ball/issues" 22 | }, 23 | "homepage": "https://github.com/yanthems/vue-tags-ball#readme", 24 | "dependencies": { 25 | "color": "^3.0.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/TagsBall.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 253 | --------------------------------------------------------------------------------