feat(falukant): add child portrait backdrops
Some checks failed
Deploy to production / deploy (push) Has been cancelled

This commit is contained in:
Torsten Schulz (local)
2026-09-30 14:39:02 +02:00
parent ab601933b7
commit 6d14038dad
6 changed files with 23 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@@ -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 {