├── babel.config.js ├── public ├── favicon.ico └── index.html ├── src ├── assets │ └── logo.png ├── languages │ ├── index.js │ ├── ch.js │ └── en.js ├── views │ ├── About.vue │ └── Home.vue ├── store │ ├── index.js │ └── modules │ │ └── baberrage.js ├── main.js ├── router.js ├── paper.json ├── components │ └── HelloWorld.vue └── App.vue ├── vue.config.js ├── .gitignore ├── README.md └── package.json /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superhos/vue-baberrage-demo-page/master/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superhos/vue-baberrage-demo-page/master/src/assets/logo.png -------------------------------------------------------------------------------- /src/languages/index.js: -------------------------------------------------------------------------------- 1 | import en from './en.js' 2 | import ch from './ch.js' 3 | export default { 4 | en, 5 | ch 6 | } -------------------------------------------------------------------------------- /src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | baseUrl: process.env.NODE_ENV === 'production' 3 | ? '/vue-baberrage/' 4 | : '/' 5 | } -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import baberrage from './modules/baberrage' 4 | 5 | Vue.use(Vuex) 6 | 7 | export default new Vuex.Store({ 8 | modules: { 9 | baberrage 10 | } 11 | }) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | 23 | .history -------------------------------------------------------------------------------- /src/languages/ch.js: -------------------------------------------------------------------------------- 1 | export default { 2 | message: { 3 | introduce: '一个简单的Vue弹幕插件', 4 | start: '开始使用', 5 | doc: '查看文档', 6 | title1: '容易使用', 7 | content1: '只需几行代码,简单配置即可使用。', 8 | title2: '高性能', 9 | content2: '过百条同屏弹幕依然能保持60FPS.', 10 | title3: '独立', 11 | content3: '弹幕数据部分交还给使用者自己管理,可以配合Vuex使用' 12 | } 13 | } -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /src/languages/en.js: -------------------------------------------------------------------------------- 1 | export default { 2 | message: { 3 | introduce: 'A Simple Vue Plugin for Baberrage.', 4 | start: 'GET STARTED', 5 | doc: 'DOC', 6 | title1: 'Easy', 7 | content1: 'Easy to use. Only a few words of code.', 8 | title2: 'High Performance', 9 | content2: '100 messages also can keep on 60FPS.', 10 | title3: 'Independent', 11 | content3: 'You can manage the messages by yourself via Vuex' 12 | } 13 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-baberrage-website 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Run your tests 19 | ``` 20 | npm run test 21 | ``` 22 | 23 | ### Lints and fixes files 24 | ``` 25 | npm run lint 26 | ``` 27 | 28 | ### Customize configuration 29 | See [Configuration Reference](https://cli.vuejs.org/config/). 30 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import App from './App.vue' 4 | import router from './router' 5 | import store from './store' 6 | import { vueBaberrage } from 'vue-baberrage' 7 | // import { vueBaberrage } from './lib/vue-baberrage' 8 | import messages from './languages' 9 | 10 | Vue.use(vueBaberrage) 11 | Vue.use(VueI18n) 12 | Vue.config.productionTip = false 13 | 14 | const i18n = new VueI18n({ 15 | locale: 'ch', // set locale 16 | messages, // set locale messages 17 | }) 18 | 19 | new Vue({ 20 | router, 21 | store, 22 | i18n, 23 | render: h => h(App) 24 | }).$mount('#app') 25 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-baberrage-website 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Home from './views/Home.vue' 4 | 5 | Vue.use(Router) 6 | 7 | export default new Router({ 8 | mode: 'history', 9 | base: process.env.BASE_URL, 10 | routes: [ 11 | { 12 | path: '/', 13 | name: 'home', 14 | component: Home 15 | }, 16 | { 17 | path: '/about', 18 | name: 'about', 19 | // route level code-splitting 20 | // this generates a separate chunk (about.[hash].js) for this route 21 | // which is lazy-loaded when the route is visited. 22 | component: () => import(/* webpackChunkName: "about" */ './views/About.vue') 23 | } 24 | ] 25 | }) 26 | -------------------------------------------------------------------------------- /src/store/modules/baberrage.js: -------------------------------------------------------------------------------- 1 | // initial state 2 | // shape: [{ id, quantity }] 3 | const state = { 4 | messageList: [] 5 | } 6 | 7 | // getters 8 | const getters = { 9 | messageList: (state) => { 10 | return state.messageList 11 | } 12 | } 13 | 14 | // actions 15 | const actions = { 16 | addMessage ({ commit }, message) { 17 | commit('pushMessageToList', { message }) 18 | } 19 | } 20 | 21 | // mutations 22 | const mutations = { 23 | pushMessageToList (state, { message }) { 24 | state.messageList.push(message) 25 | } 26 | } 27 | 28 | export default { 29 | namespaced: true, 30 | state, 31 | getters, 32 | actions, 33 | mutations 34 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-baberrage-website", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "es6-promise": "^4.2.8", 12 | "vue": "^2.5.21", 13 | "vue-baberrage": "^3.2.4", 14 | "vue-i18n": "^8.7.0", 15 | "vue-router": "^3.0.1", 16 | "vue2-github-corners": "^0.1.12", 17 | "vuex": "^3.1.2" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^3.3.0", 21 | "@vue/cli-plugin-eslint": "^3.3.0", 22 | "@vue/cli-service": "^3.3.0", 23 | "babel-eslint": "^10.0.1", 24 | "eslint": "^5.8.0", 25 | "eslint-plugin-vue": "^5.0.0", 26 | "node-sass": "^4.9.0", 27 | "sass-loader": "^7.0.1", 28 | "vue-template-compiler": "^2.5.21" 29 | }, 30 | "eslintConfig": { 31 | "root": true, 32 | "env": { 33 | "node": true 34 | }, 35 | "extends": [ 36 | "plugin:vue/essential", 37 | "eslint:recommended" 38 | ], 39 | "rules": {}, 40 | "parserOptions": { 41 | "parser": "babel-eslint" 42 | } 43 | }, 44 | "postcss": { 45 | "plugins": { 46 | "autoprefixer": {} 47 | } 48 | }, 49 | "browserslist": [ 50 | "> 1%", 51 | "last 2 versions", 52 | "not ie <= 8" 53 | ] 54 | } 55 | -------------------------------------------------------------------------------- /src/paper.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"id": 10000, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "钟声响起归家的讯号 在他生命里 仿佛带点唏嘘", "time": 15}, 3 | {"id": 10001, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "黑色肌肤给他的意义 是一生奉献 肤色斗争中 年月把拥有变做失去", "time": 15}, 4 | {"id": 10002, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "疲倦的双眼带着期望 今天只有残留的躯壳 迎接光辉岁月", "time": 15}, 5 | {"id": 10003, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "风雨中抱紧自由 一生经过彷徨的挣扎 自信可改变未来", "time": 15}, 6 | {"id": 10004, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "问谁又能做到 可否不分肤色的界限 愿这土地里", "time": 15}, 7 | {"id": 10005, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "不分你我高低 缤纷色彩闪出的美丽 是因它没有", "time": 15}, 8 | {"id": 10006, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "分开每种色彩 年月把拥有变做失去 疲倦的双眼带着期望", "time": 15}, 9 | {"id": 10007, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "今天只有残留的躯壳 迎接光辉岁月 风雨中抱紧自由", "time": 15}, 10 | {"id": 10008, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "一生经过彷徨的挣扎 自信可改变未来 问谁又能做到", "time": 15}, 11 | {"id": 10009, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "今天只有残留的躯壳 迎接光辉岁月 风雨中抱紧自由", "time": 15}, 12 | {"id": 10010, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "一生经过彷徨的挣扎 自信可改变未来 问谁又能做到", "time": 15}, 13 | {"id": 10011, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "今天只有残留的躯壳 迎接光辉岁月 风雨中抱紧自由", "time": 15}, 14 | {"id": 10012, "avatar": "https://s2.ax1x.com/2020/02/17/3PmEyd.md.png", "msg": "一生经过彷徨的挣扎 自信可改变未来 问谁又能做到", "time": 15} 15 | ] -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 41 | 42 | 43 | 59 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 65 | 66 | 130 | 131 | 380 | --------------------------------------------------------------------------------