Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 58 additions & 31 deletions nuxt/components/StoreCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,8 @@
>
</v-img>
</div>
<div class="score">
<vote-button :isUpvoting="true" :store="store" />
<span>
{{ Number(store.upvotes - store.downvotes).toLocaleString() }}</span
>
<vote-button :isUpvoting="false" :store="store" />
</div>
<div class="content pa-2 pl-5">

<div class="detail-bottom">
<div @click="gotoStore(store)">
<div class="title">
<a :href="getStoreLink(store.href)" class="font-weight-regular">
Expand All @@ -59,6 +53,15 @@
</div>
<div class="description">{{ store.description }}</div>
</div>
</div>
<div class="score">
<vote-button :isUpvoting="true" :store="store" />
<span>
{{ formatNumberVotes(Number(store.upvotes - store.downvotes)) }}</span
>
<!-- <vote-button :isUpvoting="false" :store="store" /> -->
</div>
<div class="content pa-2 pl-5">
<div>
<div class="tag-container">
<v-chip
Expand Down Expand Up @@ -138,6 +141,19 @@ export default {
return state.baseURL
},
}),
formatNumberVotes() {
return (value) => {
if (Math.abs(value) > 999999) {
return (Math.sign(value)*((Math.abs(value)/1000000).toFixed(1)) + 'M')

} else if((Math.abs(value) > 999)) {
return (Math.sign(value)*((Math.abs(value)/1000).toFixed(1)) + 'K')

} else {
return Math.sign(value)*Math.abs(value)
}
}
},
},
methods: {
getStoreLink(link) {
Expand Down Expand Up @@ -171,22 +187,50 @@ export default {
.detail {
color: #000000de;
display: grid;
grid-template-rows: 200px 150px;
grid-template-rows: 200px 120px;
grid-template-columns: 80px 1fr;
row-gap: 4px;

.screenshot {
grid-column: 1 / 3;
}

.detail-bottom {
position: relative;
overflow: hidden;
text-overflow: ellipsis;
grid-column: 1 / 3;
padding: 5px 50px 5px 20px;

.title {
font-size: 1.7rem !important;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
.description {
font-size: 14px !important;
margin-top: 5px;
}
}
.score {
display: grid;
grid: 1fr;
justify-items: center;
padding: 5px;
display: flex;
justify-content: left;
align-items: center;
padding: 10px;
font-size: 15px !important;

span {
display: block;
padding-left: 5px;
}
.arrow {
border: 1px solid;
Expand All @@ -205,24 +249,7 @@ export default {
position: relative;
overflow: hidden;
text-overflow: ellipsis;
.title {
font-size: 1.7rem !important;

white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
.description {
font-size: 14px !important;
margin-top: 5px;
}

.tag-container {
position: absolute;
bottom: 8px;
Expand Down
4 changes: 2 additions & 2 deletions nuxt/components/VoteButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
</template>
<template v-else>
<span v-if="isUpvoting" @click="showDialog = true">
<v-icon width="100%" class="arrow up" color="green"
<v-icon width="100%" size="16" class="arrow up" color="green"
>mdi-arrow-up</v-icon
></span
>
<span v-else @click="showDialog = true">
<v-icon width="100%" class="arrow down" color="red"
<v-icon width="100%" size="16" class="arrow down" color="red"
>mdi-arrow-down</v-icon
>
</span>
Expand Down