11<template >
22 <li class =" news-item" >
3- <span class =" score" >{{ item.score }}</span >
4- <span class =" title" >
5- <template v-if =" item .url " >
6- <router-link :to =" '/item/' + item.id" >{{ item.title }}</router-link >
7- <span class =" host" > ({{ item.url | host }})</span >
8- </template >
9- <template v-else >
10- <router-link :to =" '/item/' + item.id" >{{ item.title }}</router-link >
11- </template >
3+ <span class =" mainscore" >
4+ <span class =" score" >{{ item.score }}</span >
125 </span >
13- <br >
14- <span class =" meta" >
15- <span v-if =" item.type !== 'job'" class =" by" >
16- by <router-link :to =" '/user/' + item.by" >{{ item.by }}</router-link >
6+ <span class =" mainspacer" ></span >
7+ <span class =" mainitem" >
8+ <span class =" title" >
9+ <template v-if =" item .url " >
10+ <router-link :to =" '/item/' + item.id" >{{ item.title }}</router-link >
11+ <span class =" host" > ({{ item.url | host }})</span >
12+ </template >
13+ <template v-else >
14+ <router-link :to =" '/item/' + item.id" >{{ item.title }}</router-link >
15+ </template >
1716 </span >
18- <span class =" time" >
19- {{ item.time | timeAgo }} ago
20- </span >
21- <span v-if =" item.type !== 'job'" class =" comments-link" >
22- | <router-link :to =" '/item/' + item.id" >{{ item.descendants }} comments</router-link >
17+ <br >
18+ <span class =" meta" >
19+ <span v-if =" item.type !== 'job'" class =" by" >
20+ by <router-link :to =" '/user/' + item.by" >{{ item.by }}</router-link >
21+ </span >
22+ <span class =" time" >
23+ {{ item.time | timeAgo }} ago
24+ </span >
25+ <span v-if =" item.type !== 'job'" class =" comments-link" >
26+ | {{ item.descendants }} comments
27+ </span >
2328 </span >
29+ <span class =" label" v-if =" item.type !== 'story' && item.type !== 'job'" >{{ item.type }}</span >
30+ <span class =" label" v-if =" item.type == 'job'" ><span class =" job" >{{ item.type }}</span ></span >
2431 </span >
25- <span class =" label" v-if =" item.type !== 'story'" >{{ item.type }}</span >
2632 </li >
2733</template >
2834
@@ -40,24 +46,32 @@ export default {
4046 </script >
4147
4248<style lang="stylus">
49+ .mainitem
50+ flex 96%
51+ display inline-block
52+
53+ .mainscore
54+ flex 3%
55+ display inline-block
56+ text-align right
57+
58+ .mainspacer
59+ flex 1%
60+
4361.news-item
62+ display flex
4463 background-color #34 3a 40
45- padding 2 % 1.5% 2 % 7 %
64+ padding 1.5%
4665 border-bottom 1px solid #e e e
4766 position relative
48- line-height 20 px
67+ line-height 22 px
4968 a
5069 color white
5170 .score
71+ width 100%
5272 color #ff 66 00
5373 font-size 1.1em
5474 font-weight 700
55- position absolute
56- top 50%
57- left 0
58- width 80px
59- text-align center
60- margin-top - 10px
6175 .meta , .host
6276 font-size .85em
6377 color white
@@ -67,17 +81,25 @@ export default {
6781 & :hover
6882 color #ff 66 00
6983
70- @media (max-width 1500px )
71- .news-item
72- padding-left 10%
84+ .job {
85+ color white
86+ background-color #f 6 0
87+ padding 0.1%
88+ margin 0.1%
89+ }
7390
74- @media (max-width 1100 px )
75- .news-item
76- padding-left 15 %
91+ @media (max-width 1400 px )
92+ .mainitem
93+ width 93 %
7794
78- @media (max-width 400px )
79- .score
95+ .mainscore
96+ width 7%
97+
98+ @media (max-width 600px )
99+ .mainitem
100+ width 100%
101+
102+ .mainscore
103+ width 0%
80104 visibility hidden
81- .news-item
82- padding-left 1%
83105 </style >
0 commit comments