Add Awakening image to WeaponUnit
This commit is contained in:
parent
604d00da90
commit
adde7e8182
2 changed files with 39 additions and 1 deletions
|
|
@ -41,6 +41,13 @@
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
|
.Awakening {
|
||||||
|
width: 40%;
|
||||||
|
height: auto;
|
||||||
|
top: 67%;
|
||||||
|
left: -3.5%;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: $medium-screen) {
|
@media (max-width: $medium-screen) {
|
||||||
width: 25vw;
|
width: 25vw;
|
||||||
}
|
}
|
||||||
|
|
@ -56,6 +63,13 @@
|
||||||
width: 160px;
|
width: 160px;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
|
.Awakening {
|
||||||
|
width: 30%;
|
||||||
|
height: auto;
|
||||||
|
top: 12%;
|
||||||
|
left: -3.5%;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: $medium-screen) {
|
@media (max-width: $medium-screen) {
|
||||||
width: 20vw;
|
width: 20vw;
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +95,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: $unit;
|
left: $unit;
|
||||||
top: $unit;
|
top: $unit;
|
||||||
z-index: 3;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
|
@ -102,12 +116,18 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: calc($unit / 4);
|
margin-bottom: calc($unit / 4);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
transition: all 0.18s ease-in-out;
|
transition: all 0.18s ease-in-out;
|
||||||
|
|
||||||
&:hover .icon svg {
|
&:hover .icon svg {
|
||||||
fill: var(--icon-secondary-hover);
|
fill: var(--icon-secondary-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Awakening {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,23 @@ const WeaponUnit = (props: Props) => {
|
||||||
setImageUrl(imgSrc)
|
setImageUrl(imgSrc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function awakeningImage() {
|
||||||
|
if (
|
||||||
|
props.gridWeapon &&
|
||||||
|
props.gridWeapon.object.awakening &&
|
||||||
|
props.gridWeapon.awakening &&
|
||||||
|
props.gridWeapon.awakening.type >= 0
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<img
|
||||||
|
alt="Awakening type"
|
||||||
|
className="Awakening"
|
||||||
|
src={`${process.env.NEXT_PUBLIC_SIERO_IMG_URL}/awakening/weapon_${props.gridWeapon.awakening.type}.png`}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function passUncapData(uncap: number) {
|
function passUncapData(uncap: number) {
|
||||||
if (props.gridWeapon)
|
if (props.gridWeapon)
|
||||||
props.updateUncap(props.gridWeapon.id, props.position, uncap)
|
props.updateUncap(props.gridWeapon.id, props.position, uncap)
|
||||||
|
|
@ -87,6 +104,7 @@ const WeaponUnit = (props: Props) => {
|
||||||
|
|
||||||
const image = (
|
const image = (
|
||||||
<div className="WeaponImage">
|
<div className="WeaponImage">
|
||||||
|
{awakeningImage()}
|
||||||
<img alt={weapon?.name.en} className="grid_image" src={imageUrl} />
|
<img alt={weapon?.name.en} className="grid_image" src={imageUrl} />
|
||||||
{props.editable ? (
|
{props.editable ? (
|
||||||
<span className="icon">
|
<span className="icon">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue