2016-10-30 15:12:35 +00:00
|
|
|
<template>
|
2020-11-26 16:23:53 +00:00
|
|
|
<div class="FavoriteButton">
|
2020-11-24 10:32:42 +00:00
|
|
|
<button
|
|
|
|
v-if="loggedIn"
|
2020-11-26 16:23:53 +00:00
|
|
|
class="button-unstyled interactive"
|
2020-11-24 10:32:42 +00:00
|
|
|
:class="status.favorited && '-favorited'"
|
2019-07-05 07:17:44 +00:00
|
|
|
:title="$t('tool_tip.favorite')"
|
|
|
|
@click.prevent="favorite()"
|
2020-11-24 10:32:42 +00:00
|
|
|
>
|
|
|
|
<FAIcon
|
|
|
|
class="fa-scale-110 fa-old-padding"
|
|
|
|
:icon="[status.favorited ? 'fas' : 'far', 'star']"
|
|
|
|
:spin="animated"
|
|
|
|
/>
|
|
|
|
</button>
|
2022-09-19 17:39:21 +00:00
|
|
|
<a
|
|
|
|
v-else
|
|
|
|
class="button-unstyled interactive"
|
|
|
|
target="_blank"
|
|
|
|
role="button"
|
|
|
|
:href="remoteInteractionLink"
|
|
|
|
>
|
2020-11-26 21:01:16 +00:00
|
|
|
<FAIcon
|
|
|
|
class="fa-scale-110 fa-old-padding"
|
|
|
|
:title="$t('tool_tip.favorite')"
|
|
|
|
:icon="['far', 'star']"
|
|
|
|
/>
|
2022-09-19 17:39:21 +00:00
|
|
|
</a>
|
2020-11-26 16:23:53 +00:00
|
|
|
<span
|
|
|
|
v-if="!mergedConfig.hidePostStats && status.fave_num > 0"
|
|
|
|
class="action-counter"
|
|
|
|
>
|
|
|
|
{{ status.fave_num }}
|
|
|
|
</span>
|
2016-10-30 15:12:35 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./favorite_button.js" ></script>
|
|
|
|
|
2018-04-01 02:28:20 +00:00
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2020-10-19 16:38:49 +00:00
|
|
|
.FavoriteButton {
|
2020-11-26 16:23:53 +00:00
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> :first-child {
|
|
|
|
padding: 10px;
|
2020-11-26 21:01:16 +00:00
|
|
|
margin: -10px -8px -10px -10px;
|
2020-11-26 16:23:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.action-counter {
|
|
|
|
pointer-events: none;
|
|
|
|
user-select: none;
|
|
|
|
}
|
2018-04-01 02:28:20 +00:00
|
|
|
|
2020-11-26 16:23:53 +00:00
|
|
|
.interactive {
|
2020-11-24 10:32:42 +00:00
|
|
|
.svg-inline--fa {
|
|
|
|
animation-duration: 0.6s;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover .svg-inline--fa,
|
|
|
|
&.-favorited .svg-inline--fa {
|
2020-10-19 16:38:49 +00:00
|
|
|
color: $fallback--cOrange;
|
|
|
|
color: var(--cOrange, $fallback--cOrange);
|
|
|
|
}
|
|
|
|
}
|
2018-04-01 02:28:20 +00:00
|
|
|
}
|
2016-10-30 15:12:35 +00:00
|
|
|
</style>
|