more eye candy
This commit is contained in:
parent
dafc8c66fd
commit
c1f25d008b
3 changed files with 12 additions and 2 deletions
|
@ -205,7 +205,6 @@ export default class {
|
||||||
count: elements[element]
|
count: elements[element]
|
||||||
})
|
})
|
||||||
|
|
||||||
retval = retval.filter(element => element.count > 0)
|
|
||||||
retval.sort((element_l, element_r) => element_r.count - element_l.count)
|
retval.sort((element_l, element_r) => element_r.count - element_l.count)
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<svg
|
<svg
|
||||||
:height="size + 'px'"
|
:height="size + 'px'"
|
||||||
:width="16 / 30 * size + 'px'"
|
:width="(16 / 30) * size + 'px'"
|
||||||
viewBox="0 0 16 30"
|
viewBox="0 0 16 30"
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
>
|
>
|
||||||
|
@ -18,6 +18,8 @@
|
||||||
font-family="sans-serif"
|
font-family="sans-serif"
|
||||||
fill="white"
|
fill="white"
|
||||||
font-weight="bold"
|
font-weight="bold"
|
||||||
|
transform-origin="center center"
|
||||||
|
:transform="`scale(${this.xscale},1)`"
|
||||||
>
|
>
|
||||||
{{ cost }}
|
{{ cost }}
|
||||||
</text>
|
</text>
|
||||||
|
@ -55,6 +57,14 @@ export default {
|
||||||
default:
|
default:
|
||||||
return '#333'
|
return '#333'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
xscale() {
|
||||||
|
if (typeof this.cost !== 'undefined') {
|
||||||
|
let len = this.cost.toString().length
|
||||||
|
return Math.pow(0.7, len - 1)
|
||||||
|
}
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<Crystal
|
<Crystal
|
||||||
v-for="element in deck.elements()"
|
v-for="element in deck.elements()"
|
||||||
:size="40"
|
:size="40"
|
||||||
|
:cost="element.count"
|
||||||
:element="element.name"
|
:element="element.name"
|
||||||
:key="element.name"
|
:key="element.name"
|
||||||
/>
|
/>
|
||||||
|
|
Reference in a new issue