├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── README.md ├── 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 └── webpack.test.conf.js ├── config ├── dev.env.js ├── index.js ├── prod.env.js └── test.env.js ├── docs ├── CNAME ├── index.html └── static │ ├── css │ ├── app.f859bd103e45175557e77761a3a6b2c7.css │ └── app.f859bd103e45175557e77761a3a6b2c7.css.map │ ├── img │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── 4.png │ └── 5.png │ └── js │ ├── app.d9e440a5b0fbd85acd9a.js │ ├── app.d9e440a5b0fbd85acd9a.js.map │ ├── manifest.3ce4c2bc6dd7ebbf07c1.js │ ├── manifest.3ce4c2bc6dd7ebbf07c1.js.map │ ├── vendor.ad10f80ccc5ade7b7ca9.js │ └── vendor.ad10f80ccc5ade7b7ca9.js.map ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── components │ ├── Game.vue │ └── game-data.js ├── js │ └── AudioAPI.js └── main.js └── static ├── .gitkeep └── img ├── 1.png ├── 2.png ├── 3.png ├── 4.png └── 5.png /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "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 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 13 | extends: 'standard', 14 | // required to lint *.vue files 15 | plugins: [ 16 | 'html' 17 | ], 18 | // add your custom rules here 19 | 'rules': { 20 | // allow paren-less arrow functions 21 | 'arrow-parens': 0, 22 | // allow async-await 23 | 'generator-star-spacing': 0, 24 | // allow debugger during development 25 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | test/unit/coverage 6 | test/e2e/reports 7 | selenium-debug.log 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # quaver 2 | > Preview [quaver-online-preview](https://8.diamondfsd.com) 3 | > a hot game quaver html5 version 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | var ora = require('ora') 6 | var rm = require('rimraf') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var webpack = require('webpack') 10 | var config = require('../config') 11 | var webpackConfig = require('./webpack.prod.conf') 12 | 13 | var spinner = ora('building for production...') 14 | spinner.start() 15 | 16 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 17 | if (err) throw err 18 | webpack(webpackConfig, function (err, stats) { 19 | spinner.stop() 20 | if (err) throw err 21 | process.stdout.write(stats.toString({ 22 | colors: true, 23 | modules: false, 24 | children: false, 25 | chunks: false, 26 | chunkModules: false 27 | }) + '\n\n') 28 | 29 | console.log(chalk.cyan(' Build complete.\n')) 30 | console.log(chalk.yellow( 31 | ' Tip: built files are meant to be served over an HTTP server.\n' + 32 | ' Opening index.html over file:// won\'t work.\n' 33 | )) 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /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 = process.env.NODE_ENV === 'testing' 14 | ? require('./webpack.prod.conf') 15 | : require('./webpack.dev.conf') 16 | 17 | // default port where dev server listens for incoming traffic 18 | var port = process.env.PORT || config.dev.port 19 | // automatically open browser, if not set will be false 20 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 21 | // Define HTTP proxies to your custom API backend 22 | // https://github.com/chimurai/http-proxy-middleware 23 | var proxyTable = config.dev.proxyTable 24 | 25 | var app = express() 26 | var compiler = webpack(webpackConfig) 27 | 28 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 29 | publicPath: webpackConfig.output.publicPath, 30 | quiet: true 31 | }) 32 | 33 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 34 | log: () => {} 35 | }) 36 | // force page reload when html-webpack-plugin template changes 37 | compiler.plugin('compilation', function (compilation) { 38 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 39 | hotMiddleware.publish({ action: 'reload' }) 40 | cb() 41 | }) 42 | }) 43 | 44 | // proxy api requests 45 | Object.keys(proxyTable).forEach(function (context) { 46 | var options = proxyTable[context] 47 | if (typeof options === 'string') { 48 | options = { target: options } 49 | } 50 | app.use(proxyMiddleware(options.filter || context, options)) 51 | }) 52 | 53 | // handle fallback for HTML5 history API 54 | app.use(require('connect-history-api-fallback')()) 55 | 56 | // serve webpack bundle output 57 | app.use(devMiddleware) 58 | 59 | // enable hot-reload and state-preserving 60 | // compilation error display 61 | app.use(hotMiddleware) 62 | 63 | // serve pure static assets 64 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 65 | app.use(staticPath, express.static('./static')) 66 | 67 | var uri = 'http://localhost:' + port 68 | 69 | devMiddleware.waitUntilValid(function () { 70 | console.log('> Listening at ' + uri + '\n') 71 | }) 72 | 73 | module.exports = app.listen(port, function (err) { 74 | if (err) { 75 | console.log(err) 76 | return 77 | } 78 | 79 | // when env is testing, don't need open it 80 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 81 | opn(uri) 82 | } 83 | }) 84 | -------------------------------------------------------------------------------- /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 | 15 | var cssLoader = { 16 | loader: 'css-loader', 17 | options: { 18 | minimize: process.env.NODE_ENV === 'production', 19 | sourceMap: options.sourceMap 20 | } 21 | } 22 | 23 | // generate loader string to be used with extract text plugin 24 | function generateLoaders (loader, loaderOptions) { 25 | var loaders = [cssLoader] 26 | if (loader) { 27 | loaders.push({ 28 | loader: loader + '-loader', 29 | options: Object.assign({}, loaderOptions, { 30 | sourceMap: options.sourceMap 31 | }) 32 | }) 33 | } 34 | 35 | // Extract CSS when that option is specified 36 | // (which is the case during production build) 37 | if (options.extract) { 38 | return ExtractTextPlugin.extract({ 39 | use: loaders, 40 | fallback: 'vue-style-loader' 41 | }) 42 | } else { 43 | return ['vue-style-loader'].concat(loaders) 44 | } 45 | } 46 | 47 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 48 | return { 49 | css: generateLoaders(), 50 | postcss: generateLoaders(), 51 | less: generateLoaders('less'), 52 | sass: generateLoaders('sass', { indentedSyntax: true }), 53 | scss: generateLoaders('sass'), 54 | stylus: generateLoaders('stylus'), 55 | styl: generateLoaders('stylus') 56 | } 57 | } 58 | 59 | // Generate loaders for standalone style files (outside of .vue) 60 | exports.styleLoaders = function (options) { 61 | var output = [] 62 | var loaders = exports.cssLoaders(options) 63 | for (var extension in loaders) { 64 | var loader = loaders[extension] 65 | output.push({ 66 | test: new RegExp('\\.' + extension + '$'), 67 | use: loader 68 | }) 69 | } 70 | return output 71 | } 72 | -------------------------------------------------------------------------------- /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 | alias: { 24 | 'vue$': 'vue/dist/vue.common.js', 25 | '@': resolve('src'), 26 | } 27 | }, 28 | module: { 29 | rules: [ 30 | { 31 | test: /\.(js|vue)$/, 32 | loader: 'eslint-loader', 33 | enforce: "pre", 34 | include: [resolve('src'), resolve('test')], 35 | options: { 36 | formatter: require('eslint-friendly-formatter') 37 | } 38 | }, 39 | { 40 | test: /\.vue$/, 41 | loader: 'vue-loader', 42 | options: vueLoaderConfig 43 | }, 44 | { 45 | test: /\.js$/, 46 | loader: 'babel-loader', 47 | include: [resolve('src'), resolve('test')] 48 | }, 49 | { 50 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 51 | loader: 'url-loader', 52 | query: { 53 | limit: 10000, 54 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 55 | } 56 | }, 57 | { 58 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 59 | loader: 'url-loader', 60 | query: { 61 | limit: 10000, 62 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 63 | } 64 | } 65 | ] 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /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 CopyWebpackPlugin = require('copy-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 10 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 11 | 12 | var env = process.env.NODE_ENV === 'testing' 13 | ? require('../config/test.env') 14 | : config.build.env 15 | 16 | var webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true 21 | }) 22 | }, 23 | devtool: config.build.productionSourceMap ? '#source-map' : false, 24 | output: { 25 | path: config.build.assetsRoot, 26 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 27 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 28 | }, 29 | plugins: [ 30 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 31 | new webpack.DefinePlugin({ 32 | 'process.env': env 33 | }), 34 | new webpack.optimize.UglifyJsPlugin({ 35 | compress: { 36 | warnings: false 37 | }, 38 | sourceMap: true 39 | }), 40 | // extract css into its own file 41 | new ExtractTextPlugin({ 42 | filename: utils.assetsPath('css/[name].[contenthash].css') 43 | }), 44 | // Compress extracted CSS. We are using this plugin so that possible 45 | // duplicated CSS from different components can be deduped. 46 | new OptimizeCSSPlugin(), 47 | // generate dist index.html with correct asset hash for caching. 48 | // you can customize output by editing /index.html 49 | // see https://github.com/ampedandwired/html-webpack-plugin 50 | new HtmlWebpackPlugin({ 51 | filename: process.env.NODE_ENV === 'testing' 52 | ? 'index.html' 53 | : config.build.index, 54 | template: 'index.html', 55 | inject: true, 56 | minify: { 57 | removeComments: true, 58 | collapseWhitespace: true, 59 | removeAttributeQuotes: true 60 | // more options: 61 | // https://github.com/kangax/html-minifier#options-quick-reference 62 | }, 63 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 64 | chunksSortMode: 'dependency' 65 | }), 66 | // split vendor js into its own file 67 | new webpack.optimize.CommonsChunkPlugin({ 68 | name: 'vendor', 69 | minChunks: function (module, count) { 70 | // any required modules inside node_modules are extracted to vendor 71 | return ( 72 | module.resource && 73 | /\.js$/.test(module.resource) && 74 | module.resource.indexOf( 75 | path.join(__dirname, '../node_modules') 76 | ) === 0 77 | ) 78 | } 79 | }), 80 | // extract webpack runtime and module manifest to its own file in order to 81 | // prevent vendor hash from being updated whenever app bundle is updated 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'manifest', 84 | chunks: ['vendor'] 85 | }), 86 | // copy custom static assets 87 | new CopyWebpackPlugin([ 88 | { 89 | from: path.resolve(__dirname, '../static'), 90 | to: config.build.assetsSubDirectory, 91 | ignore: ['.*'] 92 | } 93 | ]) 94 | ] 95 | }) 96 | 97 | if (config.build.productionGzip) { 98 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 99 | 100 | webpackConfig.plugins.push( 101 | new CompressionWebpackPlugin({ 102 | asset: '[path].gz[query]', 103 | algorithm: 'gzip', 104 | test: new RegExp( 105 | '\\.(' + 106 | config.build.productionGzipExtensions.join('|') + 107 | ')$' 108 | ), 109 | threshold: 10240, 110 | minRatio: 0.8 111 | }) 112 | ) 113 | } 114 | 115 | if (config.build.bundleAnalyzerReport) { 116 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 117 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 118 | } 119 | 120 | module.exports = webpackConfig 121 | -------------------------------------------------------------------------------- /build/webpack.test.conf.js: -------------------------------------------------------------------------------- 1 | // This is the webpack config used for unit tests. 2 | 3 | var utils = require('./utils') 4 | var webpack = require('webpack') 5 | var merge = require('webpack-merge') 6 | var baseConfig = require('./webpack.base.conf') 7 | 8 | var webpackConfig = merge(baseConfig, { 9 | // use inline sourcemap for karma-sourcemap-loader 10 | module: { 11 | rules: utils.styleLoaders() 12 | }, 13 | devtool: '#inline-source-map', 14 | plugins: [ 15 | new webpack.DefinePlugin({ 16 | 'process.env': require('../config/test.env') 17 | }) 18 | ] 19 | }) 20 | 21 | // no need for app entry during tests 22 | delete webpackConfig.entry 23 | 24 | module.exports = webpackConfig 25 | -------------------------------------------------------------------------------- /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, '../docs/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../docs'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 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: false, 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 | -------------------------------------------------------------------------------- /config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | 8.diamondfsd.com -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | quaver
-------------------------------------------------------------------------------- /docs/static/css/app.f859bd103e45175557e77761a3a6b2c7.css: -------------------------------------------------------------------------------- 1 | .fork-me{position:fixed;right:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.fork-me a{background:#000;padding:10px 20px;text-decoration:none;color:#fff}body{margin:0;padding:0;background:#eee}.container{height:100vh}.container,.game-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.game-container{position:relative;width:800px;height:500px;background:#fff;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.btn{cursor:pointer;padding:10px 15px;background:#eee}.stop{bottom:10px;right:10px}.notice,.stop{position:absolute}.notice{top:0;left:0;padding:5px;font-weight:100;width:120px;color:#fff}.block,.notice{background:#000}.block{float:left}.game-main-window{position:absolute;height:100%;left:0;right:0;overflow:hidden}.game-wrapper{position:relative;width:10000%;height:100%;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:end;align-items:flex-end;transform:translate(0)}.game-wrapper,.player{display:-ms-flexbox;display:flex}.player{position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.over-mask{position:absolute;left:0;top:0;background:#000;width:100%;height:100%;opacity:0;transition:all 1s} -------------------------------------------------------------------------------- /docs/static/css/app.f859bd103e45175557e77761a3a6b2c7.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/App.vue","webpack:///./src/components/Game.vue"],"names":[],"mappings":"AACA,SACE,eACA,QACA,MACA,oBACA,aACA,sBACI,mBACJ,qBACI,sBAAwB,CAE9B,WACE,gBACA,kBACA,qBACA,UAAY,CCfd,KACE,SACA,UACA,eAAiB,CAEnB,WACE,YAAc,CAQhB,2BAPE,oBACA,aACA,sBACI,mBACJ,qBACI,sBAAwB,CAgB7B,gBAbC,kBACA,YACA,aACA,gBAOA,0BACI,sBACJ,eAAiB,CAEnB,KACE,eACA,kBACA,eAAiB,CAEnB,MAEE,YACA,UAAY,CAEd,cAJE,iBAAmB,CAapB,QAPC,MACA,OACA,YAEA,gBACA,YACA,UAAY,CAEd,eALE,eAAiB,CAQlB,OADC,UAAY,CAEd,kBACE,kBACA,YACA,OACA,QACA,eAAiB,CAEnB,cACE,kBACA,aACA,YAGA,mBACI,eACJ,mBACI,qBACJ,sBAA2B,CAE7B,sBARE,oBACA,YAAc,CAef,QAPC,kBAGA,sBACI,mBACJ,qBACI,sBAAwB,CAE9B,WACE,kBACA,OACA,MACA,gBACA,WACA,YACA,UACA,iBAAmB","file":"static/css/app.f859bd103e45175557e77761a3a6b2c7.css","sourcesContent":["\n.fork-me {\n position: fixed;\n right: 0;\n top: 0;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.fork-me a {\n background: #000;\n padding: 10px 20px;\n text-decoration: none;\n color: #fff;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/App.vue","\nbody {\n margin: 0;\n padding: 0;\n background: #eee;\n}\n.container {\n height: 100vh;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.game-container {\n position: relative;\n width: 800px;\n height: 500px;\n background: #fff;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-direction: column;\n flex-direction: column;\n overflow: hidden;\n}\n.btn {\n cursor: pointer;\n padding: 10px 15px;\n background: #eee;\n}\n.stop {\n position: absolute;\n bottom: 10px;\n right: 10px;\n}\n.notice {\n position: absolute;\n top: 0;\n left: 0;\n padding: 5px;\n background: #000;\n font-weight: 100;\n width: 120px;\n color: #fff;\n}\n.block {\n background: #000;\n float: left;\n}\n.game-main-window {\n position: absolute;\n height: 100%;\n left: 0;\n right: 0;\n overflow: hidden;\n}\n.game-wrapper {\n position: relative;\n width: 10000%;\n height: 100%;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -ms-flex-align: end;\n align-items: flex-end;\n transform: translate(0, 0);\n}\n.player {\n position: absolute;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.over-mask {\n position: absolute;\n left: 0;\n top: 0;\n background: #000;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: all 1s;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/Game.vue"],"sourceRoot":""} -------------------------------------------------------------------------------- /docs/static/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/docs/static/img/1.png -------------------------------------------------------------------------------- /docs/static/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/docs/static/img/2.png -------------------------------------------------------------------------------- /docs/static/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/docs/static/img/3.png -------------------------------------------------------------------------------- /docs/static/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/docs/static/img/4.png -------------------------------------------------------------------------------- /docs/static/img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/docs/static/img/5.png -------------------------------------------------------------------------------- /docs/static/js/app.d9e440a5b0fbd85acd9a.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([1],{22:function(t,e,i){"use strict";var n=i(44),o=i.n(n),s=window.navigator;s.getUserMedia=s.getUserMedia||s.webkitGetUserMedia||s.mozGetUserMedia||s.msGetUserMedia;var r=window.AudioContext||window.webkitAudioContext,a=!(!s.getUserMedia||!r),c=a&&new r;e.a={isSupport:a,start:function(){return new o.a(function(t,e){s.getUserMedia({audio:!0},function(e){var i=c.createMediaStreamSource(e),n=c.createAnalyser();i.connect(n),n.fftSize=2048,t(n)},function(){e()})})},getVoiceSize:function(t){var e=new Uint8Array(t.frequencyBinCount);return t.getByteFrequencyData(e),e.slice(100,1e3).reduce(function(t,e){return t+e})}}},38:function(t,e,i){i(79);var n=i(37)(i(42),i(85),null,null);t.exports=n.exports},40:function(t,e,i){"use strict";for(var n=[{height:"50%",width:"900px",marginLeft:0}],o=0;o<50;o++){var s=parseInt(1e3*Math.random()),r=10*(s%3+3),a=40*(s%5+2),c=40*(s%2+1.5);n.push({height:r+"%",width:a+"px",marginLeft:(c<70?70:c)+"px"})}e.a=n},41:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(39),o=i.n(n),s=i(38),r=i.n(s);new o.a({el:"#app",template:"",components:{App:r.a}})},42:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(22),o=i(84),s=i.n(o);e.default={name:"app",components:{Game:s.a},data:function(){return{isSupport:n.a.isSupport,timer:"",game:{voice:0}}}}},43:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(22),o=i(40),s=void 0;e.default={data:function(){return{timer:"",isStart:!1,isStop:!1,voiceSize:0,sensitivity:1e3,blocks:o.a,blockPosition:0,currentNodeIndex:0,playerBottom:300,autoDown:!1,jumpTimes:0,showPlayer:!1,imgType:1,startTime:new Date,currentTime:new Date,flushGameTime:"",gameOverOpacity:0}},mounted:function(){var t=this;this.$nextTick(function(e){t.showPlayer=!0,t.$watch("voice",function(e){t.inBlock?t.imgType=e%2+1:t.imgType=e%2+4})})},computed:{voice:function(){return parseInt(this.voiceSize/this.sensitivity)},currentNode:function(){return this.$refs.gameWrapper.childNodes[this.currentNodeIndex]},nodeStartPosition:function(){return this.currentNode.offsetLeft},nodeEndPosition:function(){return this.nodeStartPosition+this.currentNode.offsetWidth},playerEL:function(){return this.$refs.player},playerStartPosition:function(){return this.playerEL.offsetLeft+this.blockPosition},playerEndPosition:function(){return this.playerStartPosition+this.playerEL.clientWidth},currentNodeHeight:function(){return this.currentNode.clientHeight},onBlock:function(){return this.playerStartPositionthis.nodeStartPosition},inBlock:function(){return this.onBlock&&this.playerBottom===this.currentNodeHeight}},watch:{playerBottom:function(t){t<=-50&&this.gameOver()}},methods:{start:function(){var t=this;s?this.gameStart():n.a.start().then(function(e){s=e,t.gameStart()}),this.isStart=!0,this.isStop=!1,this.startTime=new Date,this.flushGameTime=setInterval(function(){t.currentTime=new Date},20),this.$nextTick(function(){t.currentNodeChanged()})},stop:function(){this.isStop=!0,this.stopGetVoiceSize(),this.stopAutoDown(),clearInterval(this.flushGameTime)},gameOver:function(){var t=this;this.gameOverOpacity=1,setTimeout(function(){t.gameOverOpacity=0,t.back()},1200)},back:function(){this.stopGetVoiceSize(),this.stopAutoDown(),this.isStart=!1,this.blockPosition=0,this.currentNodeIndex=0,this.playerBottom=this.$refs.gameWrapper.childNodes[this.currentNodeIndex].clientHeight},gameStart:function(){this.startGetVoiceSize(),this.playerAutoDown()},startGetVoiceSize:function(){var t=this;this.timer=setTimeout(function(){var e=n.a.getVoiceSize(s);t.voiceSize=e,t.voiceChanged(),t.startGetVoiceSize()},5)},currentNodeChanged:function(){this.playerStartPosition>this.nodeEndPosition&&this.currentNodeIndex++,!this.onBlock&&this.playerBottom=this.nodeStartPosition&&this.blockPosition--},stopAutoDown:function(){clearInterval(this.autoDown),this.autoDown=""},playerAutoDown:function(){var t=this;this.autoDown||(this.autoDown=setInterval(function(){t.onBlock&&t.playerBottom<=t.currentNodeHeight?t.playerBottom=t.currentNodeHeight:t.playerBottom-=1},10))},jumpPlayer:function(t){this.stopAutoDown(),this.playerBottom+=t,this.jumpTimes>10?(this.jumpTimes=0,this.playerAutoDown()):this.jumpTimes++},voiceChanged:function(){this.voice>3&&(this.blockPosition++,this.currentNodeChanged(),(this.inBlock&&this.voice>40||this.jumpTimes)&&this.jumpPlayer(parseInt(this.voice/5)))},stopGetVoiceSize:function(){clearTimeout(this.timer)}}}},79:function(t,e){},80:function(t,e){},84:function(t,e,i){i(80);var n=i(37)(i(43),i(86),null,null);t.exports=n.exports},85:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app"},[t._m(0),t.isSupport?i("div",{staticClass:"app-container"},[i("game")],1):i("div",{staticClass:"not-support"},[t._v("暂不支持此浏览器,请用谷歌浏览器打开此链接"),i("a",{attrs:{href:"http://www.google.cn/chrome/browser/desktop/index.html",target:"_blank"}},[t._v("谷歌浏览器下载地址")])])])},staticRenderFns:[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("a",{attrs:{href:"https://github.com/k55k32/quaver",target:"_blank"}},[i("img",{staticStyle:{position:"absolute",top:"0",right:"0",border:"0"},attrs:{src:"https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67",alt:"Fork me on GitHub","data-canonical-src":"https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"}})])}]}},86:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"container"},[i("div",{directives:[{name:"show",rawName:"v-show",value:t.isStart,expression:"isStart"}],staticClass:"game-container"},[i("div",{ref:"player",staticClass:"player",style:{bottom:t.playerBottom+"px"}},[i("img",{attrs:{src:"/static/img/"+t.imgType+".png"}})]),i("div",{staticClass:"game-main-window"},[i("div",{ref:"gameWrapper",staticClass:"game-wrapper",style:{transform:"translate("+-t.blockPosition+"px, 0)"}},t._l(t.blocks,function(t){return i("div",{staticClass:"block",style:t})}))]),i("div",{staticClass:"notice"},[i("div",{staticClass:"time"},[t._v("TIMES: "+t._s((t.currentTime.getTime()-t.startTime.getTime())/1e3))])]),i("div",{staticClass:"stop"},[i("div",{staticClass:"btn",on:{click:t.back}},[t._v("BACK")])]),i("div",{staticClass:"over-mask",style:{opacity:t.gameOverOpacity}})]),i("div",{directives:[{name:"show",rawName:"v-show",value:!t.isStart,expression:"!isStart"}],staticClass:"game-container"},[i("h1",{staticClass:"desc"},[t._v("八分音符 HTML5 版本")]),i("div",{staticClass:"btn",on:{click:t.start}},[t._v("开始游戏")])])])},staticRenderFns:[]}}},[41]); 2 | //# sourceMappingURL=app.d9e440a5b0fbd85acd9a.js.map -------------------------------------------------------------------------------- /docs/static/js/app.d9e440a5b0fbd85acd9a.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///static/js/app.d9e440a5b0fbd85acd9a.js","webpack:///./src/js/AudioAPI.js","webpack:///./src/App.vue?fc6a","webpack:///./src/components/game-data.js","webpack:///./src/main.js","webpack:///App.vue","webpack:///Game.vue","webpack:///./src/components/Game.vue?2ec2","webpack:///./src/App.vue?2677","webpack:///./src/components/Game.vue?e021"],"names":["webpackJsonp","22","module","__webpack_exports__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__","__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default","n","navigator","window","getUserMedia","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","AudioContext","webkitAudioContext","isSupport","context","start","a","resolve","reject","audio","stream","source","createMediaStreamSource","analyser","createAnalyser","connect","fftSize","getVoiceSize","dataArray","Uint8Array","frequencyBinCount","getByteFrequencyData","slice","reduce","b","38","exports","Component","40","height","width","marginLeft","i","random","parseInt","Math","push","41","Object","defineProperty","value","__WEBPACK_IMPORTED_MODULE_0_vue__","__WEBPACK_IMPORTED_MODULE_0_vue___default","__WEBPACK_IMPORTED_MODULE_1__App__","__WEBPACK_IMPORTED_MODULE_1__App___default","el","template","components","App","42","__WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__","__WEBPACK_IMPORTED_MODULE_1__components_Game__","__WEBPACK_IMPORTED_MODULE_1__components_Game___default","name","Game","data","timer","game","voice","43","__WEBPACK_IMPORTED_MODULE_1__game_data__","isStart","isStop","voiceSize","sensitivity","blocks","blockPosition","currentNodeIndex","playerBottom","autoDown","jumpTimes","showPlayer","imgType","startTime","Date","currentTime","flushGameTime","gameOverOpacity","mounted","_this","this","$nextTick","_","$watch","val","inBlock","computed","currentNode","$refs","gameWrapper","childNodes","nodeStartPosition","offsetLeft","nodeEndPosition","offsetWidth","playerEL","player","playerStartPosition","playerEndPosition","clientWidth","currentNodeHeight","clientHeight","onBlock","watch","gameOver","methods","_this2","gameStart","then","setInterval","currentNodeChanged","stop","stopGetVoiceSize","stopAutoDown","clearInterval","_this3","setTimeout","back","startGetVoiceSize","playerAutoDown","_this4","voiceChanged","_this5","jumpPlayer","clearTimeout","79","80","84","85","render","_vm","_h","$createElement","_c","_self","staticClass","_m","_v","attrs","href","target","staticRenderFns","staticStyle","position","top","right","border","src","alt","data-canonical-src","86","directives","rawName","expression","ref","style","bottom","transform","_l","_s","getTime","on","click","opacity"],"mappings":"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","file":"static/js/app.d9e440a5b0fbd85acd9a.js","sourcesContent":["webpackJsonp([1],{\n\n/***/ 22:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__ = __webpack_require__(44);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise__);\n\nvar navigator = window.navigator;\nnavigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;\nvar AudioContext = window.AudioContext || window.webkitAudioContext;\n\nvar isSupport = !!(navigator.getUserMedia && AudioContext);\nvar context = isSupport && new AudioContext();\n/* harmony default export */ __webpack_exports__[\"a\"] = ({\n isSupport: isSupport,\n start: function start() {\n return new __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_promise___default.a(function (resolve, reject) {\n navigator.getUserMedia({ audio: true }, function (stream) {\n var source = context.createMediaStreamSource(stream);\n var analyser = context.createAnalyser();\n source.connect(analyser);\n analyser.fftSize = 2048;\n resolve(analyser);\n }, function () {\n reject();\n });\n });\n },\n getVoiceSize: function getVoiceSize(analyser) {\n var dataArray = new Uint8Array(analyser.frequencyBinCount);\n analyser.getByteFrequencyData(dataArray);\n var data = dataArray.slice(100, 1000);\n var sum = data.reduce(function (a, b) {\n return a + b;\n });\n return sum;\n }\n});\n\n/***/ }),\n\n/***/ 38:\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(79)\n\nvar Component = __webpack_require__(37)(\n /* script */\n __webpack_require__(42),\n /* template */\n __webpack_require__(85),\n /* scopeId */\n null,\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n\n/***/ 40:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar dataArray = [{\n height: '50%',\n width: '900px',\n marginLeft: 0\n}];\nfor (var i = 0; i < 50; i++) {\n var random = parseInt(Math.random() * 1000);\n var height = (random % 3 + 3) * 10;\n var width = (random % 5 + 2) * 40;\n var marginLeft = (random % 2 + 1.5) * 40;\n dataArray.push({\n height: height + '%',\n width: width + 'px',\n marginLeft: (marginLeft < 70 ? 70 : marginLeft) + 'px'\n });\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (dataArray);\n\n/***/ }),\n\n/***/ 41:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(39);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App__ = __webpack_require__(38);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__App__);\n\n\n\n\nnew __WEBPACK_IMPORTED_MODULE_0_vue___default.a({\n el: '#app',\n template: '',\n components: { App: __WEBPACK_IMPORTED_MODULE_1__App___default.a }\n});\n\n/***/ }),\n\n/***/ 42:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__ = __webpack_require__(22);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_Game__ = __webpack_require__(84);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_Game___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__components_Game__);\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'app',\n components: { Game: __WEBPACK_IMPORTED_MODULE_1__components_Game___default.a },\n data: function data() {\n return {\n isSupport: __WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__[\"a\" /* default */].isSupport,\n timer: '',\n game: {\n voice: 0\n }\n };\n }\n});\n\n/***/ }),\n\n/***/ 43:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__ = __webpack_require__(22);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__game_data__ = __webpack_require__(40);\n\n\n\n\nvar analyser = void 0;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n data: function data() {\n return {\n timer: '',\n isStart: false,\n isStop: false,\n voiceSize: 0,\n sensitivity: 1000,\n blocks: __WEBPACK_IMPORTED_MODULE_1__game_data__[\"a\" /* default */],\n blockPosition: 0,\n currentNodeIndex: 0,\n playerBottom: 300,\n autoDown: false,\n jumpTimes: 0,\n showPlayer: false,\n imgType: 1,\n startTime: new Date(),\n currentTime: new Date(),\n flushGameTime: '',\n gameOverOpacity: 0\n };\n },\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick(function (_) {\n _this.showPlayer = true;\n _this.$watch('voice', function (val) {\n if (_this.inBlock) {\n _this.imgType = val % 2 + 1;\n } else {\n _this.imgType = val % 2 + 4;\n }\n });\n });\n },\n\n computed: {\n voice: function voice() {\n return parseInt(this.voiceSize / this.sensitivity);\n },\n currentNode: function currentNode() {\n return this.$refs.gameWrapper.childNodes[this.currentNodeIndex];\n },\n nodeStartPosition: function nodeStartPosition() {\n return this.currentNode.offsetLeft;\n },\n nodeEndPosition: function nodeEndPosition() {\n return this.nodeStartPosition + this.currentNode.offsetWidth;\n },\n playerEL: function playerEL() {\n return this.$refs.player;\n },\n playerStartPosition: function playerStartPosition() {\n return this.playerEL.offsetLeft + this.blockPosition;\n },\n playerEndPosition: function playerEndPosition() {\n return this.playerStartPosition + this.playerEL.clientWidth;\n },\n currentNodeHeight: function currentNodeHeight() {\n return this.currentNode.clientHeight;\n },\n onBlock: function onBlock() {\n if (this.playerStartPosition < this.nodeEndPosition && this.playerEndPosition > this.nodeStartPosition) {\n return true;\n }\n return false;\n },\n inBlock: function inBlock() {\n return this.onBlock && this.playerBottom === this.currentNodeHeight;\n }\n },\n watch: {\n playerBottom: function playerBottom(val) {\n if (val <= -50) {\n this.gameOver();\n }\n }\n },\n methods: {\n start: function start() {\n var _this2 = this;\n\n if (!analyser) {\n __WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__[\"a\" /* default */].start().then(function (a) {\n analyser = a;\n _this2.gameStart();\n });\n } else {\n this.gameStart();\n }\n this.isStart = true;\n this.isStop = false;\n this.startTime = new Date();\n this.flushGameTime = setInterval(function () {\n _this2.currentTime = new Date();\n }, 20);\n this.$nextTick(function () {\n _this2.currentNodeChanged();\n });\n },\n stop: function stop() {\n this.isStop = true;\n this.stopGetVoiceSize();\n this.stopAutoDown();\n clearInterval(this.flushGameTime);\n },\n gameOver: function gameOver() {\n var _this3 = this;\n\n this.gameOverOpacity = 1;\n setTimeout(function () {\n _this3.gameOverOpacity = 0;\n _this3.back();\n }, 1200);\n },\n back: function back() {\n this.stopGetVoiceSize();\n this.stopAutoDown();\n this.isStart = false;\n this.blockPosition = 0;\n this.currentNodeIndex = 0;\n this.playerBottom = this.$refs.gameWrapper.childNodes[this.currentNodeIndex].clientHeight;\n },\n gameStart: function gameStart() {\n this.startGetVoiceSize();\n this.playerAutoDown();\n },\n startGetVoiceSize: function startGetVoiceSize() {\n var _this4 = this;\n\n this.timer = setTimeout(function () {\n var voiceSize = __WEBPACK_IMPORTED_MODULE_0__js_AudioAPI__[\"a\" /* default */].getVoiceSize(analyser);\n _this4.voiceSize = voiceSize;\n _this4.voiceChanged();\n _this4.startGetVoiceSize();\n }, 5);\n },\n currentNodeChanged: function currentNodeChanged() {\n if (this.playerStartPosition > this.nodeEndPosition) {\n this.currentNodeIndex++;\n }\n if (!this.onBlock && this.playerBottom < this.currentNodeHeight && this.playerEndPosition >= this.nodeStartPosition) {\n this.blockPosition--;\n }\n },\n stopAutoDown: function stopAutoDown() {\n clearInterval(this.autoDown);\n this.autoDown = '';\n },\n playerAutoDown: function playerAutoDown() {\n var _this5 = this;\n\n if (!this.autoDown) {\n this.autoDown = setInterval(function () {\n if (_this5.onBlock && _this5.playerBottom <= _this5.currentNodeHeight) {\n _this5.playerBottom = _this5.currentNodeHeight;\n } else {\n _this5.playerBottom -= 1;\n }\n }, 10);\n }\n },\n jumpPlayer: function jumpPlayer(height) {\n this.stopAutoDown();\n this.playerBottom += height;\n if (this.jumpTimes > 10) {\n this.jumpTimes = 0;\n this.playerAutoDown();\n } else {\n this.jumpTimes++;\n }\n },\n voiceChanged: function voiceChanged() {\n if (this.voice > 3) {\n this.blockPosition++;\n this.currentNodeChanged();\n if (this.inBlock && this.voice > 40 || this.jumpTimes) {\n this.jumpPlayer(parseInt(this.voice / 5));\n }\n }\n },\n stopGetVoiceSize: function stopGetVoiceSize() {\n clearTimeout(this.timer);\n }\n }\n});\n\n/***/ }),\n\n/***/ 79:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 80:\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n\n/***/ 84:\n/***/ (function(module, exports, __webpack_require__) {\n\n\n/* styles */\n__webpack_require__(80)\n\nvar Component = __webpack_require__(37)(\n /* script */\n __webpack_require__(43),\n /* template */\n __webpack_require__(86),\n /* scopeId */\n null,\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n/***/ }),\n\n/***/ 85:\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"app\"\n }, [_vm._m(0), (_vm.isSupport) ? _c('div', {\n staticClass: \"app-container\"\n }, [_c('game')], 1) : _c('div', {\n staticClass: \"not-support\"\n }, [_vm._v(\"暂不支持此浏览器,请用谷歌浏览器打开此链接\"), _c('a', {\n attrs: {\n \"href\": \"http://www.google.cn/chrome/browser/desktop/index.html\",\n \"target\": \"_blank\"\n }\n }, [_vm._v(\"谷歌浏览器下载地址\")])])])\n},staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('a', {\n attrs: {\n \"href\": \"https://github.com/k55k32/quaver\",\n \"target\": \"_blank\"\n }\n }, [_c('img', {\n staticStyle: {\n \"position\": \"absolute\",\n \"top\": \"0\",\n \"right\": \"0\",\n \"border\": \"0\"\n },\n attrs: {\n \"src\": \"https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67\",\n \"alt\": \"Fork me on GitHub\",\n \"data-canonical-src\": \"https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png\"\n }\n })])\n}]}\n\n/***/ }),\n\n/***/ 86:\n/***/ (function(module, exports) {\n\nmodule.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"container\"\n }, [_c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (_vm.isStart),\n expression: \"isStart\"\n }],\n staticClass: \"game-container\"\n }, [_c('div', {\n ref: \"player\",\n staticClass: \"player\",\n style: ({\n bottom: (_vm.playerBottom + \"px\")\n })\n }, [_c('img', {\n attrs: {\n \"src\": (\"/static/img/\" + _vm.imgType + \".png\")\n }\n })]), _c('div', {\n staticClass: \"game-main-window\"\n }, [_c('div', {\n ref: \"gameWrapper\",\n staticClass: \"game-wrapper\",\n style: ({\n transform: (\"translate(\" + (-_vm.blockPosition) + \"px, 0)\")\n })\n }, _vm._l((_vm.blocks), function(b) {\n return _c('div', {\n staticClass: \"block\",\n style: (b)\n })\n }))]), _c('div', {\n staticClass: \"notice\"\n }, [_c('div', {\n staticClass: \"time\"\n }, [_vm._v(\"TIMES: \" + _vm._s((_vm.currentTime.getTime() - _vm.startTime.getTime()) / 1000))])]), _c('div', {\n staticClass: \"stop\"\n }, [_c('div', {\n staticClass: \"btn\",\n on: {\n \"click\": _vm.back\n }\n }, [_vm._v(\"BACK\")])]), _c('div', {\n staticClass: \"over-mask\",\n style: ({\n opacity: _vm.gameOverOpacity\n })\n })]), _c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (!_vm.isStart),\n expression: \"!isStart\"\n }],\n staticClass: \"game-container\"\n }, [_c('h1', {\n staticClass: \"desc\"\n }, [_vm._v(\"八分音符 HTML5 版本\")]), _c('div', {\n staticClass: \"btn\",\n on: {\n \"click\": _vm.start\n }\n }, [_vm._v(\"开始游戏\")])])])\n},staticRenderFns: []}\n\n/***/ })\n\n},[41]);\n\n\n// WEBPACK FOOTER //\n// static/js/app.d9e440a5b0fbd85acd9a.js","const navigator = window.navigator\r\nnavigator.getUserMedia = navigator.getUserMedia ||\r\n navigator.webkitGetUserMedia ||\r\n navigator.mozGetUserMedia ||\r\n navigator.msGetUserMedia\r\nconst AudioContext = window.AudioContext ||\r\n window.webkitAudioContext\r\n\r\nconst isSupport = !!(navigator.getUserMedia && AudioContext)\r\nconst context = isSupport && new AudioContext()\r\nexport default {\r\n isSupport,\r\n start () {\r\n // https://developer.mozilla.org/zh-CN/docs/Web/API/AudioContext AudioContent API\r\n return new Promise((resolve, reject) => {\r\n navigator.getUserMedia({audio: true}, stream => {\r\n const source = context.createMediaStreamSource(stream)\r\n const analyser = context.createAnalyser()\r\n source.connect(analyser)\r\n analyser.fftSize = 2048\r\n resolve(analyser)\r\n }, () => {\r\n reject()\r\n })\r\n })\r\n },\r\n getVoiceSize (analyser) {\r\n const dataArray = new Uint8Array(analyser.frequencyBinCount)\r\n analyser.getByteFrequencyData(dataArray)\r\n const data = dataArray.slice(100, 1000)\r\n const sum = data.reduce((a, b) => a + b)\r\n return sum\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/AudioAPI.js","\n/* styles */\nrequire(\"!!../node_modules/extract-text-webpack-plugin/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/style-compiler/index?{\\\"id\\\":\\\"data-v-0ced7c9b\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":true}!less-loader?{\\\"sourceMap\\\":true}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./App.vue\")\n\nvar Component = require(\"!../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"),\n /* template */\n require(\"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-0ced7c9b\\\"}!../node_modules/vue-loader/lib/template-compiler/preprocessor?raw&engine=pug!../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"),\n /* scopeId */\n null,\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/App.vue\n// module id = 38\n// module chunks = 1","const dataArray = [{\r\n height: '50%',\r\n width: '900px',\r\n marginLeft: 0\r\n}]\r\nfor (let i = 0; i < 50; i++) {\r\n const random = parseInt(Math.random() * 1000)\r\n const height = (random % 3 + 3) * 10\r\n const width = (random % 5 + 2) * 40\r\n const marginLeft = (random % 2 + 1.5) * 40\r\n dataArray.push({\r\n height: `${height}%`,\r\n width: `${width}px`,\r\n marginLeft: `${marginLeft < 70 ? 70 : marginLeft}px`\r\n })\r\n}\r\nexport default dataArray\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/game-data.js","// The Vue build version to load with the `import` command\r\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\r\nimport Vue from 'vue'\r\nimport App from './App'\r\n\r\n/* eslint-disable no-new */\r\nnew Vue({\r\n el: '#app',\r\n template: '',\r\n components: { App }\r\n})\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","\r\n\r\n\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// App.vue?0fd25ff1","\r\n\r\n\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// Game.vue?3d7a412e","\n/* styles */\nrequire(\"!!../../node_modules/extract-text-webpack-plugin/loader.js?{\\\"omit\\\":1,\\\"remove\\\":true}!vue-style-loader!css-loader?{\\\"minimize\\\":true,\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/style-compiler/index?{\\\"id\\\":\\\"data-v-675f0e05\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":true}!less-loader?{\\\"sourceMap\\\":true}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./Game.vue\")\n\nvar Component = require(\"!../../node_modules/vue-loader/lib/component-normalizer\")(\n /* script */\n require(\"!!babel-loader!../../node_modules/vue-loader/lib/selector?type=script&index=0!./Game.vue\"),\n /* template */\n require(\"!!../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-675f0e05\\\"}!../../node_modules/vue-loader/lib/template-compiler/preprocessor?raw&engine=pug!../../node_modules/vue-loader/lib/selector?type=template&index=0!./Game.vue\"),\n /* scopeId */\n null,\n /* cssModules */\n null\n)\n\nmodule.exports = Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/Game.vue\n// module id = 84\n// module chunks = 1","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"app\"\n }, [_vm._m(0), (_vm.isSupport) ? _c('div', {\n staticClass: \"app-container\"\n }, [_c('game')], 1) : _c('div', {\n staticClass: \"not-support\"\n }, [_vm._v(\"暂不支持此浏览器,请用谷歌浏览器打开此链接\"), _c('a', {\n attrs: {\n \"href\": \"http://www.google.cn/chrome/browser/desktop/index.html\",\n \"target\": \"_blank\"\n }\n }, [_vm._v(\"谷歌浏览器下载地址\")])])])\n},staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('a', {\n attrs: {\n \"href\": \"https://github.com/k55k32/quaver\",\n \"target\": \"_blank\"\n }\n }, [_c('img', {\n staticStyle: {\n \"position\": \"absolute\",\n \"top\": \"0\",\n \"right\": \"0\",\n \"border\": \"0\"\n },\n attrs: {\n \"src\": \"https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67\",\n \"alt\": \"Fork me on GitHub\",\n \"data-canonical-src\": \"https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png\"\n }\n })])\n}]}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-0ced7c9b\"}!./~/vue-loader/lib/template-compiler/preprocessor.js?raw&engine=pug!./~/vue-loader/lib/selector.js?type=template&index=0!./src/App.vue\n// module id = 85\n// module chunks = 1","module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;\n return _c('div', {\n staticClass: \"container\"\n }, [_c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (_vm.isStart),\n expression: \"isStart\"\n }],\n staticClass: \"game-container\"\n }, [_c('div', {\n ref: \"player\",\n staticClass: \"player\",\n style: ({\n bottom: (_vm.playerBottom + \"px\")\n })\n }, [_c('img', {\n attrs: {\n \"src\": (\"/static/img/\" + _vm.imgType + \".png\")\n }\n })]), _c('div', {\n staticClass: \"game-main-window\"\n }, [_c('div', {\n ref: \"gameWrapper\",\n staticClass: \"game-wrapper\",\n style: ({\n transform: (\"translate(\" + (-_vm.blockPosition) + \"px, 0)\")\n })\n }, _vm._l((_vm.blocks), function(b) {\n return _c('div', {\n staticClass: \"block\",\n style: (b)\n })\n }))]), _c('div', {\n staticClass: \"notice\"\n }, [_c('div', {\n staticClass: \"time\"\n }, [_vm._v(\"TIMES: \" + _vm._s((_vm.currentTime.getTime() - _vm.startTime.getTime()) / 1000))])]), _c('div', {\n staticClass: \"stop\"\n }, [_c('div', {\n staticClass: \"btn\",\n on: {\n \"click\": _vm.back\n }\n }, [_vm._v(\"BACK\")])]), _c('div', {\n staticClass: \"over-mask\",\n style: ({\n opacity: _vm.gameOverOpacity\n })\n })]), _c('div', {\n directives: [{\n name: \"show\",\n rawName: \"v-show\",\n value: (!_vm.isStart),\n expression: \"!isStart\"\n }],\n staticClass: \"game-container\"\n }, [_c('h1', {\n staticClass: \"desc\"\n }, [_vm._v(\"八分音符 HTML5 版本\")]), _c('div', {\n staticClass: \"btn\",\n on: {\n \"click\": _vm.start\n }\n }, [_vm._v(\"开始游戏\")])])])\n},staticRenderFns: []}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vue-loader/lib/template-compiler?{\"id\":\"data-v-675f0e05\"}!./~/vue-loader/lib/template-compiler/preprocessor.js?raw&engine=pug!./~/vue-loader/lib/selector.js?type=template&index=0!./src/components/Game.vue\n// module id = 86\n// module chunks = 1"],"sourceRoot":""} -------------------------------------------------------------------------------- /docs/static/js/manifest.3ce4c2bc6dd7ebbf07c1.js: -------------------------------------------------------------------------------- 1 | !function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,a){for(var i,u,f,s=0,l=[];s0?r:n)(t)}},function(t,e,n){var r=n(52),i=n(14);t.exports=function(t){return r(i(t))}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,function(t,e,n){var r=n(9),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r=n(28),i=n(11),o=n(65),a=n(4),s=n(12),c=n(7),u=n(55),f=n(17),l=n(61),p=n(1)("iterator"),d=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,e,n,h,m,y,g){u(n,e,h);var _,b,w,x=function(t){if(!d&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},$=e+" Iterator",C="values"==m,k=!1,A=t.prototype,O=A[p]||A["@@iterator"]||m&&A[m],T=!d&&O||x(m),S=m?C?x("entries"):T:void 0,E="Array"==e?A.entries||O:O;if(E&&(w=l(E.call(new t)))!==Object.prototype&&w.next&&(f(w,$,!0),r||s(w,p)||a(w,p,v)),C&&O&&"values"!==O.name&&(k=!0,T=function(){return O.call(this)}),r&&!g||!d&&!k&&A[p]||a(A,p,T),c[e]=T,c[$]=v,m)if(_={values:C?T:x("values"),keys:y?T:x("keys"),entries:S},g)for(b in _)b in A||o(A,b,_[b]);else i(i.P+i.F*(d||k),e,_);return _}},function(t,e){t.exports=!0},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(2),i=n(6),o=n(16);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(0),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(2),i=n(8),o=n(1)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[o])?e:i(n)}},function(t,e,n){var r,i,o,a=n(10),s=n(51),c=n(26),u=n(15),f=n(0),l=f.process,p=f.setImmediate,d=f.clearImmediate,v=f.MessageChannel,h=f.Dispatch,m=0,y={},g=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},_=function(t){g.call(t.data)};p&&d||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){s("function"==typeof t?t:Function(t),e)},r(m),m},d=function(t){delete y[t]},"process"==n(9)(l)?r=function(t){l.nextTick(a(g,t,1))}:h&&h.now?r=function(t){h.now(a(g,t,1))}:v?(i=new v,o=i.port2,i.port1.onmessage=_,r=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",_,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:p,clear:d}},function(t,e,n){var r=n(19),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t,e,n,r){var i,o=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,o=t.default);var s="function"==typeof o?o.options:o;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n),r){var c=Object.create(s.computed||null);Object.keys(r).forEach(function(t){var e=r[t];c[t]=function(){return e}}),s.computed=c}return{esModule:i,exports:o,options:s}}},,function(t,e,n){"use strict";(function(e,n){function r(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function a(t){return!1===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function c(t){return null!==t&&"object"==typeof t}function u(t){return"[object Object]"===no.call(t)}function f(t){return"[object RegExp]"===no.call(t)}function l(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function p(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function d(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function m(t,e){return oo.call(t,e)}function y(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function g(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function _(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function b(t,e){for(var n in e)t[n]=e[n];return t}function w(t){for(var e={},n=0;n0&&(a=yt(a,(e||"")+"_"+n),mt(a[0])&&mt(u)&&(f[c]=L(u.text+a[0].text),a.shift()),f.push.apply(f,a)):s(a)?mt(u)?f[c]=L(u.text+a):""!==a&&f.push(L(a)):mt(a)&&mt(u)?f[c]=L(u.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),f.push(a)));return f}function gt(t,e){return(t.__esModule||No&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function _t(t,e,n,r,i){var o=Vo();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function bt(t,e,n){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;if(o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(!i(t.contexts)){var a=t.contexts=[n],s=!0,u=function(){for(var t=0,e=a.length;tva&&ua[n].id>t.id;)n--;ua.splice(n+1,0,t)}else ua.push(t);pa||(pa=!0,at(Ft))}}function Vt(t,e,n){ya.get=function(){return this[e][n]},ya.set=function(t){this[e][n]=t},Object.defineProperty(t,n,ya)}function zt(t){t._watchers=[];var e=t.$options;e.props&&Kt(t,e.props),e.methods&&Xt(t,e.methods),e.data?Wt(t):D(t._data={},!0),e.computed&&Jt(t,e.computed),e.watch&&e.watch!==So&&Yt(t,e.watch)}function Kt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;Go.shouldConvert=o;for(var a in e)!function(o){i.push(o);var a=X(o,e,n,t);F(r,o,a),o in t||Vt(t,"_props",o)}(a);Go.shouldConvert=!0}function Wt(t){var e=t.$options.data;e=t._data="function"==typeof e?Gt(e,t):e||{},u(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);i--;){var o=n[i];r&&m(r,o)||A(o)||Vt(t,"_data",o)}D(e,!0)}function Gt(t,e){try{return t.call(e,e)}catch(t){return et(t,e,"data()"),{}}}function Jt(t,e){var n=t._computedWatchers=Object.create(null),r=Mo();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new ma(t,a||x,x,ga)),i in t||qt(t,i,o)}}function qt(t,e,n){var r=!Mo();"function"==typeof n?(ya.get=r?Zt(e):n,ya.set=x):(ya.get=n.get?r&&!1!==n.cache?Zt(e):n.get:x,ya.set=n.set?n.set:x),Object.defineProperty(t,e,ya)}function Zt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Ro.target&&e.depend(),e.value}}function Xt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?x:g(e[n],t)}function Yt(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function Ee(t){this._init(t)}function je(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=_(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}function Le(t){t.mixin=function(t){return this.options=q(this.options,t),this}}function Ie(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=q(n.options,t),a.super=n,a.options.props&&Me(a),a.options.computed&&Pe(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,ho.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=b({},a.options),i[r]=a,a}}function Me(t){var e=t.options.props;for(var n in e)Vt(t.prototype,"_props",n)}function Pe(t){var e=t.options.computed;for(var n in e)qt(t.prototype,n,e[n])}function Ne(t){ho.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function De(t){return t&&(t.Ctor.options.name||t.tag)}function Fe(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Re(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=De(a.componentOptions);s&&!e(s)&&He(n,o,r,i)}}}function He(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,h(n,e)}function Be(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Ue(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Ue(e,n.data));return Ve(e.staticClass,e.class)}function Ue(t,e){return{staticClass:ze(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Ve(t,e){return i(t)||i(e)?ze(t,Ke(e)):""}function ze(t,e){return t?e?t+" "+e:t:e||""}function Ke(t){return Array.isArray(t)?We(t):c(t)?Ge(t):"string"==typeof t?t:""}function We(t){for(var e,n="",r=0,o=t.length;r-1?Za[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Za[t]=/HTMLUnknownElement/.test(e.toString())}function Ze(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function Xe(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Ye(t,e){return document.createElementNS(Ka[t],e)}function Qe(t){return document.createTextNode(t)}function tn(t){return document.createComment(t)}function en(t,e,n){t.insertBefore(e,n)}function nn(t,e){t.removeChild(e)}function rn(t,e){t.appendChild(e)}function on(t){return t.parentNode}function an(t){return t.nextSibling}function sn(t){return t.tagName}function cn(t,e){t.textContent=e}function un(t,e,n){t.setAttribute(e,n)}function fn(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.componentInstance||t.elm,o=r.$refs;e?Array.isArray(o[n])?h(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}function ln(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&pn(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function pn(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||Xa(r)&&Xa(o)}function dn(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function vn(t,e){(t.data.directives||e.data.directives)&&hn(t,e)}function hn(t,e){var n,r,i,o=t===ts,a=e===ts,s=mn(t.data.directives,t.context),c=mn(e.data.directives,e.context),u=[],f=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,gn(i,"update",e,t),i.def&&i.def.componentUpdated&&f.push(i)):(gn(i,"bind",e,t),i.def&&i.def.inserted&&u.push(i));if(u.length){var l=function(){for(var n=0;n=0&&" "===(m=t.charAt(h));h--);m&&ss.test(m)||(f=!0)}}else void 0===o?(v=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==v&&e(),a)for(i=0;i-1?{exp:t.slice(0,Ea),key:'"'+t.slice(Ea+1)+'"'}:{exp:t,key:null};for(Ta=t,Ea=ja=La=0;!Dn();)Sa=Nn(),Fn(Sa)?Hn(Sa):91===Sa&&Rn(Sa);return{exp:t.slice(0,ja),key:t.slice(ja+1,La)}}function Nn(){return Ta.charCodeAt(++Ea)}function Dn(){return Ea>=Oa}function Fn(t){return 34===t||39===t}function Rn(t){var e=1;for(ja=Ea;!Dn();)if(t=Nn(),Fn(t))Hn(t);else if(91===t&&e++,93===t&&e--,0===e){La=Ea;break}}function Hn(t){for(var e=t;!Dn()&&(t=Nn())!==e;);}function Bn(t,e,n){Ia=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type;if(t.component)return In(t,r,i),!1;if("select"===o)zn(t,r,i);else if("input"===o&&"checkbox"===a)Un(t,r,i);else if("input"===o&&"radio"===a)Vn(t,r,i);else if("input"===o||"textarea"===o)Kn(t,r,i);else if(!yo.isReservedTag(o))return In(t,r,i),!1;return!0}function Un(t,e,n){var r=n&&n.number,i=jn(t,"value")||"null",o=jn(t,"true-value")||"true",a=jn(t,"false-value")||"false";An(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),En(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+e+"=$$a.concat([$$v]))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+Mn(e,"$$c")+"}",null,!0)}function Vn(t,e,n){var r=n&&n.number,i=jn(t,"value")||"null";i=r?"_n("+i+")":i,An(t,"checked","_q("+e+","+i+")"),En(t,"change",Mn(e,i),null,!0)}function zn(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+Mn(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),En(t,"change",o,null,!0)}function Kn(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?cs:"input",f="$event.target.value";s&&(f="$event.target.value.trim()"),a&&(f="_n("+f+")");var l=Mn(e,f);c&&(l="if($event.target.composing)return;"+l),An(t,"value","("+e+")"),En(t,u,l,null,!0),(s||a)&&En(t,"blur","$forceUpdate()")}function Wn(t){if(i(t[cs])){var e=Co?"change":"input";t[e]=[].concat(t[cs],t[e]||[]),delete t[cs]}i(t[us])&&(t.change=[].concat(t[us],t.change||[]),delete t[us])}function Gn(t,e,n){var r=Ma;return function i(){null!==t.apply(null,arguments)&&qn(e,i,n,r)}}function Jn(t,e,n,r,i){e=ot(e),n&&(e=Gn(e,t,r)),Ma.addEventListener(t,e,Eo?{capture:r,passive:i}:r)}function qn(t,e,n,r){(r||Ma).removeEventListener(t,e._withTask||e,n)}function Zn(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Ma=e.elm,Wn(n),ft(n,i,Jn,qn,e.context),Ma=void 0}}function Xn(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};i(c.__ob__)&&(c=e.data.domProps=b({},c));for(n in s)r(c[n])&&(a[n]="");for(n in c){if(o=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=o;var u=r(o)?"":String(o);Yn(a,u)&&(a.value=u)}else a[n]=o}}}function Yn(t,e){return!t.composing&&("OPTION"===t.tagName||Qn(t,e)||tr(t,e))}function Qn(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}function tr(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return d(n)!==d(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}function er(t){var e=nr(t.style);return t.staticStyle?b(t.staticStyle,e):e}function nr(t){return Array.isArray(t)?w(t):"string"==typeof t?ps(t):t}function rr(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=er(i.data))&&b(r,n);(n=er(t.data))&&b(r,n);for(var o=t;o=o.parent;)o.data&&(n=er(o.data))&&b(r,n);return r}function ir(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,s,c=e.elm,u=o.staticStyle,f=o.normalizedStyle||o.style||{},l=u||f,p=nr(e.data.style)||{};e.data.normalizedStyle=i(p.__ob__)?b({},p):p;var d=rr(e,!0);for(s in l)r(d[s])&&hs(c,s,"");for(s in d)(a=d[s])!==l[s]&&hs(c,s,null==a?"":a)}}function or(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function ar(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function sr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&b(e,_s(t.name||"v")),b(e,t),e}return"string"==typeof t?_s(t):void 0}}function cr(t){Os(function(){Os(t)})}function ur(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),or(t,e))}function fr(t,e){t._transitionClasses&&h(t._transitionClasses,e),ar(t,e)}function lr(t,e,n){var r=pr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ws?Cs:As,c=0,u=function(){t.removeEventListener(s,f),n()},f=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=ws,f=a,l=o.length):e===xs?u>0&&(n=xs,f=u,l=c.length):(f=Math.max(a,u),n=f>0?a>u?ws:xs:null,l=n?n===ws?o.length:c.length:0),{type:n,timeout:f,propCount:l,hasTransform:n===ws&&Ts.test(r[$s+"Property"])}}function dr(t,e){for(;t.length1}function _r(t,e){!0!==e.data.show&&hr(e)}function br(t,e,n){wr(t,e,n),(Co||Ao)&&setTimeout(function(){wr(t,e,n)},0)}function wr(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if($($r(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function xr(t,e){return e.every(function(e){return!$(e,t)})}function $r(t){return"_value"in t?t._value:t.value}function Cr(t){t.target.composing=!0}function kr(t){t.target.composing&&(t.target.composing=!1,Ar(t.target,"input"))}function Ar(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Or(t){return!t.componentInstance||t.data&&t.data.transition?t:Or(t.componentInstance._vnode)}function Tr(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Tr(xt(e.children)):t}function Sr(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[so(o)]=i[o];return e}function Er(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function jr(t){for(;t=t.parent;)if(t.data.transition)return!0}function Lr(t,e){return e.key===t.key&&e.tag===t.tag}function Ir(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Mr(t){t.data.newPos=t.elm.getBoundingClientRect()}function Pr(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function Nr(t,e){var n=e?zs(e):Us;if(n.test(t)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(t);){i=r.index,i>c&&(s.push(o=t.slice(c,i)),a.push(JSON.stringify(o)));var u=xn(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||lo,u=e.canBeLeftOpenTag||lo,f=0;t;){if(i=t,o&&gc(o)){var l=0,p=o.toLowerCase(),d=_c[p]||(_c[p]=new RegExp("([\\s\\S]*?)(]*>)","i")),v=t.replace(d,function(t,n,r){return l=r.length,gc(p)||"noscript"===p||(n=n.replace(//g,"$1").replace(//g,"$1")),Cc(p,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});f+=t.length-v.length,t=v,r(p,f-l,f)}else{var h=t.indexOf("<");if(0===h){if(ic.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(oc.test(t)){var y=t.indexOf("]>");if(y>=0){n(y+2);continue}}var g=t.match(rc);if(g){n(g[0].length);continue}var _=t.match(nc);if(_){var b=f;n(_[0].length),r(_[1],b,f);continue}var w=function(){var e=t.match(tc);if(e){var r={tagName:e[1],attrs:[],start:f};n(e[0].length);for(var i,o;!(i=t.match(ec))&&(o=t.match(Xs));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=f,r}}();if(w){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&Zs(n)&&r(o),u(n)&&o===n&&r(n));for(var f=c(n)||!!i,l=t.attrs.length,p=new Array(l),d=0;d=0){for($=t.slice(h);!(nc.test($)||tc.test($)||ic.test($)||oc.test($)||(C=$.indexOf("<",1))<0);)h+=C,$=t.slice(h);x=t.substring(0,h),n(h)}h<0&&(x=t,t=""),e.chars&&x&&e.chars(x)}if(t===i){e.chars&&e.chars(t);break}}r()}function Vr(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:ci(e),parent:n,children:[]}}function zr(t,e){function n(t){t.pre&&(s=!1),pc(t.tag)&&(c=!1);for(var n=0;n':'
',yc.innerHTML.indexOf(" ")>0}function to(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}/*! 2 | * Vue.js v2.5.13 3 | * (c) 2014-2017 Evan You 4 | * Released under the MIT License. 5 | */ 6 | var eo=Object.freeze({}),no=Object.prototype.toString,ro=v("slot,component",!0),io=v("key,ref,slot,slot-scope,is"),oo=Object.prototype.hasOwnProperty,ao=/-(\w)/g,so=y(function(t){return t.replace(ao,function(t,e){return e?e.toUpperCase():""})}),co=y(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),uo=/\B([A-Z])/g,fo=y(function(t){return t.replace(uo,"-$1").toLowerCase()}),lo=function(t,e,n){return!1},po=function(t){return t},vo="data-server-rendered",ho=["component","directive","filter"],mo=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],yo={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:lo,isReservedAttr:lo,isUnknownElement:lo,getTagNamespace:x,parsePlatformTagName:po,mustUseProp:lo,_lifecycleHooks:mo},go=/[^\w.$]/,_o="__proto__"in{},bo="undefined"!=typeof window,wo="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,xo=wo&&WXEnvironment.platform.toLowerCase(),$o=bo&&window.navigator.userAgent.toLowerCase(),Co=$o&&/msie|trident/.test($o),ko=$o&&$o.indexOf("msie 9.0")>0,Ao=$o&&$o.indexOf("edge/")>0,Oo=$o&&$o.indexOf("android")>0||"android"===xo,To=$o&&/iphone|ipad|ipod|ios/.test($o)||"ios"===xo,So=($o&&/chrome\/\d+/.test($o),{}.watch),Eo=!1;if(bo)try{var jo={};Object.defineProperty(jo,"passive",{get:function(){Eo=!0}}),window.addEventListener("test-passive",null,jo)}catch(t){}var Lo,Io,Mo=function(){return void 0===Lo&&(Lo=!bo&&void 0!==e&&"server"===e.process.env.VUE_ENV),Lo},Po=bo&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,No="undefined"!=typeof Symbol&&S(Symbol)&&"undefined"!=typeof Reflect&&S(Reflect.ownKeys);Io="undefined"!=typeof Set&&S(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var Do=x,Fo=0,Ro=function(){this.id=Fo++,this.subs=[]};Ro.prototype.addSub=function(t){this.subs.push(t)},Ro.prototype.removeSub=function(t){h(this.subs,t)},Ro.prototype.depend=function(){Ro.target&&Ro.target.addDep(this)},Ro.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e1?_(n):n;for(var r=_(arguments,1),i=0,o=n.length;iparseInt(this.max)&&He(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Aa={KeepAlive:ka};!function(t){var e={};e.get=function(){return yo},Object.defineProperty(t,"config",e),t.util={warn:Do,extend:b,mergeOptions:q,defineReactive:F},t.set=R,t.delete=H,t.nextTick=at,t.options=Object.create(null),ho.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,b(t.options.components,Aa),je(t),Le(t),Ie(t),Ne(t)}(Ee),Object.defineProperty(Ee.prototype,"$isServer",{get:Mo}),Object.defineProperty(Ee.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Ee.version="2.5.13";var Oa,Ta,Sa,Ea,ja,La,Ia,Ma,Pa,Na=v("style,class"),Da=v("input,textarea,option,select,progress"),Fa=function(t,e,n){return"value"===n&&Da(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Ra=v("contenteditable,draggable,spellcheck"),Ha=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ba="http://www.w3.org/1999/xlink",Ua=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Va=function(t){return Ua(t)?t.slice(6,t.length):""},za=function(t){return null==t||!1===t},Ka={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Wa=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Ga=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Ja=function(t){return"pre"===t},qa=function(t){return Wa(t)||Ga(t)},Za=Object.create(null),Xa=v("text,number,password,search,email,tel,url"),Ya=Object.freeze({createElement:Xe,createElementNS:Ye,createTextNode:Qe,createComment:tn,insertBefore:en,removeChild:nn,appendChild:rn,parentNode:on,nextSibling:an,tagName:sn,setTextContent:cn,setAttribute:un}),Qa={create:function(t,e){fn(e)},update:function(t,e){t.data.ref!==e.data.ref&&(fn(t,!0),fn(e))},destroy:function(t){fn(t,!0)}},ts=new Bo("",{},[]),es=["create","activate","update","remove","destroy"],ns={create:vn,update:vn,destroy:function(t){vn(t,ts)}},rs=Object.create(null),is=[Qa,ns],os={create:_n,update:_n},as={create:wn,update:wn},ss=/[\w).+\-_$\]]/,cs="__r",us="__c",fs={create:Zn,update:Zn},ls={create:Xn,update:Xn},ps=y(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),ds=/^--/,vs=/\s*!important$/,hs=function(t,e,n){if(ds.test(e))t.style.setProperty(e,n);else if(vs.test(n))t.style.setProperty(e,n.replace(vs,""),"important");else{var r=ys(e);if(Array.isArray(n))for(var i=0,o=n.length;iv?(l=r(n[y+1])?null:n[y+1].elm,g(t,l,n,d,y,o)):d>y&&b(t,e,p,v)}function $(t,e,n,r){for(var o=n;o\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ys="[a-zA-Z_][\\w\\-\\.]*",Qs="((?:"+Ys+"\\:)?"+Ys+")",tc=new RegExp("^<"+Qs),ec=/^\s*(\/?)>/,nc=new RegExp("^<\\/"+Qs+"[^>]*>"),rc=/^]+>/i,ic=/^ 10 | 11 | 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "quaver", 3 | "version": "1.0.0", 4 | "description": "a hot game quaver html5 version", 5 | "author": "Diamond ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs" 11 | }, 12 | "dependencies": { 13 | "less": "^2.7.2", 14 | "less-loader": "^2.2.3", 15 | "pug": "^2.0.0-beta11", 16 | "pug-loader": "^2.3.0", 17 | "vue": "^2.1.10" 18 | }, 19 | "devDependencies": { 20 | "autoprefixer": "^6.7.2", 21 | "babel-core": "^6.22.1", 22 | "babel-eslint": "^7.1.1", 23 | "babel-loader": "^6.2.10", 24 | "babel-plugin-transform-runtime": "^6.22.0", 25 | "babel-preset-env": "^1.1.8", 26 | "babel-preset-stage-2": "^6.22.0", 27 | "babel-register": "^6.22.0", 28 | "chalk": "^1.1.3", 29 | "connect-history-api-fallback": "^1.3.0", 30 | "copy-webpack-plugin": "^4.0.1", 31 | "css-loader": "^0.26.1", 32 | "eslint": "^3.14.1", 33 | "eslint-friendly-formatter": "^2.0.7", 34 | "eslint-loader": "^1.6.1", 35 | "eslint-plugin-html": "^2.0.0", 36 | "eslint-config-standard": "^6.2.1", 37 | "eslint-plugin-promise": "^3.4.0", 38 | "eslint-plugin-standard": "^2.0.1", 39 | "eventsource-polyfill": "^0.9.6", 40 | "express": "^4.14.1", 41 | "extract-text-webpack-plugin": "^2.0.0-rc.3", 42 | "file-loader": "^0.10.0", 43 | "friendly-errors-webpack-plugin": "^1.1.3", 44 | "function-bind": "^1.1.0", 45 | "html-webpack-plugin": "^2.28.0", 46 | "http-proxy-middleware": "^0.17.3", 47 | "webpack-bundle-analyzer": "^2.2.1", 48 | "semver": "^5.3.0", 49 | "opn": "^4.0.2", 50 | "optimize-css-assets-webpack-plugin": "^1.3.0", 51 | "ora": "^1.1.0", 52 | "rimraf": "^2.6.0", 53 | "url-loader": "^0.5.7", 54 | "vue-loader": "^11.0.0", 55 | "vue-style-loader": "^2.0.0", 56 | "vue-template-compiler": "^2.1.10", 57 | "webpack": "^2.2.1", 58 | "webpack-dev-middleware": "^1.10.0", 59 | "webpack-hot-middleware": "^2.16.1", 60 | "webpack-merge": "^2.6.1" 61 | }, 62 | "engines": { 63 | "node": ">= 4.0.0", 64 | "npm": ">= 3.0.0" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 29 | 30 | 47 | -------------------------------------------------------------------------------- /src/components/Game.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 203 | 204 | 284 | -------------------------------------------------------------------------------- /src/components/game-data.js: -------------------------------------------------------------------------------- 1 | const dataArray = [{ 2 | height: '50%', 3 | width: '900px', 4 | marginLeft: 0 5 | }] 6 | for (let i = 0; i < 50; i++) { 7 | const random = parseInt(Math.random() * 1000) 8 | const height = (random % 3 + 3) * 10 9 | const width = (random % 5 + 2) * 40 10 | const marginLeft = (random % 2 + 1.5) * 40 11 | dataArray.push({ 12 | height: `${height}%`, 13 | width: `${width}px`, 14 | marginLeft: `${marginLeft < 70 ? 70 : marginLeft}px` 15 | }) 16 | } 17 | export default dataArray 18 | -------------------------------------------------------------------------------- /src/js/AudioAPI.js: -------------------------------------------------------------------------------- 1 | const navigator = window.navigator 2 | navigator.getUserMedia = navigator.getUserMedia || 3 | navigator.webkitGetUserMedia || 4 | navigator.mozGetUserMedia || 5 | navigator.msGetUserMedia 6 | const AudioContext = window.AudioContext || 7 | window.webkitAudioContext 8 | 9 | const isSupport = !!(navigator.getUserMedia && AudioContext) 10 | const context = isSupport && new AudioContext() 11 | export default { 12 | isSupport, 13 | start () { 14 | // https://developer.mozilla.org/zh-CN/docs/Web/API/AudioContext AudioContent API 15 | return new Promise((resolve, reject) => { 16 | navigator.getUserMedia({audio: true}, stream => { 17 | const source = context.createMediaStreamSource(stream) 18 | const analyser = context.createAnalyser() 19 | source.connect(analyser) 20 | analyser.fftSize = 2048 21 | resolve(analyser) 22 | }, () => { 23 | reject() 24 | }) 25 | }) 26 | }, 27 | getVoiceSize (analyser) { 28 | const dataArray = new Uint8Array(analyser.frequencyBinCount) 29 | analyser.getByteFrequencyData(dataArray) 30 | const data = dataArray.slice(100, 1000) 31 | const sum = data.reduce((a, b) => a + b) 32 | return sum 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | 6 | /* eslint-disable no-new */ 7 | new Vue({ 8 | el: '#app', 9 | template: '', 10 | components: { App } 11 | }) 12 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/.gitkeep -------------------------------------------------------------------------------- /static/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/img/1.png -------------------------------------------------------------------------------- /static/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/img/2.png -------------------------------------------------------------------------------- /static/img/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/img/3.png -------------------------------------------------------------------------------- /static/img/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/img/4.png -------------------------------------------------------------------------------- /static/img/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k55k32/quaver/a81a3afd3afe288e994f58e00ac7458e5a05e37d/static/img/5.png --------------------------------------------------------------------------------