-
Notifications
You must be signed in to change notification settings - Fork 0
/
render_card.js
84 lines (82 loc) · 2.83 KB
/
render_card.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
function renderCard(values, d){
return `
<div data-simplebar style='
width: 64%;
height: ${values.cardHeight};
overflow:auto;
background-color:#a18c6ccc;
overflow-wrap: break-word;
padding: 0rem 1.4rem;
'>
<div style='
background-color:${
values.factionColors[d["data-faction"]]
};
border-bottom-right-radius: 0.5rem;
border-bottom-left-radius: 0.5rem;
'>
<h2>${d["data-card-name"]}</h2>
<h3>${d["data-card-category"]}</h3>
</div>
<div>
<p class="card-body" style='
margin-block-start: 0;
margin-top:0;
'>
${d["data-card-body"]}
</p>
</div>
</div>
<div style='
background-color: #ffffff;
height: ${values.cardHeight};
position: relative;
width: calc(${
values.cardHeight
} * ${
values.aspectRatio
});
'>
<img src="static/gwent-chain/img/${
d?.["data-artid"]?.slice(0,-1)
}.jpg" ${values.cardImageStyle}>
<img src="static/gwent-chain/img/border_${
d?.["data-color"]
}.png" ${values.cardImageStyle}>
${+d?.["data-power"]
? `<img src="static/gwent-chain/img/default_${
d?.["data-faction"]
}.png" ${values.cardImageStyle}>
<img src="static/gwent-chain/img/power_${
("00" + d?.["data-power"]).slice(-2)
}.png" ${values.cardImageStyle}>`
: ''
}
${+d?.["data-provision"]
? `<img src="static/gwent-chain/img/provision_${
d?.["data-faction"]
}.png" ${values.cardImageStyle}>
<img src="static/gwent-chain/img/provision_${
d?.["data-provision"]
}.png" ${values.cardImageStyle}>`
: ''
}
${d?.["data-rarity"]
? `<img src="static/gwent-chain/img/rarity_${
d?.["data-rarity"]
}.png" ${values.cardImageStyle}>`
: ''
}
${+d?.["data-armor"]
? `<img src="static/gwent-chain/img/${
'trinket_armor.png"'
} ${values.cardImageStyle}>
<img src="static/gwent-chain/img/armor_${
("00" + d?.["data-armor"]).slice(-2)
}.png" ${values.cardImageStyle}>`
: ''
}
</div>
`
}
export const render = renderCard;