Skip to content

Commit d03c81e

Browse files
committed
update styling
1 parent 318ef02 commit d03c81e

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

dist/js/tab.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/components/Tab.vue

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,20 @@
2424
<div v-if="!is_loading && !questions.length" class="text-gray-500 py-2">
2525
No questions found for your query "{{this.query}}".
2626
</div>
27-
<article v-if="!is_loading && questions.length" v-for="question of questions" class="mb-2 p-2 border-l-4 border-gray-400 hover:border-orange-500 rounded bg-gray-100">
27+
<article v-if="!is_loading && questions.length" v-for="question of questions" class="mb-2 p-2 border-l-8 border-gray-400 hover:border-orange-500 rounded bg-gray-100">
2828
<div class="flex">
2929
<div class="flex-grow">
30-
<a :href="question.link" target="_blank" class="block font-medium hover:text-orange-500" v-html="question.title"></a>
30+
<a :href="question.link" target="_blank" class="block hover:text-orange-500">
31+
<h3 v-html="question.title" class="font-bold"></h3>
32+
</a>
33+
3134
<div class="text-gray-400">
32-
last activity at
33-
<time :datetime="question.last_activity_date|moment('YYYY-MM-DD HH:mm:ss')" class="text-gray-500">
34-
{{question.last_activity_date|moment('YYYY-MM-DD')}}
35-
</time>
36-
and created by
37-
<a :href="question.owner.link" target="_blank" class="text-gray-500 hover:text-orange-500">
35+
asked by
36+
<a :href="question.owner.link" target="_blank" class="font-semibold text-blue-400 hover:text-blue-500">
3837
{{question.owner.display_name}}
3938
</a>
4039
at
41-
<time :datetime="question.creation_date|moment('YYYY-MM-DD HH:mm:ss')" class="text-gray-500">
40+
<time :datetime="question.creation_date|moment('YYYY-MM-DD HH:mm:ss')" class="font-medium text-gray-500">
4241
{{question.creation_date|moment('YYYY-MM-DD')}}
4342
</time>
4443
</div>
@@ -47,13 +46,30 @@
4746
<span v-for="tag of question.tags" class="mr-1 px-1 py-px bg-gray-200 text-gray-500 rounded">{{tag}}</span>
4847
</div>
4948
</div>
50-
<div class="px-2 pt-2 text-center">
51-
<span class="block text-lg text-gray-500">{{question.score}}</span>
52-
<span class="text-gray-400">score</span>
49+
<div class="ml-2">
50+
<div
51+
class="p-2 text-center border border-transparent"
52+
v-bind:class="{
53+
'text-gray-400': question.score == 0,
54+
'text-red-400': question.score < 0,
55+
'text-gray-500': question.score > 0,
56+
}"
57+
>
58+
<span class="block text-lg">{{question.score}}</span>
59+
<span>votes</span>
60+
</div>
5361
</div>
54-
<div class="px-2 pt-2 text-center">
55-
<span class="block text-lg text-gray-500">{{question.answer_count}}</span>
56-
<span class="text-gray-400">answers</span>
62+
<div class="ml-2">
63+
<div
64+
class="p-2 text-center border border-green-400 rounded"
65+
v-bind:class="{
66+
'text-green-400': !question.is_answered,
67+
'text-white bg-green-400': question.is_answered,
68+
}"
69+
>
70+
<span class="block text-lg">{{question.answer_count}}</span>
71+
<span>answers</span>
72+
</div>
5773
</div>
5874
</div>
5975
</article>
@@ -126,7 +142,7 @@
126142
127143
this.is_loading = true;
128144
axios
129-
.get('https://api.stackexchange.com/2.2/search/advanced?&pagesize=10&order=desc&sort=relevance&site=stackoverflow&accepted=True&page='+this.page+'&q='+encodeURIComponent(this.query))
145+
.get('https://api.stackexchange.com/2.2/search/advanced?&pagesize=10&order=desc&sort=relevance&site=stackoverflow&answers=1&page='+this.page+'&q='+encodeURIComponent(this.query))
130146
.then(response => {
131147
this.questions = response.data.items;
132148
this.is_loading = false;

0 commit comments

Comments
 (0)