良い感じに
This commit is contained in:
parent
39e4494836
commit
1c84c0828e
@ -4,10 +4,9 @@
|
|||||||
<p class="empty" v-else-if="tags.length == 0">%fa:exclamation-circle%%i18n:@empty%</p>
|
<p class="empty" v-else-if="tags.length == 0">%fa:exclamation-circle%%i18n:@empty%</p>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<vue-word-cloud
|
<vue-word-cloud
|
||||||
:words="tags.map(x => [x.name, x.count])"
|
:words="tags.slice(0, 20).map(x => [x.name, x.count])"
|
||||||
:color="color"
|
:color="color"
|
||||||
:spacing="0.25"
|
:spacing="1">
|
||||||
font-family="Roboto">
|
|
||||||
<template slot-scope="{word, text, weight}">
|
<template slot-scope="{word, text, weight}">
|
||||||
<div style="cursor: pointer;" :title="weight">
|
<div style="cursor: pointer;" :title="weight">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
@ -51,7 +50,7 @@ export default Vue.extend({
|
|||||||
const peak = Math.max.apply(null, this.tags.map(x => x.count));
|
const peak = Math.max.apply(null, this.tags.map(x => x.count));
|
||||||
const w = weight / peak;
|
const w = weight / peak;
|
||||||
|
|
||||||
if (w == 1) {
|
if (w > 0.9) {
|
||||||
return this.$store.state.device.darkmode ? '#ff4e69' : '#ff4e69';
|
return this.$store.state.device.darkmode ? '#ff4e69' : '#ff4e69';
|
||||||
} else if (w > 0.5) {
|
} else if (w > 0.5) {
|
||||||
return this.$store.state.device.darkmode ? '#3bc4c7' : '#3bc4c7';
|
return this.$store.state.device.darkmode ? '#3bc4c7' : '#3bc4c7';
|
||||||
|
Loading…
Reference in New Issue
Block a user