├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .npmignore
├── .travis.yml
├── LICENSE
├── README.md
├── assets
└── demo.gif
├── build
├── build.js
├── check-versions.js
├── dev-client.js
├── dev-server.js
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── deploy.sh
├── dist
├── choice-color.js
└── choice-color.js.gz
├── index.html
├── package.json
├── src
├── components
│ ├── choice-color.vue
│ └── circular-nav.vue
├── main.js
└── style
│ └── mixin.scss
├── static
└── .gitkeep
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["es2015", { "modules": false }],
4 | "stage-2"
5 | ],
6 | "plugins": ["transform-runtime"],
7 | "comments": false,
8 | "env": {
9 | "test": {
10 | "plugins": [ "istanbul" ]
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | config/*.js
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // http://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: true,
11 | },
12 | extends: 'airbnb-base',
13 | // required to lint *.vue files
14 | plugins: [
15 | 'html'
16 | ],
17 | // check if imports actually resolve
18 | 'settings': {
19 | 'import/resolver': {
20 | 'webpack': {
21 | 'config': 'build/webpack.base.conf.js'
22 | }
23 | }
24 | },
25 | // add your custom rules here
26 | 'rules': {
27 | // don't require .vue extension when importing
28 | 'import/extensions': ['error', 'always', {
29 | 'js': 'never',
30 | 'vue': 'never'
31 | }],
32 | // allow optionalDependencies
33 | 'import/no-extraneous-dependencies': ['error', {
34 | 'optionalDependencies': ['test/unit/index.js']
35 | }],
36 | // allow debugger during development
37 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # nyc test coverage
18 | .nyc_output
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directories
30 | node_modules
31 | jspm_packages
32 |
33 | # Optional npm cache directory
34 | .npm
35 |
36 | # Optional REPL history
37 | .node_repl_history
38 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | example
4 | assets
5 | index.html
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js: stable
3 |
4 | # S: Build Lifecycle
5 | install:
6 |
7 | #before_script:
8 | - source ./deploy.sh
9 |
10 | script:
11 | - xandeerBuild
12 |
13 | after_script:
14 | - npm publish
15 | # E: Build LifeCycle
16 |
17 | branches:
18 | only:
19 | - dev
20 | - master
21 |
22 | env:
23 | global:
24 | - GH_REF: github.com/xandeer/vue-circle-choice.git
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 xandeer
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 | # vue-circle-choice
2 |
3 | > A circular color choice and navigation with Vue.js
4 |
5 | > 
6 |
7 | ## Demo
8 |
9 | 可以在 [dev](https://github.com/xandeer/vue-circle-choice/tree/dev) 分支查看详细示例,在线 [Demo](https://xandeer.me/vue-circle-choice/)。
10 |
11 | ## 安装
12 |
13 | ``` bash
14 | npm install vue-circle-choice --save
15 | ```
16 |
17 | ## 引入
18 |
19 | ### 作为全局组件使用
20 |
21 | ``` javascript
22 | // 在项目入口文件
23 | import Vue from 'vue';
24 | // 圆环型取色盘
25 | import choiceColor from 'vue-circle-choice';
26 | // 半圆型导航
27 | import circularNav from 'vue-circle-choice';
28 |
29 | Vue.component('choiceColor', choiceColor);
30 | Vue.component('circularNav', circularNav);
31 | ```
32 |
33 | ### 作为局部组件使用
34 |
35 | ``` javascript
36 | // 在某个组件中
37 | import choiceColor from 'vue-circle-choice';
38 | import circularNav from 'vue-circle-choice';
39 |
40 | export default {
41 | components: {
42 | choiceColor,
43 | circularNav,
44 | },
45 | };
46 | ```
47 |
48 | ## API
49 |
50 | ### choice-color
51 |
52 | #### Props
53 |
54 | | 参数 | 类型 | 说明 |
55 | | ------ | ---- | ---- |
56 | | colors | Array | 圆环各部分背景色 |
57 | | radius | String | 圆环半径 |
58 |
59 | #### Events
60 |
61 | | 事件名 | 参数 | 说明 |
62 | | ---- | ---- | ---- |
63 | | updateColor | { index, color } | index: 按钮的索引; color: 按下按钮的颜色 |
64 |
65 | #### 示例
66 |
67 | 使用 `pug` 代码:
68 | ``` pug
69 | choice-color(:colors='colors', radius="10em", @updateColor='updateColor')
70 | ```
71 |
72 | 使用 `html` 代码:
73 | ``` html
74 |
75 | ```
76 |
77 | 组件数据及自定义事件:
78 | ``` javascript
79 | const colors = [
80 | '#1ba6cc',
81 | '#189ba7',
82 | '#98c6ae',
83 | '#45a270',
84 | '#7cb325',
85 | '#eb9826',
86 | ];
87 |
88 | data() {
89 | return {
90 | colors,
91 | index: 0,
92 | color: this.colors[0],
93 | };
94 | },
95 | methods: {
96 | updateColor({ index, color }) {
97 | this.index = index;
98 | this.color = color;
99 | },
100 | }
101 | ```
102 |
103 | ### circular-nav
104 |
105 | #### Props
106 |
107 | | 参数 | 类型 | 说明 |
108 | | ------ | ---- | ---- |
109 | | color | String | 圆环背景色 |
110 | | radius | String | 圆环半径 |
111 | | navs | Array[Object] | 各项导航设置,都是可选,具体如下 |
112 | | | href | `href` 属性,默认为 `javascript:void(0)` |
113 | | | label | 导航名称 |
114 | | | icon | 字体图标类名,已添加 `iconfont` |
115 |
116 | #### Events
117 |
118 | | 事件名 | 参数 | 说明 |
119 | | ---- | ---- | ---- |
120 | | updateNav | index | 导航的索引 |
121 |
122 | #### 示例
123 |
124 | 使用 `pug` 代码:
125 | ``` pug
126 | circular-nav(:navs='navs', :color='color', radius="8em", @updateNav='updateNav')
127 | ```
128 |
129 | 使用 `html` 代码:
130 | ``` html
131 |
132 | ```
133 |
134 | 组件数据及自定义事件:
135 | ``` javascript
136 | const navs = [{
137 | label: 'Discover',
138 | href: 'javascript:void(0)',
139 | icon: 'icon-discover',
140 | }, {
141 | label: 'Home',
142 | href: 'javascript:void(0)',
143 | icon: 'icon-home',
144 | }, {
145 | label: 'My',
146 | href: 'javascript:void(0)',
147 | icon: 'icon-my',
148 | }];
149 |
150 | data() {
151 | return {
152 | index: 0,
153 | color: '#1ba6cc',
154 | navs,
155 | };
156 | },
157 | methods: {
158 | updateNav(index) {
159 | this.index = index;
160 | },
161 | }
162 | ```
163 |
164 | ## bug和建议
165 |
166 | 如果在使用中遇到问题或者建议,欢迎提`issues`。
--------------------------------------------------------------------------------
/assets/demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xandeer/vue-circle-choice/a30b8d37846b74526ead8b6974a3c3fd417696a3/assets/demo.gif
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | // https://github.com/shelljs/shelljs
2 | require('./check-versions')()
3 |
4 | process.env.NODE_ENV = 'production'
5 |
6 | var ora = require('ora')
7 | var path = require('path')
8 | var chalk = require('chalk')
9 | var shell = require('shelljs')
10 | var webpack = require('webpack')
11 | var config = require('../config')
12 | var webpackConfig = require('./webpack.prod.conf')
13 |
14 | var spinner = ora('building for production...')
15 | spinner.start()
16 |
17 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
18 | shell.rm('-rf', assetsPath)
19 | shell.mkdir('-p', assetsPath)
20 | shell.config.silent = true
21 | // shell.cp('-R', 'static/*', assetsPath)
22 | shell.config.silent = false
23 |
24 | webpack(webpackConfig, function (err, stats) {
25 | spinner.stop()
26 | if (err) throw err
27 | process.stdout.write(stats.toString({
28 | colors: true,
29 | modules: false,
30 | children: false,
31 | chunks: false,
32 | chunkModules: false
33 | }) + '\n\n')
34 |
35 | console.log(chalk.cyan(' Build complete.\n'))
36 | console.log(chalk.yellow(
37 | ' Tip: built files are meant to be served over an HTTP server.\n' +
38 | ' Opening index.html over file:// won\'t work.\n'
39 | ))
40 | })
41 |
--------------------------------------------------------------------------------
/build/check-versions.js:
--------------------------------------------------------------------------------
1 | var chalk = require('chalk')
2 | var semver = require('semver')
3 | var packageConfig = require('../package.json')
4 |
5 | function exec (cmd) {
6 | return require('child_process').execSync(cmd).toString().trim()
7 | }
8 |
9 | var versionRequirements = [
10 | {
11 | name: 'node',
12 | currentVersion: semver.clean(process.version),
13 | versionRequirement: packageConfig.engines.node
14 | },
15 | {
16 | name: 'npm',
17 | currentVersion: exec('npm --version'),
18 | versionRequirement: packageConfig.engines.npm
19 | }
20 | ]
21 |
22 | module.exports = function () {
23 | var warnings = []
24 | for (var i = 0; i < versionRequirements.length; i++) {
25 | var mod = versionRequirements[i]
26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
27 | warnings.push(mod.name + ': ' +
28 | chalk.red(mod.currentVersion) + ' should be ' +
29 | chalk.green(mod.versionRequirement)
30 | )
31 | }
32 | }
33 |
34 | if (warnings.length) {
35 | console.log('')
36 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
37 | console.log()
38 | for (var i = 0; i < warnings.length; i++) {
39 | var warning = warnings[i]
40 | console.log(' ' + warning)
41 | }
42 | console.log()
43 | process.exit(1)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('eventsource-polyfill')
3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4 |
5 | hotClient.subscribe(function (event) {
6 | if (event.action === 'reload') {
7 | window.location.reload()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/build/dev-server.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 |
3 | var config = require('../config')
4 | if (!process.env.NODE_ENV) {
5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
6 | }
7 |
8 | var opn = require('opn')
9 | var path = require('path')
10 | var express = require('express')
11 | var webpack = require('webpack')
12 | var proxyMiddleware = require('http-proxy-middleware')
13 | var webpackConfig = require('./webpack.dev.conf')
14 |
15 | // default port where dev server listens for incoming traffic
16 | var port = process.env.PORT || config.dev.port
17 | // automatically open browser, if not set will be false
18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser
19 | // Define HTTP proxies to your custom API backend
20 | // https://github.com/chimurai/http-proxy-middleware
21 | var proxyTable = config.dev.proxyTable
22 |
23 | var app = express()
24 | var compiler = webpack(webpackConfig)
25 |
26 | var devMiddleware = require('webpack-dev-middleware')(compiler, {
27 | publicPath: webpackConfig.output.publicPath,
28 | quiet: true
29 | })
30 |
31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, {
32 | log: () => {}
33 | })
34 | // force page reload when html-webpack-plugin template changes
35 | compiler.plugin('compilation', function (compilation) {
36 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
37 | hotMiddleware.publish({ action: 'reload' })
38 | cb()
39 | })
40 | })
41 |
42 | // proxy api requests
43 | Object.keys(proxyTable).forEach(function (context) {
44 | var options = proxyTable[context]
45 | if (typeof options === 'string') {
46 | options = { target: options }
47 | }
48 | app.use(proxyMiddleware(options.filter || context, options))
49 | })
50 |
51 | // handle fallback for HTML5 history API
52 | app.use(require('connect-history-api-fallback')())
53 |
54 | // serve webpack bundle output
55 | app.use(devMiddleware)
56 |
57 | // enable hot-reload and state-preserving
58 | // compilation error display
59 | app.use(hotMiddleware)
60 |
61 | // serve pure static assets
62 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
63 | app.use(staticPath, express.static('./static'))
64 |
65 | var uri = 'http://localhost:' + port
66 |
67 | devMiddleware.waitUntilValid(function () {
68 | console.log('> Listening at ' + uri + '\n')
69 | })
70 |
71 | module.exports = app.listen(port, function (err) {
72 | if (err) {
73 | console.log(err)
74 | return
75 | }
76 |
77 | // when env is testing, don't need open it
78 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
79 | opn(uri)
80 | }
81 | })
82 |
--------------------------------------------------------------------------------
/build/utils.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
4 |
5 | exports.assetsPath = function (_path) {
6 | var assetsSubDirectory = process.env.NODE_ENV === 'production'
7 | ? config.build.assetsSubDirectory
8 | : config.dev.assetsSubDirectory
9 | return path.posix.join(assetsSubDirectory, _path)
10 | }
11 |
12 | exports.cssLoaders = function (options) {
13 | options = options || {}
14 | // generate loader string to be used with extract text plugin
15 | function generateLoaders (loaders) {
16 | var sourceLoader = loaders.map(function (loader) {
17 | var extraParamChar
18 | if (/\?/.test(loader)) {
19 | loader = loader.replace(/\?/, '-loader?')
20 | extraParamChar = '&'
21 | } else {
22 | loader = loader + '-loader'
23 | extraParamChar = '?'
24 | }
25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
26 | }).join('!')
27 |
28 | // Extract CSS when that option is specified
29 | // (which is the case during production build)
30 | if (options.extract) {
31 | return ExtractTextPlugin.extract({
32 | use: sourceLoader,
33 | fallback: 'vue-style-loader'
34 | })
35 | } else {
36 | return ['vue-style-loader', sourceLoader].join('!')
37 | }
38 | }
39 |
40 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html
41 | return {
42 | css: generateLoaders(['css']),
43 | postcss: generateLoaders(['css']),
44 | less: generateLoaders(['css', 'less']),
45 | sass: generateLoaders(['css', 'sass?indentedSyntax']),
46 | scss: generateLoaders(['css', 'sass']),
47 | stylus: generateLoaders(['css', 'stylus']),
48 | styl: generateLoaders(['css', 'stylus'])
49 | }
50 | }
51 |
52 | // Generate loaders for standalone style files (outside of .vue)
53 | exports.styleLoaders = function (options) {
54 | var output = []
55 | var loaders = exports.cssLoaders(options)
56 | for (var extension in loaders) {
57 | var loader = loaders[extension]
58 | output.push({
59 | test: new RegExp('\\.' + extension + '$'),
60 | loader: loader
61 | })
62 | }
63 | return output
64 | }
65 |
--------------------------------------------------------------------------------
/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var config = require('../config')
3 | var isProduction = process.env.NODE_ENV === 'production'
4 |
5 | module.exports = {
6 | loaders: utils.cssLoaders({
7 | sourceMap: isProduction
8 | ? config.build.productionSourceMap
9 | : config.dev.cssSourceMap,
10 | // extract: isProduction
11 | }),
12 | postcss: [
13 | require('autoprefixer')({
14 | browsers: ['last 2 versions']
15 | })
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var utils = require('./utils')
3 | var config = require('../config')
4 | var vueLoaderConfig = require('./vue-loader.conf')
5 |
6 | function resolve (dir) {
7 | return path.join(__dirname, '..', dir)
8 | }
9 |
10 | module.exports = {
11 | entry: {
12 | app: './src/main.js'
13 | },
14 | output: {
15 | path: config.build.assetsRoot,
16 | filename: '[name].js',
17 | publicPath: process.env.NODE_ENV === 'production'
18 | ? config.build.assetsPublicPath
19 | : config.dev.assetsPublicPath
20 | },
21 | resolve: {
22 | extensions: ['.js', '.vue', '.json'],
23 | modules: [
24 | resolve('src'),
25 | resolve('node_modules')
26 | ],
27 | alias: {
28 | 'src': resolve('src'),
29 | 'assets': resolve('src/assets'),
30 | 'components': resolve('src/components')
31 | }
32 | },
33 | module: {
34 | rules: [
35 | {
36 | test: /\.(js|vue)$/,
37 | loader: 'eslint-loader',
38 | enforce: "pre",
39 | include: [resolve('src'), resolve('test')],
40 | options: {
41 | formatter: require('eslint-friendly-formatter')
42 | }
43 | },
44 | {
45 | test: /\.vue$/,
46 | loader: 'vue-loader',
47 | options: vueLoaderConfig
48 | },
49 | {
50 | test: /\.pug$/,
51 | loader: 'pug-loader'
52 | },
53 | {
54 | test: /\.js$/,
55 | loader: 'babel-loader',
56 | include: [resolve('src'), resolve('test')]
57 | },
58 | {
59 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
60 | loader: 'url-loader',
61 | query: {
62 | limit: 10000,
63 | name: utils.assetsPath('img/[name].[hash:7].[ext]')
64 | }
65 | },
66 | {
67 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
68 | loader: 'url-loader',
69 | query: {
70 | limit: 10000,
71 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
72 | }
73 | }
74 | ]
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var webpack = require('webpack')
3 | var config = require('../config')
4 | var merge = require('webpack-merge')
5 | var baseWebpackConfig = require('./webpack.base.conf')
6 | var HtmlWebpackPlugin = require('html-webpack-plugin')
7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
8 |
9 | // add hot-reload related code to entry chunks
10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) {
11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
12 | })
13 |
14 | module.exports = merge(baseWebpackConfig, {
15 | module: {
16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
17 | },
18 | // cheap-module-eval-source-map is faster for development
19 | devtool: '#cheap-module-eval-source-map',
20 | plugins: [
21 | new webpack.DefinePlugin({
22 | 'process.env': config.dev.env
23 | }),
24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
25 | new webpack.HotModuleReplacementPlugin(),
26 | new webpack.NoEmitOnErrorsPlugin(),
27 | // https://github.com/ampedandwired/html-webpack-plugin
28 | new HtmlWebpackPlugin({
29 | filename: 'index.html',
30 | template: 'index.html',
31 | inject: true
32 | }),
33 | new FriendlyErrorsPlugin()
34 | ]
35 | })
36 |
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var utils = require('./utils')
3 | var webpack = require('webpack')
4 | var config = require('../config')
5 | var merge = require('webpack-merge')
6 | var baseWebpackConfig = require('./webpack.base.conf')
7 | var HtmlWebpackPlugin = require('html-webpack-plugin')
8 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
9 | var env = config.build.env
10 |
11 | var webpackConfig = merge(baseWebpackConfig, {
12 | devtool: config.build.productionSourceMap ? '#source-map' : false,
13 | output: {
14 | path: config.build.assetsRoot,
15 | library: 'choice-color',
16 | libraryTarget: 'umd',
17 | filename: 'choice-color.js',
18 | },
19 | plugins: [
20 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
21 | new webpack.DefinePlugin({
22 | 'process.env': env
23 | }),
24 | new webpack.optimize.UglifyJsPlugin({
25 | compress: {
26 | warnings: false
27 | },
28 | sourceMap: false
29 | }),
30 | ]
31 | })
32 |
33 | if (config.build.productionGzip) {
34 | var CompressionWebpackPlugin = require('compression-webpack-plugin')
35 |
36 | webpackConfig.plugins.push(
37 | new CompressionWebpackPlugin({
38 | asset: '[path].gz[query]',
39 | algorithm: 'gzip',
40 | test: new RegExp(
41 | '\\.(' +
42 | config.build.productionGzipExtensions.join('|') +
43 | ')$'
44 | ),
45 | threshold: 10240,
46 | minRatio: 0.8
47 | })
48 | )
49 | }
50 |
51 | if (config.build.bundleAnalyzerReport) {
52 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
53 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
54 | }
55 |
56 | module.exports = webpackConfig
57 |
--------------------------------------------------------------------------------
/config/dev.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge')
2 | var prodEnv = require('./prod.env')
3 |
4 | module.exports = merge(prodEnv, {
5 | NODE_ENV: '"development"'
6 | })
7 |
--------------------------------------------------------------------------------
/config/index.js:
--------------------------------------------------------------------------------
1 | // see http://vuejs-templates.github.io/webpack for documentation.
2 | var path = require('path')
3 |
4 | module.exports = {
5 | build: {
6 | env: require('./prod.env'),
7 | index: path.resolve(__dirname, '../dist/index.html'),
8 | assetsRoot: path.resolve(__dirname, '../dist'),
9 | assetsSubDirectory: 'static',
10 | assetsPublicPath: '/vue-circle-choice/',
11 | productionSourceMap: true,
12 | // Gzip off by default as many popular static hosts such as
13 | // Surge or Netlify already gzip all static assets for you.
14 | // Before setting to `true`, make sure to:
15 | // npm install --save-dev compression-webpack-plugin
16 | productionGzip: true,
17 | productionGzipExtensions: ['js', 'css'],
18 | // Run the build command with an extra argument to
19 | // View the bundle analyzer report after build finishes:
20 | // `npm run build --report`
21 | // Set to `true` or `false` to always turn it on or off
22 | bundleAnalyzerReport: process.env.npm_config_report
23 | },
24 | dev: {
25 | env: require('./dev.env'),
26 | port: 8080,
27 | autoOpenBrowser: true,
28 | assetsSubDirectory: 'static',
29 | assetsPublicPath: '/',
30 | proxyTable: {},
31 | // CSS Sourcemaps off by default because relative paths are "buggy"
32 | // with this option, according to the CSS-Loader README
33 | // (https://github.com/webpack/css-loader#sourcemaps)
34 | // In our experience, they generally work as expected,
35 | // just be aware of this issue when enabling this option.
36 | cssSourceMap: false
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | NODE_ENV: '"production"'
3 | }
4 |
--------------------------------------------------------------------------------
/deploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ROOT=`pwd`
4 | PUBLIC=${ROOT}/public
5 | GH_PAGES=gh-pages
6 | DIST_PATH=dist
7 |
8 | function xandeerBuild() {
9 | npm install
10 | npm run build
11 | }
12 |
13 | function xandeerPush() {
14 | cd ${DIST_PATH}
15 | git init
16 | git config --global push.default simple
17 | git config user.name "xandeer"
18 | git config user.email "kkxandeer@gmail.com"
19 | git add --all
20 | git commit -m "update"
21 | git branch ${GH_PAGES}
22 | git checkout ${GH_PAGES}
23 | git remote add origin "https://${GH_TOKEN}@${GH_REF}"
24 | git push -uf origin ${GH_PAGES}
25 | }
26 |
--------------------------------------------------------------------------------
/dist/choice-color.js:
--------------------------------------------------------------------------------
1 | !function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["choice-color"]=t():n["choice-color"]=t()}(this,function(){return function(n){function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e={};return t.m=n,t.c=e,t.i=function(n){return n},t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="/vue-circle-choice/",t(t.s=51)}([function(n,t,e){n.exports=!e(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(n,t){n.exports=function(n){try{return!!n()}catch(n){return!0}}},function(n,t){var e=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(n,t){n.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},function(n,t){var e=n.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},function(n,t){n.exports=function(n){if(void 0==n)throw TypeError("Can't call method on "+n);return n}},function(n,t,e){var r=e(21);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==r(n)?n.split(""):Object(n)}},function(n,t){var e=Math.ceil,r=Math.floor;n.exports=function(n){return isNaN(n=+n)?0:(n>0?r:e)(n)}},function(n,t,e){var r=e(6),o=e(5);n.exports=function(n){return r(o(n))}},function(n,t){n.exports=function(){var n=[];return n.toString=function(){for(var n=[],t=0;te.parts.length&&(r.parts.length=e.parts.length)}else{for(var i=[],o=0;ol;)if(s=c[l++],s!=s)return!0}else for(;u>l;l++)if((n||l in c)&&c[l]===e)return n||l||0;return!n&&-1}}},function(n,t){var e={}.toString;n.exports=function(n){return e.call(n).slice(8,-1)}},function(n,t,e){var r=e(18);n.exports=function(n,t,e){if(r(n),void 0===t)return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,o){return n.call(t,e,r,o)}}return function(){return n.apply(t,arguments)}}},function(n,t,e){var r=e(3),o=e(2).document,i=r(o)&&r(o.createElement);n.exports=function(n){return i?o.createElement(n):{}}},function(n,t){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(n,t,e){var r=e(2),o=e(4),i=e(22),a=e(27),s="prototype",c=function(n,t,e){var u,l,f,A=n&c.F,d=n&c.G,p=n&c.S,v=n&c.P,h=n&c.B,C=n&c.W,b=d?o:o[t]||(o[t]={}),m=b[s],g=d?r:p?r[t]:(r[t]||{})[s];d&&(e=t);for(u in e)l=!A&&g&&void 0!==g[u],l&&u in b||(f=l?g[u]:e[u],b[u]=d&&"function"!=typeof g[u]?e[u]:h&&l?i(f,r):C&&g[u]==f?function(n){var t=function(t,e,r){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(t);case 2:return new n(t,e)}return new n(t,e,r)}return n.apply(this,arguments)};return t[s]=n[s],t}(f):v&&"function"==typeof f?i(Function.call,f):f,v&&((b.virtual||(b.virtual={}))[u]=f,n&c.R&&m&&!m[u]&&a(m,u,f)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,n.exports=c},function(n,t){var e={}.hasOwnProperty;n.exports=function(n,t){return e.call(n,t)}},function(n,t,e){var r=e(30),o=e(35);n.exports=e(0)?function(n,t,e){return r.f(n,t,o(1,e))}:function(n,t,e){return n[t]=e,n}},function(n,t,e){n.exports=!e(0)&&!e(1)(function(){return 7!=Object.defineProperty(e(23)("div"),"a",{get:function(){return 7}}).a})},function(n,t,e){"use strict";var r=e(33),o=e(31),i=e(34),a=e(40),s=e(6),c=Object.assign;n.exports=!c||e(1)(function(){var n={},t={},e=Symbol(),r="abcdefghijklmnopqrst";return n[e]=7,r.split("").forEach(function(n){t[n]=n}),7!=c({},n)[e]||Object.keys(c({},t)).join("")!=r})?function(n,t){for(var e=a(n),c=arguments.length,u=1,l=o.f,f=i.f;c>u;)for(var A,d=s(arguments[u++]),p=l?r(d).concat(l(d)):r(d),v=p.length,h=0;v>h;)f.call(d,A=p[h++])&&(e[A]=d[A]);return e}:c},function(n,t,e){var r=e(19),o=e(28),i=e(41),a=Object.defineProperty;t.f=e(0)?Object.defineProperty:function(n,t,e){if(r(n),t=i(t,!0),r(e),o)try{return a(n,t,e)}catch(n){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(n[t]=e.value),n}},function(n,t){t.f=Object.getOwnPropertySymbols},function(n,t,e){var r=e(26),o=e(8),i=e(20)(!1),a=e(36)("IE_PROTO");n.exports=function(n,t){var e,s=o(n),c=0,u=[];for(e in s)e!=a&&r(s,e)&&u.push(e);for(;t.length>c;)r(s,e=t[c++])&&(~i(u,e)||u.push(e));return u}},function(n,t,e){var r=e(32),o=e(24);n.exports=Object.keys||function(n){return r(n,o)}},function(n,t){t.f={}.propertyIsEnumerable},function(n,t){n.exports=function(n,t){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:t}}},function(n,t,e){var r=e(37)("keys"),o=e(42);n.exports=function(n){return r[n]||(r[n]=o(n))}},function(n,t,e){var r=e(2),o="__core-js_shared__",i=r[o]||(r[o]={});n.exports=function(n){return i[n]||(i[n]={})}},function(n,t,e){var r=e(7),o=Math.max,i=Math.min;n.exports=function(n,t){return n=r(n),n<0?o(n+t,0):i(n,t)}},function(n,t,e){var r=e(7),o=Math.min;n.exports=function(n){return n>0?o(r(n),9007199254740991):0}},function(n,t,e){var r=e(5);n.exports=function(n){return Object(r(n))}},function(n,t,e){var r=e(3);n.exports=function(n,t){if(!r(n))return n;var e,o;if(t&&"function"==typeof(e=n.toString)&&!r(o=e.call(n)))return o;if("function"==typeof(e=n.valueOf)&&!r(o=e.call(n)))return o;if(!t&&"function"==typeof(e=n.toString)&&!r(o=e.call(n)))return o;throw TypeError("Can't convert object to primitive value")}},function(n,t){var e=0,r=Math.random();n.exports=function(n){return"Symbol(".concat(void 0===n?"":n,")_",(++e+r).toString(36))}},function(n,t,e){var r=e(25);r(r.S+r.F,"Object",{assign:e(29)})},function(n,t,e){t=n.exports=e(9)(),t.push([n.i,"\n*[data-v-4a468d22] {\n box-sizing: border-box;\n}\nul[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.theme-container[data-v-4a468d22] {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20em;\n height: 20em;\n}\n.colors-container[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 50%;\n overflow: hidden;\n}\n.colors-container .color-block[data-v-4a468d22] {\n width: 50%;\n height: 50%;\n position: absolute;\n transform-origin: 100% 100%;\n left: 50%;\n top: 50%;\n margin-left: -50%;\n margin-top: -50%;\n -webkit-tap-highlight-color: transparent;\n}\n.faux-border[data-v-4a468d22] {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 50%;\n height: 50%;\n border-radius: 50%;\n padding: 5%;\n background: #fff;\n}\n.chosen-color[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n}\n","",{version:3,sources:["/./src/components/choice-color.vue"],names:[],mappings:";AACA;EACE,uBAAuB;CACxB;AACD;EACE,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,WAAW;EACX,UAAU;CACX;AACD;EACE,mBAAmB;EACnB,UAAU;EACV,SAAS;EACT,iCAAiC;EACjC,YAAY;EACZ,aAAa;CACd;AACD;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;CAClB;AACD;IACI,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,4BAA4B;IAC5B,UAAU;IACV,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,yCAAyC;CAC5C;AACD;EACE,mBAAmB;EACnB,UAAU;EACV,SAAS;EACT,iCAAiC;EACjC,WAAW;EACX,YAAY;EACZ,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;CAClB;AACD;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;CACpB",file:"choice-color.vue",sourcesContent:["\n*[data-v-4a468d22] {\n box-sizing: border-box;\n}\nul[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.theme-container[data-v-4a468d22] {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 20em;\n height: 20em;\n}\n.colors-container[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 50%;\n overflow: hidden;\n}\n.colors-container .color-block[data-v-4a468d22] {\n width: 50%;\n height: 50%;\n position: absolute;\n transform-origin: 100% 100%;\n left: 50%;\n top: 50%;\n margin-left: -50%;\n margin-top: -50%;\n -webkit-tap-highlight-color: transparent;\n}\n.faux-border[data-v-4a468d22] {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 50%;\n height: 50%;\n border-radius: 50%;\n padding: 5%;\n background: #fff;\n}\n.chosen-color[data-v-4a468d22] {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n}\n"],sourceRoot:"webpack://"}])},function(n,t,e){t=n.exports=e(9)(),t.push([n.i,"\n*[data-v-8e0279a6] {\n box-sizing: border-box;\n}\nul[data-v-8e0279a6] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.nav-wrapper[data-v-8e0279a6] {\n position: fixed;\n left: 50%;\n transition: all .3s ease;\n margin: auto;\n overflow: hidden;\n color: #fff;\n background-color: #fff;\n border-radius: 50%;\n z-index: 10;\n}\n.nav-tabbar[data-v-8e0279a6] {\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 50%;\n overflow: hidden;\n}\n.nav-tabbar .nav-item[data-v-8e0279a6] {\n width: 50%;\n height: 50%;\n position: absolute;\n transform-origin: 100% 100%;\n left: 50%;\n top: 50%;\n margin-left: -50%;\n margin-top: -50%;\n -webkit-tap-highlight-color: transparent;\n overflow: hidden;\n border: 1px solid #fff;\n transition: border .3s ease;\n}\n.nav-tabbar .nav-item a[data-v-8e0279a6] {\n display: block;\n position: absolute;\n padding-top: 25%;\n text-decoration: none;\n color: #fff;\n}\n.nav-tabbar .nav-item a .nav-item-label[data-v-8e0279a6] {\n font-size: 0.8em;\n}\n.nav-tabbar .nav-item a .iconfont[data-v-8e0279a6] {\n display: block;\n font-size: 1.4em;\n}\n.nav-toggle[data-v-8e0279a6] {\n font-size: 1em;\n position: fixed;\n bottom: -1.5em;\n left: 50%;\n transform: translateX(-50%);\n width: 3em;\n height: 3em;\n padding-top: 0.3em;\n border-radius: 50%;\n background-color: #fff;\n transition: all .3s ease;\n z-index: 11;\n}\n.nav-overlay[data-v-8e0279a6] {\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n visibility: hidden;\n transition: all .3s ease;\n z-index: 2;\n}\n.nav-overlay.on-overlay[data-v-8e0279a6] {\n visibility: visible;\n opacity: 1;\n}\n","",{version:3,sources:["/./src/components/circular-nav.vue"],names:[],mappings:";AACA;EACE,uBAAuB;CACxB;AACD;EACE,iBAAiB;EACjB,WAAW;EACX,UAAU;CACX;AACD;EACE,gBAAgB;EAChB,UAAU;EACV,yBAAyB;EACzB,aAAa;EACb,iBAAiB;EACjB,YAAY;EACZ,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;CACb;AACD;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,iBAAiB;CAClB;AACD;IACI,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,4BAA4B;IAC5B,UAAU;IACV,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,yCAAyC;IACzC,iBAAiB;IACjB,uBAAuB;IACvB,4BAA4B;CAC/B;AACD;MACM,eAAe;MACf,mBAAmB;MACnB,iBAAiB;MACjB,sBAAsB;MACtB,YAAY;CACjB;AACD;QACQ,iBAAiB;CACxB;AACD;QACQ,eAAe;QACf,iBAAiB;CACxB;AACD;EACE,eAAe;EACf,gBAAgB;EAChB,eAAe;EACf,UAAU;EACV,4BAA4B;EAC5B,WAAW;EACX,YAAY;EACZ,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,yBAAyB;EACzB,YAAY;CACb;AACD;EACE,YAAY;EACZ,aAAa;EACb,qCAAqC;EACrC,gBAAgB;EAChB,OAAO;EACP,QAAQ;EACR,UAAU;EACV,SAAS;EACT,WAAW;EACX,mBAAmB;EACnB,yBAAyB;EACzB,WAAW;CACZ;AACD;IACI,oBAAoB;IACpB,WAAW;CACd",file:"circular-nav.vue",sourcesContent:["\n*[data-v-8e0279a6] {\n box-sizing: border-box;\n}\nul[data-v-8e0279a6] {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.nav-wrapper[data-v-8e0279a6] {\n position: fixed;\n left: 50%;\n transition: all .3s ease;\n margin: auto;\n overflow: hidden;\n color: #fff;\n background-color: #fff;\n border-radius: 50%;\n z-index: 10;\n}\n.nav-tabbar[data-v-8e0279a6] {\n width: 100%;\n height: 100%;\n position: absolute;\n border-radius: 50%;\n overflow: hidden;\n}\n.nav-tabbar .nav-item[data-v-8e0279a6] {\n width: 50%;\n height: 50%;\n position: absolute;\n transform-origin: 100% 100%;\n left: 50%;\n top: 50%;\n margin-left: -50%;\n margin-top: -50%;\n -webkit-tap-highlight-color: transparent;\n overflow: hidden;\n border: 1px solid #fff;\n transition: border .3s ease;\n}\n.nav-tabbar .nav-item a[data-v-8e0279a6] {\n display: block;\n position: absolute;\n padding-top: 25%;\n text-decoration: none;\n color: #fff;\n}\n.nav-tabbar .nav-item a .nav-item-label[data-v-8e0279a6] {\n font-size: 0.8em;\n}\n.nav-tabbar .nav-item a .iconfont[data-v-8e0279a6] {\n display: block;\n font-size: 1.4em;\n}\n.nav-toggle[data-v-8e0279a6] {\n font-size: 1em;\n position: fixed;\n bottom: -1.5em;\n left: 50%;\n transform: translateX(-50%);\n width: 3em;\n height: 3em;\n padding-top: 0.3em;\n border-radius: 50%;\n background-color: #fff;\n transition: all .3s ease;\n z-index: 11;\n}\n.nav-overlay[data-v-8e0279a6] {\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n opacity: 0;\n visibility: hidden;\n transition: all .3s ease;\n z-index: 2;\n}\n.nav-overlay.on-overlay[data-v-8e0279a6] {\n visibility: visible;\n opacity: 1;\n}\n"],sourceRoot:"webpack://"}])},function(n,t){n.exports={render:function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"theme-container",style:n.containerSize},[e("ul",{staticClass:"colors-container"},n._l(n.colors,function(t,r){return e("li",{staticClass:"color-block",style:n.setItem(r),on:{click:function(e){n.setColor(t)}}})})),e("div",{staticClass:"faux-border"},[e("div",{staticClass:"chosen-color",style:n.colorBg})])])},staticRenderFns:[]}},function(n,t){n.exports={render:function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"nav-container"},[e("div",{staticClass:"nav-wrapper",style:[n.containerSize,n.navTransform]},[e("ul",{staticClass:"nav-tabbar"},n._l(n.navs,function(t,r){return e("li",{staticClass:"nav-item",style:n.setItem(r),on:{click:function(t){n.setNav(r)}}},[e("a",{style:n.anchorStyle,attrs:{href:t.href||"javascript:void(0)"}},[t.icon?e("span",{staticClass:"iconfont",class:t.icon}):n._e(),t.label?e("span",{staticClass:"nav-item-label"},[n._v(n._s(t.label))]):n._e()])])}))]),e("div",{staticClass:"nav-toggle",style:n.colorT,on:{click:n.toggle}},[n._v(n._s(n.isOpen?"-":"+"))]),e("div",{staticClass:"nav-overlay",class:n.isOpen?"on-overlay":"",on:{click:n.toggle}})])},staticRenderFns:[]}},function(n,t,e){var r=e(44);"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);e(11)("dba03df0",r,!0)},function(n,t,e){var r=e(45);"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);e(11)("355a0b75",r,!0)},function(n,t){n.exports=function(n,t){for(var e=[],r={},o=0;o
2 |
3 |
4 |
5 |
6 |
7 | vue-circle-choice
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-circle-choice",
3 | "author": "xandeer ",
4 | "description": "A circle color choice with Vue.js",
5 | "version": "0.0.5",
6 | "main": "dist/choice-color",
7 | "files": [
8 | "dist"
9 | ],
10 | "keywords": [
11 | "color",
12 | "circle",
13 | "vue",
14 | "vuejs",
15 | "components",
16 | "ui"
17 | ],
18 | "repository": {
19 | "type": "git",
20 | "url": "https://github.com/xandeer/vue-circle-choice.git"
21 | },
22 | "bugs": "https://github.com/xandeer/vue-circle-choice/issues",
23 | "license": "MIT",
24 | "scripts": {
25 | "dev": "node build/dev-server.js",
26 | "commit": "git cz",
27 | "build": "node build/build.js",
28 | "lint": "eslint --ext .js,.vue src"
29 | },
30 | "dependencies": {
31 | "vue": "^2.1.10"
32 | },
33 | "devDependencies": {
34 | "autoprefixer": "^6.7.2",
35 | "babel-core": "^6.22.1",
36 | "babel-eslint": "^7.1.1",
37 | "babel-loader": "^6.2.10",
38 | "babel-plugin-transform-runtime": "^6.22.0",
39 | "babel-preset-es2015": "^6.22.0",
40 | "babel-preset-stage-2": "^6.22.0",
41 | "babel-register": "^6.22.0",
42 | "chalk": "^1.1.3",
43 | "connect-history-api-fallback": "^1.3.0",
44 | "compression-webpack-plugin": "^0.3.0",
45 | "css-loader": "^0.26.1",
46 | "cz-conventional-changelog": "^1.2.0",
47 | "eslint": "^3.14.1",
48 | "eslint-friendly-formatter": "^2.0.7",
49 | "eslint-loader": "^1.6.1",
50 | "eslint-plugin-html": "^2.0.0",
51 | "eslint-config-airbnb-base": "^11.0.1",
52 | "eslint-import-resolver-webpack": "^0.8.1",
53 | "eslint-plugin-import": "^2.2.0",
54 | "node-sass": "^4.0.0",
55 | "sass-loader": "^4.0.0",
56 | "pug": "^2.0.0-beta10",
57 | "pug-loader": "^2.0.0",
58 | "eventsource-polyfill": "^0.9.6",
59 | "express": "^4.14.1",
60 | "extract-text-webpack-plugin": "^2.0.0-rc.2",
61 | "file-loader": "^0.10.0",
62 | "friendly-errors-webpack-plugin": "^1.1.3",
63 | "function-bind": "^1.1.0",
64 | "html-webpack-plugin": "^2.28.0",
65 | "http-proxy-middleware": "^0.17.3",
66 | "webpack-bundle-analyzer": "^2.2.1",
67 | "semver": "^5.3.0",
68 | "opn": "^4.0.2",
69 | "ora": "^1.1.0",
70 | "shelljs": "^0.7.6",
71 | "url-loader": "^0.5.7",
72 | "vue-loader": "^10.3.0",
73 | "vue-style-loader": "^2.0.0",
74 | "vue-template-compiler": "^2.1.10",
75 | "webpack": "^2.2.1",
76 | "webpack-dev-middleware": "^1.10.0",
77 | "webpack-hot-middleware": "^2.16.1",
78 | "webpack-merge": "^2.6.1"
79 | },
80 | "engines": {
81 | "node": ">= 4.0.0",
82 | "npm": ">= 3.0.0"
83 | },
84 | "config": {
85 | "commitizen": {
86 | "path": "./node_modules/cz-conventional-changelog"
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/components/choice-color.vue:
--------------------------------------------------------------------------------
1 |
2 | .theme-container(:style="containerSize")
3 | ul.colors-container
4 | li.color-block(v-for='(color, index) in colors', :style='setItem(index)', @click='setColor(color)')
5 | .faux-border
6 | .chosen-color(:style='colorBg')
7 |
8 |
9 |
63 |
64 |
115 |
--------------------------------------------------------------------------------
/src/components/circular-nav.vue:
--------------------------------------------------------------------------------
1 |
2 | .nav-container
3 | .nav-wrapper(:style='[containerSize, navTransform]')
4 | ul.nav-tabbar
5 | li.nav-item(v-for='(nav, index) in navs', :style='setItem(index)', @click='setNav(index)')
6 | a(:href='nav.href || "javascript:void(0)"', :style='anchorStyle')
7 | span.iconfont(v-if='nav.icon', :class='nav.icon')
8 | span.nav-item-label(v-if='nav.label') {{nav.label}}
9 | .nav-toggle(:style='colorT', @click='toggle') {{ isOpen ? '-' : '+'}}
10 | .nav-overlay(:class='isOpen ? "on-overlay" : ""', @click='toggle')
11 |
12 |
13 |
89 |
90 |
186 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import choiceColor from './components/choice-color';
2 | import circularNav from './components/circular-nav';
3 |
4 | export default {
5 | choiceColor,
6 | circularNav,
7 | };
8 |
9 | export {
10 | choiceColor,
11 | circularNav,
12 | };
13 |
--------------------------------------------------------------------------------
/src/style/mixin.scss:
--------------------------------------------------------------------------------
1 | @mixin full-size {
2 | width: 100%;
3 | height: 100%;
4 | }
5 |
6 | @mixin half-size {
7 | width: 50%;
8 | height: 50%;
9 | }
10 |
11 | @mixin all-center {
12 | position: absolute;
13 | left: 50%;
14 | top: 50%;
15 | transform: translate(-50%, -50%);
16 | }
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xandeer/vue-circle-choice/a30b8d37846b74526ead8b6974a3c3fd417696a3/static/.gitkeep
--------------------------------------------------------------------------------