Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.

Commit 8f33e96

Browse files
authored
Year 2 Sub Badges (#984)
* Year 2 Sub Badges * formatting
1 parent 746d2f8 commit 8f33e96

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

src/components/base/Badge.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
2-
<svg id="Badge" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" width="1em">
2+
<img v-if="img" :src="img" class="img-badge" />
3+
<svg v-else id="Badge" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" width="1em">
34
<defs v-if="bgGradient && Array.isArray(bgGradient.stops) && bgGradient.stops.length">
45
<linearGradient :id="`BadgeGradient1-${instID}`" :gradientTransform="'rotate(' + bgGradient.angle + ')'">
56
<stop
@@ -99,6 +100,7 @@ const props = defineProps<{
99100
component?: Component;
100101
gradient?: GradientDef;
101102
};
103+
img?: string;
102104
}>();
103105
104106
const bg = props.background ?? {};
@@ -109,3 +111,11 @@ const bgGradient = bg.gradient;
109111
const borderGradient = border.gradient;
110112
const logoGradient = logo.gradient;
111113
</script>
114+
115+
<style scoped lang="scss">
116+
img.img-badge {
117+
width: 1em;
118+
height: 1em;
119+
object-fit: contain;
120+
}
121+
</style>

src/components/utility/BadgeDefs.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,30 @@ export const badgeDefs = [
135135
component: BgBadge4VueSvg,
136136
},
137137
},
138+
{
139+
id: "sub24",
140+
name: "2 Years",
141+
sub: true,
142+
img: "https://cdn.7tv.app/badge/64dfeec02040c6754787d929/3x",
143+
},
144+
{
145+
id: "sub27",
146+
name: "2.25 Years",
147+
sub: true,
148+
img: "https://cdn.7tv.app/badge/64dff4652040c6754787d92a/3x",
149+
},
150+
{
151+
id: "sub30",
152+
name: "2.5 Years",
153+
sub: true,
154+
img: "https://cdn.7tv.app/badge/64dff95e2040c6754787d92f/3x",
155+
},
156+
{
157+
id: "sub33",
158+
name: "2.75 Years",
159+
sub: true,
160+
img: "https://cdn.7tv.app/badge/64dff9c32040c6754787d930/3x",
161+
},
138162
{
139163
id: "subfounder",
140164
name: "Founder",
@@ -278,6 +302,7 @@ export interface BadgeDef {
278302
name: string;
279303
sub?: boolean;
280304
days?: number;
305+
img?: string;
281306
background: {
282307
color?: string;
283308
component?: Component;

src/views/emote-set/EmoteSetPage.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
<Icon icon="pen" />
2222
</div>
2323

24-
<div v-if="editable && !isPersonal" v-wave class="action-button" name="delete" @click="promptDelete">
24+
<div
25+
v-if="editable && !isPersonal"
26+
v-wave
27+
class="action-button"
28+
name="delete"
29+
@click="promptDelete"
30+
>
2531
<Icon icon="trash" />
2632
</div>
2733
</div>

src/views/store/AnnotatedBadge.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<span class="badge-lock">
44
<Icon icon="lock" />
55
</span>
6-
<Badge :logo="badge.logo" :border="badge.border" :background="badge.background" />
6+
<Badge :img="badge.img" :logo="badge.logo" :border="badge.border" :background="badge.background" />
77
<p v-if="!hideName">{{ badge.name }}</p>
88
</span>
99
</template>
@@ -44,7 +44,8 @@ defineProps<{
4444
font-size: 33%;
4545
}
4646
47-
> svg {
47+
> svg,
48+
img {
4849
opacity: 0.5;
4950
}
5051
}

0 commit comments

Comments
 (0)