diff --git a/src/assets/widgets/clothes/collared.svg b/src/assets/widgets/clothes/collared.svg
index 672d2e0d4f8f931f2e3d4b9203da10239e9ffb3c..714088601dced390535e1a77f521d9131c7d912c 100644
--- a/src/assets/widgets/clothes/collared.svg
+++ b/src/assets/widgets/clothes/collared.svg
@@ -9,7 +9,7 @@
clothes - collared
@@ -54,4 +54,4 @@
stroke-linejoin="round"
/>
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/clothes/crew.svg b/src/assets/widgets/clothes/crew.svg
index 5cfa1bf63e8829bc8a7b80b0c00e50e97cf78710..208f2806605d77a36fb27cde881d7eeb1002da93 100644
--- a/src/assets/widgets/clothes/crew.svg
+++ b/src/assets/widgets/clothes/crew.svg
@@ -9,7 +9,7 @@
clothes - crew
@@ -20,4 +20,4 @@
stroke-width="4"
/>
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/clothes/open.svg b/src/assets/widgets/clothes/open.svg
index 350499b40862f82df49bc9ff5f9a6308425a6015..725c6c5f7c4782c26d444cc5af5296247543e78a 100644
--- a/src/assets/widgets/clothes/open.svg
+++ b/src/assets/widgets/clothes/open.svg
@@ -9,9 +9,9 @@
clothes - open
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/danny.svg b/src/assets/widgets/tops/danny.svg
index 519572d0ee57ad693af64acd238760158e6c723e..0f58839e39bb656ad2e9bbd396754387d4acbc80 100644
--- a/src/assets/widgets/tops/danny.svg
+++ b/src/assets/widgets/tops/danny.svg
@@ -9,9 +9,9 @@
tops - danny
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/fonze.svg b/src/assets/widgets/tops/fonze.svg
index a439d463a16a08a4db1fc988388bc1f3d446a61b..ba3c44449df836269e6073af15c27bf3ddb5f0f9 100644
--- a/src/assets/widgets/tops/fonze.svg
+++ b/src/assets/widgets/tops/fonze.svg
@@ -9,23 +9,23 @@
tops - fonze
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/funny.svg b/src/assets/widgets/tops/funny.svg
index 4da507b2d0c5c74d63dfdd5d61439ab95592ef38..e13d3f4f65d49504b6e58941f7e329e07a2a5a7e 100644
--- a/src/assets/widgets/tops/funny.svg
+++ b/src/assets/widgets/tops/funny.svg
@@ -23,4 +23,4 @@
stroke-width="4"
/>
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/pixie.svg b/src/assets/widgets/tops/pixie.svg
index a3420de855df94579b2defd186bb2260b45a39d5..84bbfe793565973e5adcb560bfe4a8660473c1f9 100644
--- a/src/assets/widgets/tops/pixie.svg
+++ b/src/assets/widgets/tops/pixie.svg
@@ -9,7 +9,7 @@
tops - pixie
@@ -19,4 +19,4 @@
stroke-width="4"
/>
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/punk.svg b/src/assets/widgets/tops/punk.svg
index 007555ff1392ea8edc3cdd8629ea99e67fc731d1..ca82b6052309cd18f4cb32a5bc2fc112bfd032e1 100644
--- a/src/assets/widgets/tops/punk.svg
+++ b/src/assets/widgets/tops/punk.svg
@@ -14,11 +14,11 @@
/>
-
\ No newline at end of file
+
diff --git a/src/assets/widgets/tops/wave.svg b/src/assets/widgets/tops/wave.svg
index d26cc7775ba642d7a28dbea79820f2e993c3d7d0..462b843ff03a9d11859e883461b2cadf63cb8d64 100644
--- a/src/assets/widgets/tops/wave.svg
+++ b/src/assets/widgets/tops/wave.svg
@@ -9,9 +9,9 @@
tops - wave
-
\ No newline at end of file
+
diff --git a/src/components/Configurator.vue b/src/components/Configurator.vue
index 40ee789e5ea038c7f6d213a12e2193a20c5bbeb6..5e69a76883f34fd3780f57d92ac26181ec5ec454 100644
--- a/src/components/Configurator.vue
+++ b/src/components/Configurator.vue
@@ -22,11 +22,11 @@
-
+
-
@@ -70,9 +90,14 @@ import { useI18n } from 'vue-i18n'
import PerfectScrollbar from '@/components/PerfectScrollbar.vue'
import SectionWrapper from '@/components/SectionWrapper.vue'
-import { type WidgetShape, type WrapperShape, WidgetType } from '@/enums'
+import {
+ type WidgetShape,
+ type WrapperShape,
+ BeardShape,
+ WidgetType,
+} from '@/enums'
import { useAvatarOption } from '@/hooks'
-import { SETTINGS } from '@/utils/constant'
+import { AVATAR_LAYER, SETTINGS } from '@/utils/constant'
import { previewData } from '@/utils/dynamic-data'
const { t } = useI18n()
@@ -156,6 +181,24 @@ function switchWidget(widgetType: WidgetType, widgetShape: WidgetShape) {
[widgetType]: {
...avatarOption.value.widgets?.[widgetType],
shape: widgetShape,
+ ...(widgetShape === BeardShape.Scruff
+ ? { zIndex: AVATAR_LAYER['mouth'].zIndex - 1 }
+ : undefined),
+ },
+ },
+ })
+ }
+}
+
+function setWidgetColor(widgetType: WidgetType, fillColor: string) {
+ if (avatarOption.value.widgets?.[widgetType]) {
+ setAvatarOption({
+ ...avatarOption.value,
+ widgets: {
+ ...avatarOption.value.widgets,
+ [widgetType]: {
+ ...avatarOption.value.widgets?.[widgetType],
+ fillColor,
},
},
})
@@ -206,12 +249,23 @@ function switchWidget(widgetType: WidgetType, widgetShape: WidgetShape) {
}
}
- .bg-color-list {
+ .color-picker {
+ margin-top: 1rem;
+
+ summary {
+ color: darken(var.$color-text, 20);
+ font-size: small;
+ cursor: pointer;
+ user-select: none;
+ }
+ }
+
+ .color-list {
display: flex;
flex-wrap: wrap;
align-items: center;
- .bg-color-list__item {
+ .color-list__item {
position: relative;
z-index: 1;
width: calc(100% / 7);
diff --git a/src/components/VueColorAvatar.vue b/src/components/VueColorAvatar.vue
index eeee0a0c5bae98032c449013f696d16b170e4332..0ed44ead2ae4dcd5296955f6e460bfd67d09b601 100644
--- a/src/components/VueColorAvatar.vue
+++ b/src/components/VueColorAvatar.vue
@@ -26,7 +26,7 @@ import { ref, toRefs, watchEffect } from 'vue'
import { WrapperShape } from '@/enums'
import { type AvatarOption } from '@/types'
import { getRandomAvatarOption } from '@/utils'
-import { AVATAR_LAYER, NONE } from '@/utils/constant'
+import { AVATAR_LAYER, NONE, SETTINGS } from '@/utils/constant'
import { widgetData } from '@/utils/dynamic-data'
import Background from './widgets/Background.vue'
@@ -62,9 +62,9 @@ const svgContent = ref('')
watchEffect(async () => {
const sortedList = Object.entries(avatarOption.value.widgets).sort(
- (i, ii) => {
- const ix = AVATAR_LAYER[i[0]]?.zIndex ?? 0
- const iix = AVATAR_LAYER[ii[0]]?.zIndex ?? 0
+ ([prevShape, prev], [nextShape, next]) => {
+ const ix = prev.zIndex ?? AVATAR_LAYER[prevShape]?.zIndex ?? 0
+ const iix = next.zIndex ?? AVATAR_LAYER[nextShape]?.zIndex ?? 0
return ix - iix
}
)
@@ -86,9 +86,12 @@ watchEffect(async () => {
const svgRawList = await Promise.all(promises).then((raw) => {
return raw.map((svgRaw, i) => {
+ const widgetFillColor = sortedList[i][1].fillColor
+
const content = svgRaw
.slice(svgRaw.indexOf('>', svgRaw.indexOf('