├── start ├── components ├── scrollbar.vue ├── topic │ ├── latest.vue │ └── list.vue ├── alert.vue ├── icon.vue ├── repo │ ├── fresh.vue │ ├── latest.vue │ ├── related.vue │ └── line-item.vue ├── home │ ├── release.vue │ ├── actions.vue │ └── sub.vue ├── header_back--.vue ├── adsense.vue ├── Footer.vue ├── swiper.vue ├── upload.vue ├── subitem.vue ├── chart.vue └── pagination.vue ├── test.js ├── .nuxt ├── empty.js ├── components │ ├── nuxt-link.js │ ├── no-ssr.js │ ├── nuxt.js │ ├── nuxt-child.js │ ├── nuxt-error.vue │ └── nuxt-loading.vue ├── views │ ├── app.template.html │ └── error.html ├── middleware.js ├── loading.html └── store.js ├── locales ├── en.json └── zh-cn.json ├── assets ├── img │ ├── dpr.png │ ├── jsonon.png │ ├── logo-50.png │ ├── logo-json.png │ ├── logo-news.png │ ├── logo-filter.png │ ├── fercard-demo.png │ ├── fercard-logo.png │ ├── logo-gradient.png │ ├── logo-loading.png │ └── weixin-applet.jpg ├── js │ ├── jquery-vendor.js │ ├── aliyun.js │ └── placeholder.js └── css │ └── main.css ├── static └── favicon.ico ├── plugins ├── icon.js ├── validator.js ├── vue-icon.js ├── upload.js ├── pagination.js ├── i18n.js ├── axios.js ├── ba.js └── common.js ├── .gitignore ├── .editorconfig ├── middleware ├── notification.js ├── i18n.js └── auth.js ├── pages ├── admin.vue ├── site │ ├── history.vue │ ├── capa.vue │ ├── contact.vue │ ├── link.vue │ └── about.vue ├── admin │ ├── mem │ │ └── mems.vue │ ├── site │ │ └── webkerapply.vue │ └── pub │ │ ├── submits.vue │ │ └── comments.vue ├── test.vue ├── auth.vue ├── develop │ └── icons.vue ├── site.vue ├── score.vue ├── topics.vue ├── mem │ └── _id │ │ ├── index.vue │ │ └── pubs │ │ └── comments.vue ├── topic │ └── _id.vue └── webker.vue ├── .eslintignore ├── .eslintrc.js ├── layouts ├── blank.vue ├── error.vue ├── default.vue └── admin.vue ├── store ├── index.js └── mutations.js ├── README.md ├── src └── svg │ ├── cut.svg │ ├── layout.svg │ ├── css3.svg │ ├── download.svg │ ├── list.svg │ ├── gitter.svg │ ├── crop.svg │ ├── cancel.svg │ ├── clock.svg │ ├── plus.svg │ ├── send.svg │ ├── edit.svg │ ├── expand.svg │ ├── fold.svg │ ├── reply.svg │ ├── home.svg │ ├── fullscreen.svg │ ├── heart.svg │ ├── laptop.svg │ ├── videocam.svg │ ├── arrow-up.svg │ ├── popup.svg │ ├── chart.svg │ ├── ok.svg │ ├── navicon.svg │ ├── stackoverflow.svg │ ├── trend.svg │ ├── pie-chart.svg │ ├── yindao.svg │ ├── bell.svg │ ├── train.svg │ ├── columns.svg │ ├── editor.svg │ ├── copy.svg │ ├── more.svg │ ├── eye.svg │ ├── chrome.svg │ ├── upload.svg │ ├── star.svg │ ├── template.svg │ ├── company.svg │ ├── iphone.svg │ ├── exchange.svg │ ├── close.svg │ ├── camera.svg │ ├── folder.svg │ ├── check-square.svg │ ├── jindu.svg │ ├── collect_fill.svg │ ├── audio.svg │ ├── rocket.svg │ ├── eyedropper.svg │ ├── refresh.svg │ ├── toggle.svg │ ├── tag.svg │ ├── bao.svg │ ├── help.svg │ ├── check-square-o.svg │ ├── hourglass-half.svg │ ├── sort-alpha.svg │ ├── database.svg │ ├── eye-o.svg │ ├── location.svg │ ├── heart-o.svg │ ├── rss.svg │ ├── collect.svg │ ├── car.svg │ ├── github.svg │ ├── module.svg │ ├── images.svg │ ├── cube.svg │ ├── flag.svg │ ├── bug.svg │ ├── certificate.svg │ ├── toolbox.svg │ ├── zip.svg │ ├── pen.svg │ ├── test.svg │ ├── dashboard.svg │ ├── comment.svg │ ├── game.svg │ ├── server.svg │ ├── link.svg │ ├── clock-o.svg │ ├── tip.svg │ ├── slider.svg │ ├── calendar.svg │ ├── video.svg │ ├── twitter.svg │ └── book.svg ├── tools └── build.js ├── package.json └── nuxt.config.js /start: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /components/scrollbar.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | console.log(process.env.NODE_ENV) 2 | -------------------------------------------------------------------------------- /.nuxt/empty.js: -------------------------------------------------------------------------------- 1 | // This file is intentionally left empty for noop aliases 2 | -------------------------------------------------------------------------------- /locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "home": { 3 | "repos": "Repos" 4 | } 5 | } -------------------------------------------------------------------------------- /locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "home": { 3 | "repos": "前端库" 4 | } 5 | } -------------------------------------------------------------------------------- /assets/img/dpr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/dpr.png -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /assets/img/jsonon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/jsonon.png -------------------------------------------------------------------------------- /assets/img/logo-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-50.png -------------------------------------------------------------------------------- /assets/img/logo-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-json.png -------------------------------------------------------------------------------- /assets/img/logo-news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-news.png -------------------------------------------------------------------------------- /assets/img/logo-filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-filter.png -------------------------------------------------------------------------------- /assets/img/fercard-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/fercard-demo.png -------------------------------------------------------------------------------- /assets/img/fercard-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/fercard-logo.png -------------------------------------------------------------------------------- /assets/img/logo-gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-gradient.png -------------------------------------------------------------------------------- /assets/img/logo-loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/logo-loading.png -------------------------------------------------------------------------------- /assets/img/weixin-applet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/awesomes-cn/new-awesomes/HEAD/assets/img/weixin-applet.jpg -------------------------------------------------------------------------------- /assets/js/jquery-vendor.js: -------------------------------------------------------------------------------- 1 | import $ from 'jquery' 2 | window.$ = $ 3 | window.jQuery = $ 4 | export default $ 5 | -------------------------------------------------------------------------------- /plugins/icon.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Icon from '~/components/icon.vue' 3 | 4 | Vue.component('icon', Icon) 5 | -------------------------------------------------------------------------------- /plugins/validator.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | var VueValidator = require('vue-validator') 3 | 4 | Vue.use(VueValidator) 5 | -------------------------------------------------------------------------------- /plugins/vue-icon.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Icon from 'vue-svg-icon/Icon.vue' 3 | 4 | Vue.component('v-icon', Icon) 5 | -------------------------------------------------------------------------------- /plugins/upload.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Upload from '~/components/upload.vue' 3 | 4 | Vue.component('upload', Upload) 5 | -------------------------------------------------------------------------------- /plugins/pagination.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Pagination from '~/components/pagination.vue' 3 | 4 | Vue.component('pagination', Pagination) 5 | -------------------------------------------------------------------------------- /.nuxt/components/nuxt-link.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'nuxt-link', 3 | functional: true, 4 | render (h, { data, children }) { 5 | return h('router-link', data, children) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.nuxt/views/app.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ HEAD }} 5 | 6 | 7 | {{ APP }} 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # logs 5 | npm-debug.log 6 | 7 | # Nuxt build 8 | # .nuxt 9 | .nuxt/dist/*.js 10 | 11 | # Nuxt generate 12 | # dist 13 | 14 | 15 | config.json 16 | webon.config.json 17 | webon.log.json -------------------------------------------------------------------------------- /components/topic/latest.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 11 | 12 | 13 | 17 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /middleware/notification.js: -------------------------------------------------------------------------------- 1 | import axios from '~/plugins/axios' 2 | 3 | export default async function ({ store, redirect, req, head }) { 4 | if (store.state.session) { 5 | let notifications = await axios(req).get('notification/unread') 6 | store.commit('notifiy', notifications.data.count) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /pages/admin.vue: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # logs 5 | npm-debug.log 6 | 7 | # Nuxt build 8 | .nuxt 9 | 10 | # Nuxt generate 11 | dist 12 | 13 | components/editor.vue 14 | components/upload.vue 15 | assets/js/aliyun-oss-sdk.min.js 16 | assets/js/placeholder.js 17 | assets/js/particles.min.js 18 | components/swiper.vue -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | env: { 5 | browser: true, 6 | node: true 7 | }, 8 | extends: 'standard', 9 | // required to lint *.vue files 10 | plugins: [ 11 | 'html' 12 | ], 13 | // add your custom rules here 14 | rules: {}, 15 | globals: {} 16 | } 17 | -------------------------------------------------------------------------------- /pages/site/history.vue: -------------------------------------------------------------------------------- 1 | 13 | 17 | 18 | 20 | -------------------------------------------------------------------------------- /pages/site/capa.vue: -------------------------------------------------------------------------------- 1 | 8 | 12 | 13 | 15 | -------------------------------------------------------------------------------- /plugins/i18n.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | // import store from '~/store' 4 | 5 | Vue.use(VueI18n) 6 | 7 | const i18n = new VueI18n({ 8 | // locale: store.state.locale, 9 | locale: 'zh-cn', 10 | fallbackLocale: 'en', 11 | messages: { 12 | 'en': require('~/locales/en.json'), 13 | 'zh-cn': require('~/locales/zh-cn.json') 14 | } 15 | }) 16 | 17 | export default i18n 18 | -------------------------------------------------------------------------------- /layouts/blank.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | 22 | 24 | -------------------------------------------------------------------------------- /pages/admin/mem/mems.vue: -------------------------------------------------------------------------------- 1 | 5 | 20 | 21 | 23 | -------------------------------------------------------------------------------- /middleware/i18n.js: -------------------------------------------------------------------------------- 1 | // this example is https://github.com/nuxt/nuxt.js/blob/master/examples/i18n/middleware/i18n.js 2 | export default function ({ req, i18n, store, route, params, error, redirect }) { 3 | if (process.server) { 4 | let locale = req.headers['accept-language'].split(',')[0].toLocaleLowerCase() || 'en' 5 | if (locale === 'zh') { 6 | locale = 'zh-cn' 7 | } 8 | store.commit('SET_LANG', locale) 9 | // i18n.locale = store.state.locale 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- 1 | import Vuex from 'vuex' 2 | import mutations from './mutations' 3 | const store = () => { 4 | return new Vuex.Store({ 5 | state: { 6 | isShowLogin: false, 7 | session: null, 8 | locale: 'en', 9 | locales: ['en', 'zh-cn'], 10 | unreadNotifiy: 0, 11 | alert: { 12 | show: false, 13 | type: 'info', 14 | msg: '' 15 | } 16 | }, 17 | mutations 18 | }) 19 | } 20 | 21 | export default store 22 | -------------------------------------------------------------------------------- /pages/test.vue: -------------------------------------------------------------------------------- 1 | 6 | 21 | 22 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # new-awesomes 2 | 3 | > Awesomes.cn new version 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm install # Or yarn install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js). 23 | -------------------------------------------------------------------------------- /src/svg/cut.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nuxt/middleware.js: -------------------------------------------------------------------------------- 1 | 2 | let files = require.context('@/middleware', false, /^\.\/(?!-)[^.]+\.(js)$/) 3 | let filenames = files.keys() 4 | 5 | function getModule (filename) { 6 | let file = files(filename) 7 | return file.default 8 | ? file.default 9 | : file 10 | } 11 | let middleware = {} 12 | 13 | // Generate the middleware 14 | for (let filename of filenames) { 15 | let name = filename.replace(/^\.\//, '').replace(/\.(js)$/, '') 16 | middleware[name] = getModule(filename) 17 | } 18 | 19 | export default middleware 20 | 21 | -------------------------------------------------------------------------------- /src/svg/layout.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/css3.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/download.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/list.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/gitter.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/site/contact.vue: -------------------------------------------------------------------------------- 1 | 15 | 19 | 20 | 22 | -------------------------------------------------------------------------------- /src/svg/crop.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/build.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const path = require('path') 3 | const Config = require('../config') 4 | 5 | // 替换 index.html 中的资源路径 6 | let processAssets = () => { 7 | let _htmlPath = path.resolve(__dirname, '../.nuxt/dist/index.html') 8 | let content = fs.readFileSync(_htmlPath, 'utf8') 9 | let _newcon = content.replace(/\/_nuxt(\/nuxt.bundle)/, `${Config.CDN}.nuxt/dist$1`) 10 | _newcon = _newcon.replace(/\/_nuxt(\/vendor.bundle)/, `${Config.CDN}.nuxt/dist$1`) 11 | fs.writeFileSync(_htmlPath, _newcon, 'utf8') 12 | console.log('index.html资源文件路径替换完毕') 13 | } 14 | 15 | processAssets() 16 | -------------------------------------------------------------------------------- /src/svg/cancel.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/axios.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import Cookie from 'js-cookie' 3 | const Config = require('../config') 4 | 5 | // 请求分为两类: 6 | // 1类是客户端发出的请求:直接用 Cookie.get('awlogin') 即可 7 | // 2类是服务端发出的请求:则需要通过 req.headers.cookie 去获取了 8 | export default (req) => { 9 | let token = null 10 | if (req && req.headers.cookie) { 11 | let _cookie = req.headers.cookie.split(';').find(c => c.trim().startsWith('awlogin=')) 12 | if (_cookie) { 13 | token = _cookie.split('=')[1] 14 | } 15 | } 16 | return axios.create({ 17 | baseURL: Config.API, 18 | headers: { atoken: (token || Cookie.get('awlogin') || '') } 19 | }) 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/svg/clock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /src/svg/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/send.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /layouts/error.vue: -------------------------------------------------------------------------------- 1 | 14 | 19 | 20 | 37 | -------------------------------------------------------------------------------- /src/svg/edit.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/expand.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/fold.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/reply.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pages/admin/site/webkerapply.vue: -------------------------------------------------------------------------------- 1 | 5 | 26 | 27 | 29 | -------------------------------------------------------------------------------- /plugins/ba.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | let addScript = (src) => { 4 | var hm = document.createElement("script"); 5 | hm.src = src 6 | var s = document.getElementsByTagName("script")[0]; 7 | s.parentNode.insertBefore(hm, s); 8 | } 9 | 10 | export default ({ app }) => { 11 | /* 12 | ** Only run on client-side and only in production mode 13 | */ 14 | // if (process.env.NODE_ENV === 'production') { 15 | var _hmt = _hmt || []; 16 | (function() { 17 | addScript("https://hm.baidu.com/hm.js?4eb521ea7e1a8b34ca104f2703625e64") 18 | })() 19 | 20 | app.router.afterEach((to, from) => { 21 | /* 22 | ** We tell Google Analytic to add a page view 23 | */ 24 | }) 25 | } -------------------------------------------------------------------------------- /src/svg/fullscreen.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/heart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /src/svg/laptop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/svg/videocam.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /store/mutations.js: -------------------------------------------------------------------------------- 1 | const mutations = { 2 | showLogin (state) { 3 | state.isShowLogin = true 4 | }, 5 | hideLogin (state) { 6 | state.isShowLogin = false 7 | }, 8 | setUser (state, session) { 9 | state.session = session 10 | }, 11 | SET_LANG (state, locale) { 12 | if (state.locales.indexOf(locale) !== -1) { 13 | state.locale = locale 14 | } 15 | }, 16 | notifiy (state, unreadNotifiy) { 17 | state.unreadNotifiy = unreadNotifiy 18 | }, 19 | showAlert (state, {type, msg}) { 20 | state.alert.type = type 21 | state.alert.msg = msg 22 | state.alert.show = true 23 | }, 24 | hideAlert (state) { 25 | state.alert.show = false 26 | } 27 | } 28 | 29 | export default mutations 30 | -------------------------------------------------------------------------------- /src/svg/arrow-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /src/svg/popup.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/chart.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/ok.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/navicon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/stackoverflow.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/auth.vue: -------------------------------------------------------------------------------- 1 | 4 | 26 | -------------------------------------------------------------------------------- /src/svg/trend.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/pie-chart.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/admin/pub/submits.vue: -------------------------------------------------------------------------------- 1 | 5 | 29 | 30 | 37 | -------------------------------------------------------------------------------- /src/svg/yindao.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/bell.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/svg/train.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/columns.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/editor.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.nuxt/components/no-ssr.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** From https://github.com/egoist/vue-no-ssr 3 | ** With the authorization of @egoist 4 | */ 5 | export default { 6 | name: 'no-ssr', 7 | props: ['placeholder'], 8 | data () { 9 | return { 10 | canRender: false 11 | } 12 | }, 13 | mounted () { 14 | this.canRender = true 15 | }, 16 | render (h) { 17 | if (this.canRender) { 18 | if ( 19 | process.env.NODE_ENV === 'development' && 20 | this.$slots.default && 21 | this.$slots.default.length > 1 22 | ) { 23 | throw new Error(' You cannot use multiple child components') 24 | } 25 | return this.$slots.default && this.$slots.default[0] 26 | } 27 | 28 | return h( 29 | 'div', 30 | { 31 | class: ['no-ssr-placeholder'] 32 | }, 33 | this.$slots.placeholder || this.placeholder 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /pages/develop/icons.vue: -------------------------------------------------------------------------------- 1 | 8 | 22 | 23 | 41 | -------------------------------------------------------------------------------- /src/svg/copy.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/more.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/svg/eye.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/chrome.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/upload.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/star.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/alert.vue: -------------------------------------------------------------------------------- 1 | 8 | 18 | 19 | 37 | -------------------------------------------------------------------------------- /src/svg/template.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/icon.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 19 | 20 | 43 | -------------------------------------------------------------------------------- /pages/site/link.vue: -------------------------------------------------------------------------------- 1 | 12 | 28 | 29 | 40 | -------------------------------------------------------------------------------- /src/svg/company.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 43 | -------------------------------------------------------------------------------- /middleware/auth.js: -------------------------------------------------------------------------------- 1 | import axios from '~/plugins/axios' 2 | import Cookie from 'js-cookie' 3 | 4 | export default function ({ store, redirect, req }) { 5 | if (!process.server) { 6 | window.document.domain = window.location.hostname.replace(/^[A-Za-z]+\./, '') 7 | } 8 | if (process.server && !store.state.session) { 9 | let domain = req.headers.host.split(':')[0].replace(/^www/, '') 10 | if (!req.headers.cookie) { 11 | store.commit('setUser', null) 12 | return 13 | } 14 | let loginCookie = req.headers.cookie.split(';').find(c => c.trim().startsWith('awlogin=')) 15 | if (!loginCookie) { 16 | store.commit('setUser', null) 17 | return 18 | } 19 | return axios(req).get('session').then(res => { 20 | if (res.data.status) { 21 | Cookie.set('awlogin', { token: res.data.token, mem: res.data.mem }, domain) 22 | } else { 23 | Cookie.set('awlogin', null, domain) 24 | } 25 | store.commit('setUser', res.data.mem) 26 | }) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/svg/iphone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /src/svg/exchange.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/close.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/camera.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /src/svg/folder.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.nuxt/loading.html: -------------------------------------------------------------------------------- 1 | 43 | 44 |
45 |
46 |
47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /components/repo/fresh.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 27 | 28 | 29 | 47 | -------------------------------------------------------------------------------- /pages/site.vue: -------------------------------------------------------------------------------- 1 | 13 | 17 | 18 | 50 | -------------------------------------------------------------------------------- /assets/js/aliyun.js: -------------------------------------------------------------------------------- 1 | import axios from '~/plugins/axios' 2 | var OSS = require('~/assets/js/aliyun-oss-sdk.min').Wrapper 3 | var bucket = 'awesomes' 4 | var region = 'oss-cn-beijing' 5 | 6 | var applyTokenDo = function (func, file, prefix) { 7 | return axios().get(`upload/token?prefix=${prefix}`).then(function (res) { 8 | var creds = res.data 9 | var client = new OSS({ 10 | region: region, 11 | accessKeyId: creds.AccessKeyId, 12 | accessKeySecret: creds.AccessKeySecret, 13 | stsToken: creds.SecurityToken, 14 | bucket: bucket 15 | }) 16 | 17 | return func(client, file, creds.filename) 18 | }) 19 | } 20 | 21 | var progress = function (p) { 22 | return function (done) { 23 | console.log('~~~~~', Math.floor(p * 100)) 24 | done() 25 | } 26 | } 27 | 28 | var uploadFile = function (client, file, filename) { 29 | return client.multipartUpload(filename, file, { 30 | progress: progress 31 | }) 32 | } 33 | 34 | export default { 35 | upload: function (file, prefix) { 36 | return applyTokenDo(uploadFile, file, prefix) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/svg/check-square.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/jindu.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/admin/pub/comments.vue: -------------------------------------------------------------------------------- 1 | 5 | 37 | 38 | 45 | -------------------------------------------------------------------------------- /src/svg/collect_fill.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/audio.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/rocket.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/eyedropper.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/refresh.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/toggle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 10 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /components/home/release.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 18 | 19 | 46 | -------------------------------------------------------------------------------- /pages/score.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 50 | -------------------------------------------------------------------------------- /src/svg/tag.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/bao.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/help.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /src/svg/check-square-o.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/hourglass-half.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/sort-alpha.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/database.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/eye-o.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/location.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/heart-o.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.nuxt/components/nuxt.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import NuxtChild from './nuxt-child' 3 | import NuxtError from '../../layouts/error.vue' 4 | import { compile } from '../utils' 5 | 6 | export default { 7 | name: 'nuxt', 8 | props: ['nuxtChildKey', 'keepAlive'], 9 | render(h) { 10 | // If there is some error 11 | if (this.nuxt.err) { 12 | return h('nuxt-error', { 13 | props: { 14 | error: this.nuxt.err 15 | } 16 | }) 17 | } 18 | // Directly return nuxt child 19 | return h('nuxt-child', { 20 | key: this.routerViewKey, 21 | props: this.$props 22 | }) 23 | }, 24 | beforeCreate () { 25 | Vue.util.defineReactive(this, 'nuxt', this.$root.$options.nuxt) 26 | }, 27 | computed: { 28 | routerViewKey () { 29 | // If nuxtChildKey prop is given or current route has children 30 | if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { 31 | return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params) 32 | } 33 | const Component = this.$route.matched[0] && this.$route.matched[0].components.default 34 | if (Component && Component.options && Component.options.key) { 35 | return (typeof Component.options.key === 'function' ? Component.options.key(this.$route) : Component.options.key) 36 | } 37 | return this.$route.path 38 | } 39 | }, 40 | components: { 41 | NuxtChild, 42 | NuxtError 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/header_back--.vue: -------------------------------------------------------------------------------- 1 | 17 | 21 | 22 | 50 | -------------------------------------------------------------------------------- /src/svg/rss.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/collect.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/car.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svg/github.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/module.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/site/about.vue: -------------------------------------------------------------------------------- 1 | 38 | 42 | 43 | 48 | -------------------------------------------------------------------------------- /src/svg/images.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /components/home/actions.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 27 | 28 | 63 | -------------------------------------------------------------------------------- /src/svg/cube.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 10 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /components/repo/latest.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 25 | 26 | 27 | 75 | -------------------------------------------------------------------------------- /src/svg/flag.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/bug.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/certificate.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/toolbox.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/zip.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/pen.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/test.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new-awesomes", 3 | "version": "1.0.0", 4 | "description": "Awesomes.cn new version", 5 | "author": "hxh <1246996371@qq.com>", 6 | "private": true, 7 | "dependencies": { 8 | "ali-oss": "^4.8.0", 9 | "aliyun-oss": "^1.2.0", 10 | "animate.css": "^3.5.2", 11 | "axios": "^0.15.3", 12 | "babel-polyfill": "^6.26.0", 13 | "bootstrap": "4.1.1", 14 | "codemirror": "^5.25.0", 15 | "echarts": "^4.1.0", 16 | "imports-loader": "^0.7.1", 17 | "jquery": "^3.2.1", 18 | "js-cookie": "^2.1.4", 19 | "marked": "^0.3.6", 20 | "normalize.css": "^5.0.0", 21 | "nuxt": "^1.4.0", 22 | "particles.js": "^2.0.0", 23 | "perfect-scrollbar": "^0.7.0", 24 | "prismjs": "^1.6.0", 25 | "sass-loader": "^6.0.3", 26 | "simple-pagination.js": "^1.6.0", 27 | "store": "^2.0.4", 28 | "swiper": "^4.1.6", 29 | "timeago.js": "^3.0.1", 30 | "underscore": "^1.8.3", 31 | "vue": "^2.5.16", 32 | "vue-i18n": "^7.2.0", 33 | "vue-svg-icon": "^1.2.9" 34 | }, 35 | "scripts": { 36 | "dev": "HOST=0.0.0.0 PORT=3333 nuxt", 37 | "windev": "nuxt", 38 | "build": "NODE_ENV=production nuxt build && webon deploy .nuxt/dist -f", 39 | "builddev": "nuxt build", 40 | "start": "HOST=0.0.0.0 PORT=3333 nuxt start", 41 | "generate": "nuxt generate", 42 | "lint": "eslint --ext .js,.vue --ignore-path .eslintignore .", 43 | "precommit": "npm run lint" 44 | }, 45 | "devDependencies": { 46 | "babel-eslint": "^7.1.1", 47 | "eslint": "^3.15.0", 48 | "eslint-config-standard": "^6.2.1", 49 | "eslint-loader": "^1.6.1", 50 | "eslint-plugin-html": "^2.0.0", 51 | "eslint-plugin-promise": "^3.4.1", 52 | "eslint-plugin-standard": "^2.0.1", 53 | "node-sass": "^4.5.1", 54 | "pug": "^2.0.0-beta6", 55 | "pug-loader": "^2.3.0", 56 | "sass-loader": "^6.0.3", 57 | "webon": "^1.1.7" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /components/adsense.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 57 | 58 | 63 | -------------------------------------------------------------------------------- /components/Footer.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 35 | 36 | 37 | 81 | -------------------------------------------------------------------------------- /.nuxt/views/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Server error 5 | 6 | 7 | 10 | 11 | 12 |
13 |
14 | 15 |
Server error
16 |
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
17 |
18 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /nuxt.config.js: -------------------------------------------------------------------------------- 1 | const Config = require('./config') 2 | module.exports = { 3 | /* 4 | ** Headers of the page 5 | */ 6 | cache: { 7 | max: 1000, 8 | maxAge: 900000 9 | }, 10 | router: { 11 | // 在每页渲染前运行 middleware/user-agent.js 中间件的逻辑 12 | middleware: ['auth', 'i18n', 'notification'] 13 | }, 14 | head: { 15 | title: 'Awesomes-Web前端开发资源库', 16 | meta: [ 17 | { charset: 'utf-8' }, 18 | { name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' }, 19 | { hid: 'description', name: 'description', content: 'Web前端开发工程师需要的免费开源的高质量前端库、框架和插件' }, 20 | {hid: 'keywords', name: 'keywords', content: 'html5,h5,css3,jquery,web框架,js框架,jquery插件,免费开源,中文文档'} 21 | ], 22 | link: [ 23 | { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } 24 | ] 25 | }, 26 | /* 27 | ** Global CSS 28 | */ 29 | css: [ 30 | 'bootstrap/dist/css/bootstrap.css', 31 | 'prismjs/themes/prism.css', 32 | 'animate.css', 33 | '~/assets/css/main.css' 34 | ], 35 | /* 36 | ** Customize the progress-bar color 37 | */ 38 | loading: { color: '#da552f' }, 39 | /* 40 | ** Build configuration 41 | */ 42 | build: { 43 | vendor: [ 44 | 'vue-i18n', 45 | 'babel-polyfill' 46 | ], 47 | publicPath: `${Config.CDN}.nuxt/dist/`, 48 | /* 49 | ** Run ESLINT on save 50 | */ 51 | extend (config, ctx) { 52 | if (ctx.isClient) { 53 | config.module.rules.push({ 54 | enforce: 'pre', 55 | test: /\.(js|vue)$/, 56 | loader: 'eslint-loader', 57 | exclude: /(node_modules)/ 58 | }) 59 | } 60 | } 61 | }, 62 | plugins: ['~/plugins/vue-icon', '~/plugins/icon', '~/plugins/common', { src: '~/plugins/ba.js', ssr: false }, { src: '~/plugins/pagination.js', ssr: false }, { src: '~/plugins/i18n.js', injectAs: 'i18n' }] 63 | } 64 | -------------------------------------------------------------------------------- /src/svg/dashboard.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugins/common.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import timeago from 'timeago.js' 3 | var marked = require('marked') 4 | var Prism = require('prismjs') 5 | var renderer = new marked.Renderer() 6 | const config = require('../config') 7 | 8 | renderer.code = (code, language) => { 9 | return '
' +
10 |     Prism.highlight(code, Prism.languages[language] || Prism.languages.javascript) +
11 |     '
' 12 | } 13 | 14 | Vue.use({ 15 | install: function (Vue, options) { 16 | // cdn地址 17 | Vue.prototype.cdn = function (name, folder, process) { 18 | if (!name || name === '') { 19 | name = 'default.png' 20 | } 21 | if (/^http(s)?:\/\//.test(name)) { 22 | return name 23 | } 24 | let url = `${config.CDN}/${folder}/${name}` 25 | if (process) { 26 | url += `?x-oss-process=style/${process}` 27 | } 28 | return url 29 | } 30 | 31 | // 弹出登录框 32 | Vue.prototype.showLogin = function () { 33 | if (!this.$store.state.session) { 34 | this.$store.commit('showLogin') 35 | return true 36 | } 37 | return false 38 | } 39 | 40 | // 隐藏登陆框 41 | Vue.prototype.hideLogin = function () { 42 | this.$store.commit('hideLogin') 43 | } 44 | 45 | // markdown 解析 46 | Vue.prototype.marked = function (con) { 47 | return marked(con, {renderer: renderer}) 48 | } 49 | 50 | // 时间本地化 51 | Vue.prototype.timeago = function (datetime) { 52 | return timeago().format(datetime, 'zh_CN') 53 | } 54 | 55 | // 消息提示 56 | Vue.prototype.$alert = function (type, msg) { 57 | this.$store.commit('showAlert', { 58 | type: type, 59 | msg: msg 60 | }) 61 | let _self = this 62 | setTimeout(() => { 63 | _self.$store.commit('hideAlert') 64 | }, 3000) 65 | } 66 | } 67 | }) 68 | -------------------------------------------------------------------------------- /components/swiper.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 31 | 32 | 71 | -------------------------------------------------------------------------------- /src/svg/comment.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/topics.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 35 | 36 | 37 | 89 | -------------------------------------------------------------------------------- /components/topic/list.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 28 | 29 | 30 | 77 | -------------------------------------------------------------------------------- /assets/js/placeholder.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | module.exports = function (CodeMirror) { 4 | CodeMirror.defineOption("placeholder", "", function(cm, val, old) { 5 | var prev = old && old != CodeMirror.Init; 6 | if (val && !prev) { 7 | cm.on("blur", onBlur); 8 | cm.on("change", onChange); 9 | cm.on("swapDoc", onChange); 10 | onChange(cm); 11 | } else if (!val && prev) { 12 | cm.off("blur", onBlur); 13 | cm.off("change", onChange); 14 | cm.off("swapDoc", onChange); 15 | clearPlaceholder(cm); 16 | var wrapper = cm.getWrapperElement(); 17 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); 18 | } 19 | 20 | if (val && !cm.hasFocus()) onBlur(cm); 21 | }); 22 | 23 | function clearPlaceholder(cm) { 24 | if (cm.state.placeholder) { 25 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder); 26 | cm.state.placeholder = null; 27 | } 28 | } 29 | function setPlaceholder(cm) { 30 | clearPlaceholder(cm); 31 | var elt = cm.state.placeholder = document.createElement("pre"); 32 | elt.style.cssText = "height: 0; overflow: visible"; 33 | elt.className = "CodeMirror-placeholder"; 34 | var placeHolder = cm.getOption("placeholder") 35 | if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder) 36 | elt.appendChild(placeHolder) 37 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); 38 | } 39 | 40 | function onBlur(cm) { 41 | if (isEmpty(cm)) setPlaceholder(cm); 42 | } 43 | function onChange(cm) { 44 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm); 45 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : ""); 46 | 47 | if (empty) setPlaceholder(cm); 48 | else clearPlaceholder(cm); 49 | } 50 | 51 | function isEmpty(cm) { 52 | return (cm.lineCount() === 1) && (cm.getLine(0) === ""); 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/svg/game.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/server.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/link.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/mem/_id/index.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 33 | 34 | 35 | 78 | -------------------------------------------------------------------------------- /src/svg/clock-o.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | html, body 2 | { 3 | font-size: 13px; 4 | font-family: -apple-system,PingFang SC,Hiragino Sans GB,Arial,Microsoft YaHei,Helvetica Neue,sans-serif; 5 | color: #444; 6 | } 7 | 8 | html, body, body > div:first-child { 9 | height: 100%; 10 | } 11 | .main-in { 12 | display: flex; 13 | min-height: 100%; 14 | flex-direction: column; 15 | } 16 | 17 | .body { 18 | flex-grow: 1 19 | } 20 | 21 | 22 | .content { 23 | flex: 1; 24 | } 25 | 26 | h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { 27 | font-weight: bold; 28 | } 29 | 30 | code { 31 | padding: 2px 4px; 32 | font-size: 90%; 33 | color: #c7254e; 34 | background-color: #f9f2f4; 35 | border-radius: 4px; 36 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 37 | } 38 | 39 | div { 40 | box-sizing: border-box 41 | } 42 | 43 | button, .btn { 44 | cursor: pointer; 45 | border-radius: 0; 46 | } 47 | 48 | a { 49 | transition: all, .5s; 50 | text-decoration: none 51 | } 52 | a:focus, a:hover { 53 | text-decoration: none 54 | } 55 | 56 | a:link, a:visited { 57 | color: #444; 58 | } 59 | 60 | a:hover, a:active { 61 | color: #da552f; 62 | } 63 | 64 | a.ata:link, a.ata:visited { 65 | color: #08c; 66 | } 67 | 68 | 69 | .body { 70 | padding-top: 60px; 71 | } 72 | 73 | svg { 74 | width: 20px; 75 | height: 20px; 76 | display: inline-block; 77 | } 78 | 79 | :not(pre) > code[class*="language-"], pre[class*="language-"] { 80 | background: #f8f8f8; 81 | } 82 | 83 | .CodeMirror { 84 | font-size: 13px; 85 | font-family: -apple-system,PingFang SC,Hiragino Sans GB,Arial,Microsoft YaHei,Helvetica Neue,sans-serif!important; 86 | height: auto!important; 87 | } 88 | 89 | .CodeMirror pre.CodeMirror-placeholder { 90 | color: #a2a1a1!important 91 | } 92 | 93 | button > span { 94 | display: inline-flex; 95 | align-items: center; 96 | } 97 | 98 | button svg { 99 | margin-right: 3px; 100 | } 101 | 102 | .card { 103 | border: 0; 104 | } 105 | 106 | /*.btn { 107 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1); 108 | cursor: pointer; 109 | border-radius: 0.15rem; 110 | outline: none; 111 | }*/ -------------------------------------------------------------------------------- /pages/topic/_id.vue: -------------------------------------------------------------------------------- 1 | 22 | 34 | 35 | 86 | -------------------------------------------------------------------------------- /layouts/admin.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 47 | 48 | 88 | -------------------------------------------------------------------------------- /pages/webker.vue: -------------------------------------------------------------------------------- 1 | 31 | 61 | 62 | 91 | -------------------------------------------------------------------------------- /src/svg/tip.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pages/mem/_id/pubs/comments.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 59 | 60 | 61 | 90 | -------------------------------------------------------------------------------- /src/svg/slider.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.nuxt/components/nuxt-child.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'nuxt-child', 3 | functional: true, 4 | props: ['keepAlive'], 5 | render (h, { parent, data, props }) { 6 | data.nuxtChild = true 7 | const _parent = parent 8 | const transitions = parent.$nuxt.nuxt.transitions 9 | const defaultTransition = parent.$nuxt.nuxt.defaultTransition 10 | 11 | let depth = 0 12 | while (parent) { 13 | if (parent.$vnode && parent.$vnode.data.nuxtChild) { 14 | depth++ 15 | } 16 | parent = parent.$parent 17 | } 18 | data.nuxtChildDepth = depth 19 | const transition = transitions[depth] || defaultTransition 20 | let transitionProps = {} 21 | transitionsKeys.forEach((key) => { 22 | if (typeof transition[key] !== 'undefined') { 23 | transitionProps[key] = transition[key] 24 | } 25 | }) 26 | let listeners = {} 27 | listenersKeys.forEach((key) => { 28 | if (typeof transition[key] === 'function') { 29 | listeners[key] = transition[key].bind(_parent) 30 | } 31 | }) 32 | // Add triggerScroll event on beforeEnter (fix #1376) 33 | let beforeEnter = listeners.beforeEnter 34 | listeners.beforeEnter = (el) => { 35 | window.$nuxt.$emit('triggerScroll') 36 | if (beforeEnter) return beforeEnter.call(_parent, el) 37 | } 38 | 39 | let routerView = [ 40 | h('router-view', data) 41 | ] 42 | if (typeof props.keepAlive !== 'undefined') { 43 | routerView = [ 44 | h('keep-alive', routerView) 45 | ] 46 | } 47 | return h('transition', { 48 | props: transitionProps, 49 | on: listeners 50 | }, routerView) 51 | } 52 | } 53 | 54 | const transitionsKeys = [ 55 | 'name', 56 | 'mode', 57 | 'appear', 58 | 'css', 59 | 'type', 60 | 'duration', 61 | 'enterClass', 62 | 'leaveClass', 63 | 'appearClass', 64 | 'enterActiveClass', 65 | 'enterActiveClass', 66 | 'leaveActiveClass', 67 | 'appearActiveClass', 68 | 'enterToClass', 69 | 'leaveToClass', 70 | 'appearToClass' 71 | ] 72 | 73 | const listenersKeys = [ 74 | 'beforeEnter', 75 | 'enter', 76 | 'afterEnter', 77 | 'enterCancelled', 78 | 'beforeLeave', 79 | 'leave', 80 | 'afterLeave', 81 | 'leaveCancelled', 82 | 'beforeAppear', 83 | 'appear', 84 | 'afterAppear', 85 | 'appearCancelled' 86 | ] 87 | -------------------------------------------------------------------------------- /components/upload.vue: -------------------------------------------------------------------------------- 1 | 8 | 60 | -------------------------------------------------------------------------------- /components/subitem.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | 25 | 94 | -------------------------------------------------------------------------------- /src/svg/calendar.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.nuxt/components/nuxt-error.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 45 | 46 | 91 | -------------------------------------------------------------------------------- /components/chart.vue: -------------------------------------------------------------------------------- 1 | 6 | 64 | 65 | 75 | -------------------------------------------------------------------------------- /components/home/sub.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | 20 | 95 | -------------------------------------------------------------------------------- /src/svg/video.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /components/repo/related.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 27 | 28 | 29 | 94 | -------------------------------------------------------------------------------- /.nuxt/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | // Recursive find files in {srcDir}/{dir.store} 7 | const files = require.context('@/store', true, /^\.\/(?!-)[^.]+\.(js)$/) 8 | const filenames = files.keys() 9 | 10 | // Store 11 | let storeData = {} 12 | 13 | // Check if {dir.store}/index.js exists 14 | let indexFilename 15 | filenames.forEach((filename) => { 16 | if (filename.indexOf('./index.') !== -1) { 17 | indexFilename = filename 18 | } 19 | }) 20 | if (indexFilename) { 21 | storeData = getModule(indexFilename) 22 | } 23 | 24 | // If store is not an exported method = modules store 25 | if (typeof storeData !== 'function') { 26 | 27 | // Store modules 28 | if (!storeData.modules) { 29 | storeData.modules = {} 30 | } 31 | 32 | for (let filename of filenames) { 33 | let name = filename.replace(/^\.\//, '').replace(/\.(js)$/, '') 34 | if (name === 'index') continue 35 | 36 | let namePath = name.split(/\//) 37 | let module = getModuleNamespace(storeData, namePath) 38 | 39 | name = namePath.pop() 40 | module[name] = getModule(filename) 41 | module[name].namespaced = true 42 | } 43 | 44 | } 45 | 46 | // createStore 47 | export const createStore = storeData instanceof Function ? storeData : () => { 48 | return new Vuex.Store(Object.assign({ 49 | strict: (process.env.NODE_ENV !== 'production'), 50 | }, storeData, { 51 | state: storeData.state instanceof Function ? storeData.state() : {} 52 | })) 53 | } 54 | 55 | // Dynamically require module 56 | function getModule (filename) { 57 | const file = files(filename) 58 | const module = file.default || file 59 | if (module.commit) { 60 | throw new Error('[nuxt] store/' + filename.replace('./', '') + ' should export a method which returns a Vuex instance.') 61 | } 62 | if (module.state && typeof module.state !== 'function') { 63 | throw new Error('[nuxt] state should be a function in store/' + filename.replace('./', '')) 64 | } 65 | return module 66 | } 67 | 68 | function getModuleNamespace (storeData, namePath) { 69 | if (namePath.length === 1) { 70 | return storeData.modules 71 | } 72 | let namespace = namePath.shift() 73 | storeData.modules[namespace] = storeData.modules[namespace] || {} 74 | storeData.modules[namespace].namespaced = true 75 | storeData.modules[namespace].modules = storeData.modules[namespace].modules || {} 76 | return getModuleNamespace(storeData.modules[namespace], namePath) 77 | } 78 | -------------------------------------------------------------------------------- /components/pagination.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 55 | 56 | 89 | -------------------------------------------------------------------------------- /.nuxt/components/nuxt-loading.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 89 | 90 | 104 | -------------------------------------------------------------------------------- /components/repo/line-item.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 32 | 33 | 91 | -------------------------------------------------------------------------------- /src/svg/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/book.svg: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------