diff options
| author | Henry Jameson <me@hjkos.com> | 2021-02-01 19:39:57 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-02-01 19:39:57 +0200 |
| commit | 8958f386bef9317ff5782fa0f16164d7fbc2af21 (patch) | |
| tree | 8c33fed5331c18023d608fbb366c464783559220 /src/components/favorite_button/favorite_button.vue | |
| parent | e695506c514e49964dfd81c7db5c5b4d4918f47d (diff) | |
| parent | de66267a07eb018cc0309ff6f9dd896d53ba3ff4 (diff) | |
Merge remote-tracking branch 'origin/develop' into settings-changed
* origin/develop: (306 commits)
fallback if shadows aren't defined
Translated using Weblate (Chinese (Traditional))
Translated using Weblate (Ukrainian)
Translated using Weblate (Italian)
Translated using Weblate (Ukrainian)
Translated using Weblate (Portuguese)
Translated using Weblate (Italian)
Translated using Weblate (Russian)
Translated using Weblate (Portuguese)
Translated using Weblate (Russian)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
Translated using Weblate (Portuguese)
...
Diffstat (limited to 'src/components/favorite_button/favorite_button.vue')
| -rw-r--r-- | src/components/favorite_button/favorite_button.vue | 70 |
1 files changed, 46 insertions, 24 deletions
diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index fbc90f84..dce25e24 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -1,20 +1,31 @@ <template> - <div v-if="loggedIn"> - <i - :class="classes" - class="button-icon favorite-button fav-active" + <div class="FavoriteButton"> + <button + v-if="loggedIn" + class="button-unstyled interactive" + :class="status.favorited && '-favorited'" :title="$t('tool_tip.favorite')" @click.prevent="favorite()" - /> - <span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span> - </div> - <div v-else> - <i - :class="classes" - class="button-icon favorite-button" - :title="$t('tool_tip.favorite')" - /> - <span v-if="!mergedConfig.hidePostStats && status.fave_num > 0">{{ status.fave_num }}</span> + > + <FAIcon + class="fa-scale-110 fa-old-padding" + :icon="[status.favorited ? 'fas' : 'far', 'star']" + :spin="animated" + /> + </button> + <span v-else> + <FAIcon + class="fa-scale-110 fa-old-padding" + :title="$t('tool_tip.favorite')" + :icon="['far', 'star']" + /> + </span> + <span + v-if="!mergedConfig.hidePostStats && status.fave_num > 0" + class="action-counter" + > + {{ status.fave_num }} + </span> </div> </template> @@ -23,18 +34,29 @@ <style lang="scss"> @import '../../_variables.scss'; -.fav-active { - cursor: pointer; - animation-duration: 0.6s; +.FavoriteButton { + display: flex; - &:hover { - color: $fallback--cOrange; - color: var(--cOrange, $fallback--cOrange); + > :first-child { + padding: 10px; + margin: -10px -8px -10px -10px; } -} -.favorite-button.icon-star { - color: $fallback--cOrange; - color: var(--cOrange, $fallback--cOrange); + .action-counter { + pointer-events: none; + user-select: none; + } + + .interactive { + .svg-inline--fa { + animation-duration: 0.6s; + } + + &:hover .svg-inline--fa, + &.-favorited .svg-inline--fa { + color: $fallback--cOrange; + color: var(--cOrange, $fallback--cOrange); + } + } } </style> |
