2018-01-21 05:06:30 +00:00
|
|
|
{{#if error}}
|
2018-04-29 23:57:12 +00:00
|
|
|
<svg class="{{computedClass}}" aria-hidden="true">
|
2018-01-15 05:41:19 +00:00
|
|
|
<use xlink:href="#fa-user" />
|
|
|
|
</svg>
|
2018-02-01 02:20:30 +00:00
|
|
|
{{elseif $autoplayGifs}}
|
2018-04-29 23:57:12 +00:00
|
|
|
<img
|
|
|
|
class="{{computedClass}}"
|
|
|
|
aria-hidden="true"
|
|
|
|
alt=""
|
|
|
|
src="{{account.avatar}}"
|
|
|
|
on:imgLoad="set({loaded: true})"
|
|
|
|
on:imgLoadError="set({error: true})" />
|
2018-02-01 02:20:30 +00:00
|
|
|
{{else}}
|
2018-04-29 23:57:12 +00:00
|
|
|
<NonAutoplayImg
|
|
|
|
className="{{computedClass}}"
|
|
|
|
ariaHidden="true"
|
|
|
|
alt=""
|
|
|
|
src="{{account.avatar}}"
|
|
|
|
staticSrc="{{account.avatar_static}}"
|
|
|
|
:isLink
|
|
|
|
on:imgLoad="set({loaded: true})"
|
|
|
|
on:imgLoadError="set({error: true})"
|
2018-03-17 01:48:24 +00:00
|
|
|
/>
|
2018-01-21 05:06:30 +00:00
|
|
|
{{/if}}
|
2018-01-11 04:45:02 +00:00
|
|
|
<style>
|
2018-02-01 02:20:30 +00:00
|
|
|
:global(.avatar) {
|
|
|
|
border-radius: 4px;
|
2018-04-09 00:36:05 +00:00
|
|
|
background: var(--loading-bg);
|
2018-02-01 02:20:30 +00:00
|
|
|
}
|
2018-03-23 04:36:19 +00:00
|
|
|
|
2018-04-29 23:57:12 +00:00
|
|
|
:global(.avatar.loaded) {
|
|
|
|
background: none;
|
|
|
|
}
|
|
|
|
|
2018-03-23 04:36:19 +00:00
|
|
|
:global(.avatar.size-extra-small) {
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
}
|
|
|
|
|
2018-02-01 02:20:30 +00:00
|
|
|
:global(.avatar.size-small) {
|
2018-01-11 08:26:35 +00:00
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
2018-02-01 02:20:30 +00:00
|
|
|
}
|
|
|
|
|
2018-02-10 06:55:11 +00:00
|
|
|
:global(.avatar.size-medium) {
|
|
|
|
width: 64px;
|
|
|
|
height: 64px;
|
|
|
|
}
|
|
|
|
|
2018-02-01 02:20:30 +00:00
|
|
|
:global(.avatar.size-big) {
|
|
|
|
width: 100px;
|
|
|
|
height: 100px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 767px) {
|
|
|
|
:global(.avatar.size-big) {
|
|
|
|
width: 80px;
|
|
|
|
height: 80px;
|
|
|
|
}
|
2018-01-11 04:45:02 +00:00
|
|
|
}
|
2018-01-15 05:41:19 +00:00
|
|
|
|
2018-01-16 16:38:23 +00:00
|
|
|
svg.avatar {
|
2018-01-15 05:41:19 +00:00
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
}
|
2018-01-11 04:45:02 +00:00
|
|
|
</style>
|
|
|
|
<script>
|
2018-04-29 23:57:12 +00:00
|
|
|
import { imgLoad, imgLoadError } from '../_utils/events'
|
2018-02-09 01:56:20 +00:00
|
|
|
import { store } from '../_store/store'
|
|
|
|
import NonAutoplayImg from './NonAutoplayImg.html'
|
2018-04-29 23:57:12 +00:00
|
|
|
import { classname } from '../_utils/classname'
|
2018-01-23 05:47:29 +00:00
|
|
|
|
2018-01-11 04:45:02 +00:00
|
|
|
export default {
|
2018-01-21 05:06:30 +00:00
|
|
|
events: {
|
2018-04-29 23:57:12 +00:00
|
|
|
imgLoad,
|
2018-01-23 05:47:29 +00:00
|
|
|
imgLoadError
|
2018-02-01 02:20:30 +00:00
|
|
|
},
|
|
|
|
store: () => store,
|
2018-04-29 23:57:12 +00:00
|
|
|
computed: {
|
|
|
|
computedClass: (className, loaded, size) => (classname(
|
|
|
|
'avatar',
|
|
|
|
className,
|
|
|
|
loaded && 'loaded',
|
|
|
|
`size-${size}`
|
|
|
|
))
|
|
|
|
},
|
2018-02-01 02:20:30 +00:00
|
|
|
components: {
|
|
|
|
NonAutoplayImg
|
2018-01-15 05:41:19 +00:00
|
|
|
}
|
2018-01-11 04:45:02 +00:00
|
|
|
}
|
|
|
|
</script>
|