feat: implement new guild icons
This commit is contained in:
parent
25501147ae
commit
ed38340249
3 changed files with 57 additions and 16 deletions
45
components/DefaultIcon.vue
Normal file
45
components/DefaultIcon.vue
Normal file
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<div :style="`background-color: ${generateIrcColor(seed, 50)}`"
|
||||
class="default-icon">
|
||||
<span class="default-icon-text">
|
||||
{{ previewName }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
const props = defineProps<{
|
||||
seed: string,
|
||||
name: string
|
||||
}>();
|
||||
|
||||
let previewName = "";
|
||||
if (props.name.length > 3) {
|
||||
let guildName: string[] = props.name.split(' ')
|
||||
for (let i = 0; i < 3; i ++) {
|
||||
if (guildName.length > i) {
|
||||
previewName += guildName[i].charAt(0)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
previewName = props.name
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.default-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.default-icon-text {
|
||||
font-weight: bold;
|
||||
|
||||
color: var(--secondary-text-color)
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue