├── 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 | 2 | div.topic-list 3 | 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 | 2 | div.main-area 3 | nuxt-child 4 | 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 | 2 | div 3 | p Awesomes.cn 于2015年7月9日开始开发 4 | 5 | p 2015年7月30日 Awesomes.cn 域名备案成功 6 | 7 | p 2015年8月5日 Awesomes.cn 正式上线 8 | 9 | p 2015年8月25日网站正式开源在 GitHub 上 10 | 11 | p 后续不断开发中,如果你有好的想法和建议,欢迎你向我们提出来 12 | 13 | 17 | 18 | 20 | -------------------------------------------------------------------------------- /pages/site/capa.vue: -------------------------------------------------------------------------------- 1 | 2 | div 3 | h3 4 | a(href="http://www.siaa.org.cn/") 中国信息无障碍产品联盟 5 | p Awesomes.cn 创立的宗旨是开源开放,为web开发提供高质量的资源,我们支持任何形式的有利于促进web发展的技术和组织,我们愿与中国信息无障碍产品联盟一起推广信息无障碍的发展和普及 6 | p 开发者若有兴趣了解信息无障碍相关的更多内容,可联系:梁振宇,Link@siaa.org.cn 7 | 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 | 2 | div(:class="'page-' + mypage") 3 | div.body 4 | nuxt 5 | 6 | 7 | 21 | 22 | 24 | -------------------------------------------------------------------------------- /pages/admin/mem/mems.vue: -------------------------------------------------------------------------------- 1 | 2 | div 3 | list(table="mem" v-bind:keys="keys") 4 | 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 | 2 | div 3 | h1 {{mol}} 4 | upload(v-model="mol" folder="repo") 5 | 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 | 2 | div 3 | p 4 | span Github: 5 | a(href="https://github.com/awesomes-cn" target="_blank") https://github.com/awesomes-cn 6 | 7 | p 8 | span 新浪微博: 9 | a(href="http://weibo.com/awesomescn" target="_blank") http://weibo.com/awesomescn 10 | 11 | p 12 | span Twitter: 13 | a(href="https://twitter.com/awesomescn" target="_blank") https://twitter.com/awesomescn 14 | 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 | 10 | -------------------------------------------------------------------------------- /src/svg/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/svg/send.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /layouts/error.vue: -------------------------------------------------------------------------------- 1 | 2 |' +
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 |
2 | div.swiper-container(:id="'swiper-instance-' + flag")
3 | div.swiper-wrapper
4 | div.swiper-slide(v-for="item in items" href="http://www.baidu.com")
5 | nuxt-link.swiper-item(:to="item.link" v-bind:style="'background-image:url(' + cdn(item.img, 'repo') + ')'")
6 | div.slide-title
7 | h4 {{item.title}}
8 | div.swiper-pagination
9 | // div.swiper-button-next
10 | // div.swiper-button-prev
11 |
12 |
13 |
31 |
32 |
71 |
--------------------------------------------------------------------------------
/src/svg/comment.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/topics.vue:
--------------------------------------------------------------------------------
1 |
2 | div.topics-wraper
3 | div.container
4 | div.row
5 | div.col-md-7
6 | topics(:topics="topicList")
7 |
8 | div.col-md-5
9 | nuxt-link(to="topic/new" class="card")
10 | h4 我要发布
11 |
12 |
13 |
14 |
15 |
35 |
36 |
37 |
89 |
--------------------------------------------------------------------------------
/components/topic/list.vue:
--------------------------------------------------------------------------------
1 |
2 | div
3 | div.topic-list(v-for="topic in topics")
4 | div.topic-item
5 | div.extras
6 | nuxt-link(to="")
7 | img.mem-tx(:src="cdn(topic.mem.avatar, 'mem')")
8 | span {{topic.mem.nc}}
9 | span 发布于 {{timeago(topic.created_at)}}
10 | nuxt-link(:to="'topic/' + topic.id")
11 | div.cover(v-bind:style="'background-image:url(' + cdn(topic.cover, 'topic') + ')'")
12 | h2 {{topic.title}}
13 | div.extras
14 | span
15 | icon(name="eye-o" width="18px") {{topic.visit}} 次阅读
16 | span
17 | icon(name="heart-o" width="18px") {{topic.favor}} 人喜欢
18 | span
19 | icon(name="comment" width="18px") {{topic.comment > 0 ? topic.comment + ' 条评论' : '暂无评论'}}
20 |
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 |
2 | div.container
3 | template(v-if="usings.length > 0")
4 | div.row
5 | div.col-md-3.col-sm-3.col-4(v-for="oper in usings")
6 | nuxt-link(:to="'/repo/' + oper.repo.owner + '/' + oper.repo.alia" class="repo-item")
7 | div.cover-box
8 | img.cover(:src="cdn(oper.repo.cover, 'repo', 'subject_repo')")
9 | span.usingmems {{oper.repo.using}}
10 | h5 {{oper.repo.alia}}
11 | template(v-else)
12 | h2.noitem 没有在用前端库
13 |
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 |
2 | div.container.topic-container
3 | div.banner
4 | div.extras
5 | nuxt-link(to="")
6 | img.mem-tx(:src="cdn(topic.mem.avatar, 'mem')")
7 | span {{topic.mem.nc}}
8 | span 发布于 {{timeago(topic.created_at)}}
9 | img.cover(:src="cdn(topic.cover, 'topic')")
10 | h3 {{topic.title}}
11 | div.extras
12 | span
13 | icon(name="eye-o") {{topic.visit}} 次阅读
14 | span
15 | icon(name="heart-o") {{topic.favor}} 人喜欢
16 | span
17 | icon(name="comment") {{topic.comment > 0 ? topic.comment + ' 条评论' : '暂无评论'}}
18 | article(v-html="marked(topic.con)")
19 |
20 |
21 |
22 |
34 |
35 |
86 |
--------------------------------------------------------------------------------
/layouts/admin.vue:
--------------------------------------------------------------------------------
1 |
2 | div(:class="'main-in page-' + mypage")
3 | alert(v-show="alertData.show" v-bind:msg="alertData.msg" v-bind:type="alertData.type")
4 | div.admin-header
5 | nuxt-link(to="/admin/mem/mems") 会员
6 | nuxt-link(to="/admin/pub/submits") 发布
7 | nuxt-link(to="/admin/site/webkerapply") 站点
8 | div.body
9 | div.left-menu
10 | template(v-if="rouname === 'mem'")
11 | nuxt-link(to="/admin/mem/mems") 会员
12 | template(v-if="rouname === 'pub'")
13 | nuxt-link(to="/admin/pub/submits") 前端库提交
14 | nuxt-link(to="/admin/pub/comments") 评论
15 | template(v-if="rouname === 'site'")
16 | nuxt-link(to="/admin/site/webkerapply") 情报员申请
17 | nuxt
18 |
19 |
20 |
47 |
48 |
88 |
--------------------------------------------------------------------------------
/pages/webker.vue:
--------------------------------------------------------------------------------
1 |
2 | div.webker-wrap
3 | div.outerwap
4 | div.inner
5 | div.banner
6 | h2 前端客
7 | article
8 | p 客:古有侠客,一般指行侠仗义的大侠。
9 | p 这里有两层含义,第一得有真功夫,第二得有侠义之心。
10 | p 于是我们便采用了这个 “客”,赋予前端开发者一个特殊的身份,便是 “前端客” 了。
11 |
12 | h4 权利
13 | p 1、发布情报
14 | p 2、发布前端库的经验
15 |
16 | h4 申请条件
17 | p GitHub 关注数 >= 100 (非硬性规定,在大厂工作或其它特殊原因可无视该条件)
18 | p 不发布垃圾无用的信息
19 |
20 | h4 我要申请
21 | template(v-if="session && session.iswebker === 'YES'")
22 | div.alert.alert-info 你目前已经是前端客
23 |
24 | template(v-if="!session || session.iswebker === 'NO'")
25 | div.form-group
26 | textarea.form-control(placeholder="申请说明(选填)" v-model="con")
27 | div.form-group
28 | button.btn.btn-danger(@click="apply") 提交申请
29 |
30 |
31 |
61 |
62 |
91 |
--------------------------------------------------------------------------------
/src/svg/tip.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/pages/mem/_id/pubs/comments.vue:
--------------------------------------------------------------------------------
1 |
2 | div
3 | template(v-if="comments.length > 0")
4 | div.comments
5 | div.com-item(v-for="item in comments")
6 | div.up
7 | icon(name="arrow-up") {{item.favor}}
8 | div.right
9 | article(v-html="processAt(marked(item.con))")
10 | span.time {{timeago(item.created_at)}}
11 | pagination(flag="comments-list" v-bind:total="pagetotal" v-bind:size="pagesize")
12 | template(v-else)
13 | h2.noitem 尚未发布评论
14 |
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 |
2 |
3 |
7 |
8 |
60 |
--------------------------------------------------------------------------------
/components/subitem.vue:
--------------------------------------------------------------------------------
1 |
2 | div.sub-item
3 | nuxt-link(:to="'/subject/' + sub.key" v-bind:style="'background-image:url(' + cdn(sub.cover, 'subject', 'subject') + ')'")
4 | div.detail
5 | h2 {{sub.title}}
6 | // article {{sub.sdesc}}
7 |
8 | div.total
9 | // span 共 {{sub.amount}} 个库
10 | span 共 43 个库
11 |
12 |
13 |
14 |
24 |
25 |
94 |
--------------------------------------------------------------------------------
/src/svg/calendar.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.nuxt/components/nuxt-error.vue:
--------------------------------------------------------------------------------
1 |
2 |