Some initial work on replacing icons with FA5
This commit is contained in:
parent
350f25016f
commit
3814218277
34 changed files with 528 additions and 245 deletions
|
@ -1,4 +1,14 @@
|
|||
import { mapGetters } from 'vuex'
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faStar } from '@fortawesome/free-solid-svg-icons'
|
||||
import {
|
||||
faStar as faStarRegular
|
||||
} from '@fortawesome/free-regular-svg-icons'
|
||||
|
||||
library.add(
|
||||
faStar,
|
||||
faStarRegular
|
||||
)
|
||||
|
||||
const FavoriteButton = {
|
||||
props: ['status', 'loggedIn'],
|
||||
|
@ -23,9 +33,7 @@ const FavoriteButton = {
|
|||
computed: {
|
||||
classes () {
|
||||
return {
|
||||
'icon-star-empty': !this.status.favorited,
|
||||
'icon-star': this.status.favorited,
|
||||
'animate-spin': this.animated
|
||||
'-favorited': this.status.favorited
|
||||
}
|
||||
},
|
||||
...mapGetters(['mergedConfig'])
|
||||
|
|
|
@ -1,18 +1,23 @@
|
|||
<template>
|
||||
<div v-if="loggedIn">
|
||||
<i
|
||||
<FAIcon
|
||||
:class="classes"
|
||||
class="button-icon favorite-button fav-active"
|
||||
class="FavoriteButton button-icon -interactive"
|
||||
:title="$t('tool_tip.favorite')"
|
||||
:icon="[status.favorited ? 'fas' : 'far', 'star']"
|
||||
:spin="animated"
|
||||
size="lg"
|
||||
@click.prevent="favorite()"
|
||||
/>
|
||||
<span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<i
|
||||
<FAIcon
|
||||
:class="classes"
|
||||
class="button-icon favorite-button"
|
||||
class="FavoriteButton button-icon"
|
||||
:title="$t('tool_tip.favorite')"
|
||||
:icon="['far', 'star']"
|
||||
size="lg"
|
||||
/>
|
||||
<span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span>
|
||||
</div>
|
||||
|
@ -23,18 +28,20 @@
|
|||
<style lang="scss">
|
||||
@import '../../_variables.scss';
|
||||
|
||||
.fav-active {
|
||||
cursor: pointer;
|
||||
animation-duration: 0.6s;
|
||||
.FavoriteButton {
|
||||
&.-interactive {
|
||||
cursor: pointer;
|
||||
animation-duration: 0.6s;
|
||||
|
||||
&:hover {
|
||||
&:hover {
|
||||
color: $fallback--cOrange;
|
||||
color: var(--cOrange, $fallback--cOrange);
|
||||
}
|
||||
}
|
||||
|
||||
&.-favorited {
|
||||
color: $fallback--cOrange;
|
||||
color: var(--cOrange, $fallback--cOrange);
|
||||
}
|
||||
}
|
||||
|
||||
.favorite-button.icon-star {
|
||||
color: $fallback--cOrange;
|
||||
color: var(--cOrange, $fallback--cOrange);
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue