@burh/nuxt-core 1.0.449 → 1.0.450
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
:src="avatar"
|
|
29
29
|
:alt="name"
|
|
30
30
|
:fallbackText="name"
|
|
31
|
-
|
|
31
|
+
:fallbackBackground="fallbackColor"
|
|
32
|
+
fallbackSize="240"
|
|
32
33
|
/>
|
|
33
34
|
|
|
34
35
|
<slot name="card-content" />
|
|
@@ -63,6 +64,10 @@ export default {
|
|
|
63
64
|
glass: {
|
|
64
65
|
type: Boolean,
|
|
65
66
|
default: false
|
|
67
|
+
},
|
|
68
|
+
fallbackColor: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '5865F2'
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
data() {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
:src="user.avatar"
|
|
38
38
|
:alt="user.name"
|
|
39
39
|
:fallbackText="user.name"
|
|
40
|
+
fallbackSize="200"
|
|
40
41
|
:fallbackBackground="avatarColor"
|
|
41
|
-
|
|
42
|
-
:style=" `--avatar-color: #${avatarColor}` "
|
|
42
|
+
:style=" `--avatar-color: #${avatarColor}`"
|
|
43
43
|
/>
|
|
44
44
|
</el-tooltip>
|
|
45
45
|
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
:src="user.avatar"
|
|
60
60
|
:alt="user.name"
|
|
61
61
|
:fallbackText="user.name"
|
|
62
|
+
fallbackSize="200"
|
|
62
63
|
:fallbackBackground="avatarColor"
|
|
63
|
-
|
|
64
|
-
:style=" `--avatar-color: #${avatarColor}` "
|
|
64
|
+
:style=" `--avatar-color: #${avatarColor}`"
|
|
65
65
|
/>
|
|
66
66
|
<span>{{ user.name }} {{ user.last_name }}</span>
|
|
67
67
|
</div>
|
|
@@ -1,75 +1,59 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<img
|
|
3
|
-
:src="(this.src) ? this.src : getNameInitials()"
|
|
4
|
-
:alt="this.alt"
|
|
5
|
-
@error="img => getImageFallback(img)"
|
|
6
|
-
>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
name: 'image-with-fallback',
|
|
12
|
-
props: {
|
|
13
|
-
src: {
|
|
14
|
-
type: String,
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
alt: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
type:
|
|
23
|
-
default:
|
|
24
|
-
},
|
|
25
|
-
fallbackBackground: {
|
|
26
|
-
type: String,
|
|
27
|
-
default:
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
type: String,
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (this.fallbackText) {
|
|
62
|
-
userAvatarName = this.fallbackText.slice(0, 1).toUpperCase();
|
|
63
|
-
} else {
|
|
64
|
-
userAvatarName = 'BURH';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return userAvatarName;
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
</script>
|
|
72
|
-
|
|
73
|
-
<style lang="scss" scoped>
|
|
74
|
-
|
|
75
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<img
|
|
3
|
+
:src="(this.src) ? this.src : getNameInitials()"
|
|
4
|
+
:alt="this.alt"
|
|
5
|
+
@error="img => getImageFallback(img)"
|
|
6
|
+
>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'image-with-fallback',
|
|
12
|
+
props: {
|
|
13
|
+
src: {
|
|
14
|
+
type: [String, Boolean],
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
alt: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
fallbackSize: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '512'
|
|
24
|
+
},
|
|
25
|
+
fallbackBackground: {
|
|
26
|
+
type: [String, Boolean],
|
|
27
|
+
default: null
|
|
28
|
+
},
|
|
29
|
+
fallbackText: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
getAvatarUrl() {
|
|
36
|
+
let size = this.fallbackSize;
|
|
37
|
+
let text = this.getNameInitials();
|
|
38
|
+
// let background = this.fallbackBackground;
|
|
39
|
+
|
|
40
|
+
// return `https://avatars.dicebear.com/api/initials/${text}.svg?backgroundColorLevel=900&size=${size}&fontSize=40${background ? `&b=%23${background}` : ''}`;
|
|
41
|
+
return `https://avatars.dicebear.com/api/initials/${text}.svg?backgroundColorLevel=900&size=${size}&fontSize=40&b=%238DA2B5`;
|
|
42
|
+
},
|
|
43
|
+
getImageFallback(img) {
|
|
44
|
+
img.target.src = this.getAvatarUrl();
|
|
45
|
+
},
|
|
46
|
+
getNameInitials() {
|
|
47
|
+
let userAvatarName;
|
|
48
|
+
|
|
49
|
+
if (this.fallbackText) {
|
|
50
|
+
userAvatarName = this.fallbackText.slice(0, 1).toUpperCase();
|
|
51
|
+
} else {
|
|
52
|
+
userAvatarName = 'BURH';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return userAvatarName;
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
</script>
|