feat(falukant): add child portrait backdrops
Some checks failed
Deploy to production / deploy (push) Has been cancelled
Some checks failed
Deploy to production / deploy (push) Has been cancelled
This commit is contained in:
BIN
frontend/public/images/falukant/backgrounds/family-child-1.png
Normal file
BIN
frontend/public/images/falukant/backgrounds/family-child-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
BIN
frontend/public/images/falukant/backgrounds/family-child-2.png
Normal file
BIN
frontend/public/images/falukant/backgrounds/family-child-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.4 MiB |
BIN
frontend/public/images/falukant/backgrounds/family-child-3.png
Normal file
BIN
frontend/public/images/falukant/backgrounds/family-child-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
BIN
frontend/public/images/falukant/backgrounds/family-child-4.png
Normal file
BIN
frontend/public/images/falukant/backgrounds/family-child-4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
BIN
frontend/public/images/falukant/backgrounds/family-child-5.png
Normal file
BIN
frontend/public/images/falukant/backgrounds/family-child-5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
@@ -334,7 +334,11 @@
|
|||||||
class="character-avatar character-avatar--compact"
|
class="character-avatar character-avatar--compact"
|
||||||
:style="getCharacterAvatarStyle(child, 0.5)"
|
:style="getCharacterAvatarStyle(child, 0.5)"
|
||||||
></div>
|
></div>
|
||||||
<div v-if="showCharacterFigure3d" class="character-3d-frame character-3d-frame--compact">
|
<div
|
||||||
|
v-if="showCharacterFigure3d"
|
||||||
|
class="character-3d-frame character-3d-frame--compact"
|
||||||
|
:style="getChild3dBackgroundStyle(child)"
|
||||||
|
>
|
||||||
<Character3D
|
<Character3D
|
||||||
:gender="child.gender"
|
:gender="child.gender"
|
||||||
:age="child.age"
|
:age="child.age"
|
||||||
@@ -1155,6 +1159,23 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getChild3dBackgroundStyle(child) {
|
||||||
|
const childKey = String(child?.childCharacterId || child?.id || child?.name || 'child');
|
||||||
|
let hash = 0;
|
||||||
|
for (let index = 0; index < childKey.length; index += 1) {
|
||||||
|
hash = ((hash << 5) - hash + childKey.charCodeAt(index)) | 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const backgroundNumber = (hash >>> 0) % 5 + 1;
|
||||||
|
return {
|
||||||
|
backgroundColor: '#dff1ee',
|
||||||
|
backgroundImage: `url(/images/falukant/backgrounds/family-child-${backgroundNumber}.png)`,
|
||||||
|
backgroundPosition: 'center',
|
||||||
|
backgroundRepeat: 'no-repeat',
|
||||||
|
backgroundSize: 'cover',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
formatCost(value) {
|
formatCost(value) {
|
||||||
return new Intl.NumberFormat(navigator.language, { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value);
|
return new Intl.NumberFormat(navigator.language, { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value);
|
||||||
},
|
},
|
||||||
@@ -1870,6 +1891,7 @@ export default {
|
|||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
background-color: var(--color-surface-accent);
|
background-color: var(--color-surface-accent);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.character-3d-frame--spouse {
|
.character-3d-frame--spouse {
|
||||||
|
|||||||
Reference in New Issue
Block a user