feat : add health point to champion preview

This commit is contained in:
2024-08-04 10:25:39 +02:00
parent ca8e38624e
commit e36c916e0b
2 changed files with 31 additions and 0 deletions
+29
View File
@@ -56,6 +56,26 @@ const active = ref(false);
></GameCardAtom> ></GameCardAtom>
</div> </div>
</foreignObject> </foreignObject>
<circle
cx="2"
cy="-1"
r="1"
:fill="card.guard ? 'black' : 'lightgray'"
stroke="white"
stroke-width="0.2"
class="champion_small_defense"
:class="{ active }"
></circle>
<text
class="champion_small_defense"
font-size="1.5"
:class="{ active }"
x="1.6"
y="-.5"
:fill="card.guard ? 'white' : 'black'"
>
{{ card.defense }}
</text>
</svg> </svg>
</div> </div>
</template> </template>
@@ -86,6 +106,15 @@ const active = ref(false);
cursor: pointer; cursor: pointer;
} }
.champion_small_defense {
transition: 0.15s all var(--animation-curve);
pointer-events: none;
}
.champion_small_defense.active {
opacity: 0;
}
.champion_small_foreignObject.active { .champion_small_foreignObject.active {
clip-path: polygon(100% 100%, 100% 50%, 100% 0, 0 0, 0 50%, 0 100%, 49% 100%); clip-path: polygon(100% 100%, 100% 50%, 100% 0, 0 0, 0 50%, 0 100%, 49% 100%);
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
+2
View File
@@ -107,4 +107,6 @@ export interface Card extends GameObject {
cardId: number; cardId: number;
cardType: CardType; cardType: CardType;
effects: Effect[]; effects: Effect[];
defense?: number;
guard?: boolean;
} }