Commit 4b4b685a authored by Sébastien Chopin's avatar Sébastien Chopin

chore(UI): Lifting

parent 48e7f541
<svg width="96" height="72" viewBox="0 0 96 72" version="1" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="M6 66h23l1-3 21-37L40 6 6 66zM79 66h11L62 17l-5 9 22 37v3zM54 31L35 66h38z"/>
<path d="M29 69v-1-2H6L40 6l11 20 3-6L44 3s-2-3-4-3-3 1-5 3L1 63c0 1-2 3 0 6 0 1 2 2 5 2h28c-3 0-4-1-5-2z" fill="#00C58E"/>
<path d="M95 63L67 14c0-1-2-3-5-3-1 0-3 0-4 3l-4 6 3 6 5-9 28 49H79a5 5 0 0 1 0 3c-2 2-5 2-5 2h16c1 0 4 0 5-2 1-1 2-3 0-6z" fill="#108775"/>
<path d="M79 69v-1-2-3L57 26l-3-6-3 6-21 37-1 3a5 5 0 0 0 0 3c1 1 2 2 5 2h40s3 0 5-2zM54 31l19 35H35l19-35z" fill="#FFF" fill-rule="nonzero"/>
</g>
</svg>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<li class="news-item"> <li class="news-item">
<span class="score">{{ item.points }}</span> <span class="score">{{ item.points }}</span>
<span class="title"> <span class="title">
<template v-if="item.url"> <template v-if="isAbsolute(item.url)">
<a :href="item.url" target="_blank" rel="noopener">{{ item.title }}</a> <a :href="item.url" target="_blank" rel="noopener">{{ item.title }}</a>
<span class="host"> ({{ item.url | host }})</span> <span class="host"> ({{ item.url | host }})</span>
</template> </template>
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<router-link :to="'/item/' + item.id">{{ item.comments_count }} comments</router-link> <router-link :to="'/item/' + item.id">{{ item.comments_count }} comments</router-link>
</span> </span>
</span> </span>
<span v-if="item.type !== 'link'" class="label">{{ item.type }}</span>
</li> </li>
</template> </template>
...@@ -38,6 +37,11 @@ export default { ...@@ -38,6 +37,11 @@ export default {
type: Object, type: Object,
required: true required: true
} }
},
methods: {
isAbsolute(url) {
return /^https?:\/\//.test(url)
}
} }
} }
</script> </script>
...@@ -51,7 +55,7 @@ export default { ...@@ -51,7 +55,7 @@ export default {
line-height: 20px; line-height: 20px;
.score { .score {
color: #C75000; color: #00C48D;
font-size: 1.1em; font-size: 1.1em;
font-weight: 700; font-weight: 700;
position: absolute; position: absolute;
...@@ -71,7 +75,7 @@ export default { ...@@ -71,7 +75,7 @@ export default {
text-decoration: underline; text-decoration: underline;
&:hover { &:hover {
color: #C75000; color: #00C48D;
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<header class="header"> <header class="header">
<nav class="inner" role="navigation"> <nav class="inner" role="navigation">
<router-link to="/" exact> <router-link to="/" exact>
<img class="logo" src="~assets/logo.png" alt="logo"> <img class="logo" src="~/assets/logo.svg" alt="logo">
</router-link> </router-link>
<router-link v-for="(list, key) in feeds" :key="key" :to="`/${key}`"> <router-link v-for="(list, key) in feeds" :key="key" :to="`/${key}`">
{{ list.title }} {{ list.title }}
...@@ -46,17 +46,17 @@ body { ...@@ -46,17 +46,17 @@ body {
background-color: lighten(#eceef1, 30%); background-color: lighten(#eceef1, 30%);
margin: 0; margin: 0;
padding: 0; padding: 0;
color: #34495e; color: #2E495E;
overflow-y: scroll; overflow-y: scroll;
} }
a { a {
color: #34495e; color: #2E495E;
text-decoration: none; text-decoration: none;
} }
.header { .header {
background-color: #188269; background-color: #2E495E;
z-index: 999; z-index: 999;
height: 55px; height: 55px;
...@@ -83,7 +83,7 @@ a { ...@@ -83,7 +83,7 @@ a {
&.router-link-active, &.nuxt-link-active { &.router-link-active, &.nuxt-link-active {
color: #fff; color: #fff;
font-weight: 400; font-weight: 600;
} }
&:nth-child(6) { &:nth-child(6) {
......
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
}, },
loading: { loading: {
color: '#59cc93' color: '#00C48D'
}, },
manifest: { manifest: {
......
...@@ -29,19 +29,19 @@ ...@@ -29,19 +29,19 @@
"node": ">=8.0" "node": ">=8.0"
}, },
"dependencies": { "dependencies": {
"@nuxtjs/axios": "^5.3.0", "@nuxtjs/axios": "^5.5.0",
"nuxt-edge": "^2.5.0-25848007.21b1b865" "nuxt": "^2.7.1"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/pwa": "3.0.0-beta.8", "@nuxtjs/pwa": "3.0.0-beta.8",
"@nuxtjs/eslint-config": "^0.0.1", "@nuxtjs/eslint-config": "^0.0.1",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"eslint": "^5.14.1", "eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0", "eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0", "eslint-plugin-import": "^2.17.2",
"eslint-plugin-jest": "^22.3.0", "eslint-plugin-jest": "^22.6.4",
"eslint-plugin-node": "^8.0.1", "eslint-plugin-node": "^9.0.1",
"eslint-plugin-promise": "^4.0.1", "eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0", "eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^5.2.2", "eslint-plugin-vue": "^5.2.2",
"stylus": "^0.54.5", "stylus": "^0.54.5",
......
...@@ -65,6 +65,7 @@ export default { ...@@ -65,6 +65,7 @@ export default {
}, },
fetch({ store, params: { feed, page = 1 } }) { fetch({ store, params: { feed, page = 1 } }) {
page = Number(page) || 1
return store.dispatch('FETCH_FEED', { feed, page }) return store.dispatch('FETCH_FEED', { feed, page })
}, },
...@@ -80,7 +81,7 @@ export default { ...@@ -80,7 +81,7 @@ export default {
methods: { methods: {
pageChanged(to, from = -1) { pageChanged(to, from = -1) {
if (to < 0 || to > this.maxPage) { if (to <= 0 || to > this.maxPage) {
this.$router.replace(`/${this.feed}/1`) this.$router.replace(`/${this.feed}/1`)
return return
} }
......
...@@ -44,14 +44,14 @@ export default { ...@@ -44,14 +44,14 @@ export default {
computed: { computed: {
id() { id() {
return this.$route.query.id return this.$route.params.id
}, },
item() { item() {
return this.$store.state.items[this.id] return this.$store.state.items[this.id]
} }
}, },
fetch({ store, query: { id } }) { fetch({ store, params: { id } }) {
return store.dispatch('FETCH_ITEM', { id }) return store.dispatch('FETCH_ITEM', { id })
} }
} }
...@@ -73,6 +73,9 @@ export default { ...@@ -73,6 +73,9 @@ export default {
.host, .meta, .meta a { .host, .meta, .meta a {
color: #595959; color: #595959;
} }
.meta a:hover {
color: #00C48D;
}
.meta a { .meta a {
text-decoration: underline; text-decoration: underline;
......
import Vue from 'vue' import Vue from 'vue'
export function host(url) { export function host(url) {
const host = url.replace(/^https?:\/\//, '').replace(/\/.*$/, '') const host = url.replace(/^https?:\/\//, '').replace(/\/.*$/, '').replace('?id=', '/')
const parts = host.split('.').slice(-3) const parts = host.split('.').slice(-3)
if (parts[0] === 'www') parts.shift() if (parts[0] === 'www') parts.shift()
return parts.join('.') return parts.join('.')
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment