Tighten padding and center color-blind ownership symbols

This commit is contained in:
coyotte508 2026-11-25 10:18:10 +00:00
commit 101ae14315
5 changed files with 21 additions and 18 deletions

View file

@ -28,7 +28,7 @@
{#if colorBlind && !['Barbarians', 'Pirates'].includes(influencer.civilization)}
{@const symbol = playerSymbol(influencer.owner, playerSymbols)}
<span class="influence-symbol" data-symbol={symbol}>
<OwnershipSymbol {symbol} size={compact ? 7 : 8} />
<OwnershipSymbol {symbol} size={compact ? 6 : 8} />
</span>
{/if}
{#if influencer.count > 1}

View file

@ -4,31 +4,31 @@
{#if symbol === '●'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<circle cx="8" cy="8" r="5.2" fill="currentColor" />
<circle cx="8" cy="8" r="6.2" fill="currentColor" />
</svg>
{:else if symbol === '▲'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<polygon points="8,2.6 13.4,11.9 2.6,11.9" fill="currentColor" />
<polygon points="8,2 14.2,13.2 1.8,13.2" fill="currentColor" />
</svg>
{:else if symbol === '■'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<rect x="3.4" y="3.4" width="9.2" height="9.2" fill="currentColor" />
<rect x="2.2" y="2.2" width="11.6" height="11.6" fill="currentColor" />
</svg>
{:else if symbol === '◆'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<polygon points="8,2.2 13.8,8 8,13.8 2.2,8" fill="currentColor" />
<polygon points="8,1.4 14.6,8 8,14.6 1.4,8" fill="currentColor" />
</svg>
{:else if symbol === '✚'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<rect x="2.6" y="6.1" width="10.8" height="3.8" fill="currentColor" />
<rect x="6.1" y="2.6" width="3.8" height="10.8" fill="currentColor" />
<rect x="1.8" y="5.8" width="12.4" height="4.4" fill="currentColor" />
<rect x="5.8" y="1.8" width="4.4" height="12.4" fill="currentColor" />
</svg>
{:else if symbol === '✕'}
<svg class="ownership-symbol-svg" viewBox="0 0 16 16" width={size} height={size} aria-hidden="true">
<path
d="M3.8 3.8L12.2 12.2M12.2 3.8L3.8 12.2"
d="M3 3L13 13M13 3L3 13"
stroke="currentColor"
stroke-width="2.8"
stroke-width="3.2"
stroke-linecap="round"
/>
</svg>

View file

@ -890,7 +890,7 @@ export class World {
),
);
context.restore();
} else drawOwnershipSymbol(context, playerSymbol(index, symbols), 32, 14);
} else drawOwnershipSymbol(context, playerSymbol(index, symbols), 32, 19);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
this.textures.add(texture);

View file

@ -38,7 +38,7 @@ export function drawOwnershipSymbol(
context: OwnershipSymbolCanvas,
symbol: string,
center = 32,
radius = 14,
radius = 19,
): void {
switch (symbol) {
case '●': {
@ -49,9 +49,9 @@ export function drawOwnershipSymbol(
}
case '▲': {
context.beginPath();
context.moveTo(center, center - radius);
context.lineTo(center + radius, center + radius * 0.72);
context.lineTo(center - radius, center + radius * 0.72);
context.moveTo(center, center - radius * 0.92);
context.lineTo(center + radius, center + radius * 0.84);
context.lineTo(center - radius, center + radius * 0.84);
context.closePath();
context.fill();
return;

View file

@ -805,11 +805,14 @@ small {
position: absolute;
bottom: -4px;
left: -4px;
width: 11px;
height: 11px;
width: 12px;
height: 12px;
padding: 0;
box-sizing: border-box;
border-radius: 50%;
display: grid;
place-items: center;
display: flex;
align-items: center;
justify-content: center;
background: #fff8e8;
color: #1f2e2b;
border: 1px solid #23332f48;