api-client/components/profile/Picture.vue

59 lines
1.1 KiB
Vue
Raw Normal View History

2021-07-03 13:14:58 +00:00
<template>
2021-07-17 17:40:28 +00:00
<div class="cursor-pointer flex h-5 w-5 relative items-center justify-center">
2021-07-03 13:14:58 +00:00
<img
class="
2021-07-17 17:40:28 +00:00
bg-primaryDark bg-primaryLight
2021-07-05 16:52:15 +00:00
rounded-full
2021-07-17 17:40:28 +00:00
object-cover object-center
2021-07-05 16:52:15 +00:00
h-5
2021-07-17 17:40:28 +00:00
transition
2021-07-05 16:52:15 +00:00
w-5
2021-07-17 17:40:28 +00:00
absolute
2021-07-03 13:14:58 +00:00
"
:src="url"
:alt="alt"
loading="lazy"
/>
2021-07-24 05:53:10 +00:00
<div class="rounded-full shadow-inner inset-0 absolute"></div>
<span
2021-08-03 11:20:28 +00:00
v-if="indicator"
2021-08-06 16:10:26 +00:00
class="
border-primary
rounded-full
border-2
h-2.5
-top-0.5
-right-0.5
w-2.5
absolute
"
:class="indicatorStyles"
2021-07-24 05:53:10 +00:00
></span>
2021-07-03 13:14:58 +00:00
</div>
</template>
<script>
export default {
props: {
url: {
type: String,
default: `https://avatars.dicebear.com/v2/avataaars/${Math.random()
.toString(36)
.substring(7)}.svg?mood[]=happy`,
},
alt: {
type: String,
default: "Profile picture",
},
2021-07-24 05:53:10 +00:00
indicator: {
2021-08-03 11:20:28 +00:00
type: Boolean,
default: false,
},
indicatorStyles: {
2021-08-01 14:34:25 +00:00
type: String,
default: "bg-green-500",
2021-07-24 05:53:10 +00:00
},
2021-07-03 13:14:58 +00:00
},
}
</script>