@everymatrix/casino-game-thumb-view 1.44.0 → 1.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-game-thumb-view/casino-game-thumb-view.esm.js +1 -1
- package/dist/casino-game-thumb-view/p-2207062c.entry.js +1 -0
- package/dist/casino-game-thumb-view/p-39684b4a.entry.js +1 -0
- package/dist/casino-game-thumb-view/p-af0284b5.entry.js +1 -0
- package/dist/casino-game-thumb-view/p-b73b7a18.entry.js +1 -0
- package/dist/casino-game-thumb-view/p-bd016895.entry.js +7 -0
- package/dist/casino-game-thumb-view/p-d2580653.js +8 -0
- package/dist/casino-game-thumb-view/p-d48c3566.entry.js +1 -0
- package/dist/casino-game-thumb-view/p-e1255160.js +1 -0
- package/dist/casino-game-thumb-view/p-eef6f908.js +2 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-extrainfo-baccarat.cjs.entry.js +327 -322
- package/dist/cjs/casino-extrainfo-blackjack.cjs.entry.js +45 -45
- package/dist/cjs/casino-extrainfo-roulette.cjs.entry.js +35 -34
- package/dist/cjs/casino-game-thumb-view.cjs.js +17 -11
- package/dist/cjs/casino-game-thumb-view_2.cjs.entry.js +469 -519
- package/dist/cjs/casino-game-thumbnail-betlimit_2.cjs.entry.js +258 -251
- package/dist/cjs/casino-normal-game-thumbnail.cjs.entry.js +14 -12
- package/dist/cjs/game-thumbnail-5a34c727.js +78 -0
- package/dist/cjs/index-48d13981.js +1709 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/locale.utils-53bf703a.js +132 -0
- package/dist/cjs/{utils-a0afc0a9.js → utils-c4ed3adc.js} +407 -404
- package/dist/collection/collection-manifest.json +10 -10
- package/dist/collection/components/casino-extrainfo-baccarat/casino-extrainfo-baccarat.js +251 -230
- package/dist/collection/components/casino-extrainfo-blackjack/casino-extrainfo-blackjack.js +136 -114
- package/dist/collection/components/casino-extrainfo-roulette/casino-extrainfo-roulette.js +126 -119
- package/dist/collection/components/casino-game-thumb-view/casino-game-thumb-view.css +1 -1
- package/dist/collection/components/casino-game-thumb-view/casino-game-thumb-view.js +1023 -1027
- package/dist/collection/components/casino-game-thumb-view/index.js +1 -0
- package/dist/collection/components/casino-game-thumbnail-betlimit/casino-game-thumbnail-betlimit.js +78 -80
- package/dist/collection/components/casino-game-thumbnail-extrainfo/casino-game-thumbnail-extrainfo.js +153 -150
- package/dist/collection/components/casino-game-thumbnail-overlay/casino-game-thumbnail-overlay.js +201 -206
- package/dist/collection/components/casino-normal-game-thumbnail/casino-normal-game-thumbnail.js +71 -58
- package/dist/collection/constants/game-thumbnail.js +66 -66
- package/dist/collection/models/casino-game-thumb-view.js +6 -6
- package/dist/collection/models/currency-symbols.js +170 -170
- package/dist/collection/utils/baccarat-board-svg.js +225 -225
- package/dist/collection/utils/locale.utils.js +122 -122
- package/dist/collection/utils/utils.js +41 -41
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-extrainfo-baccarat.entry.js +327 -322
- package/dist/esm/casino-extrainfo-blackjack.entry.js +45 -45
- package/dist/esm/casino-extrainfo-roulette.entry.js +35 -34
- package/dist/esm/casino-game-thumb-view.js +14 -11
- package/dist/esm/casino-game-thumb-view_2.entry.js +469 -519
- package/dist/esm/casino-game-thumbnail-betlimit_2.entry.js +258 -251
- package/dist/esm/casino-normal-game-thumbnail.entry.js +14 -12
- package/dist/esm/game-thumbnail-035e97e2.js +72 -0
- package/dist/esm/index-8c9a8030.js +1681 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/locale.utils-0c514ca8.js +130 -0
- package/dist/{components/utils.js → esm/utils-090ac2e9.js} +407 -404
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +12 -35
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-game-thumb-view/.stencil/packages/stencil/casino-game-thumb-view/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-game-thumb-view/.stencil/packages/stencil/casino-game-thumb-view/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-extrainfo-baccarat/casino-extrainfo-baccarat.d.ts +36 -36
- package/dist/types/components/casino-extrainfo-blackjack/casino-extrainfo-blackjack.d.ts +33 -33
- package/dist/types/components/casino-extrainfo-roulette/casino-extrainfo-roulette.d.ts +18 -18
- package/dist/types/components/casino-game-thumb-view/casino-game-thumb-view.d.ts +213 -213
- package/dist/types/components/casino-game-thumb-view/index.d.ts +1 -0
- package/dist/types/components/casino-game-thumbnail-betlimit/casino-game-thumbnail-betlimit.d.ts +14 -14
- package/dist/types/components/casino-game-thumbnail-extrainfo/casino-game-thumbnail-extrainfo.d.ts +13 -13
- package/dist/types/components/casino-game-thumbnail-overlay/casino-game-thumbnail-overlay.d.ts +28 -28
- package/dist/types/components/casino-normal-game-thumbnail/casino-normal-game-thumbnail.d.ts +4 -4
- package/dist/types/components.d.ts +33 -2
- package/dist/types/constants/game-thumbnail.d.ts +66 -66
- package/dist/types/models/casino-game-thumb-view.d.ts +107 -107
- package/dist/types/models/currency-symbols.d.ts +170 -170
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/baccarat-board-svg.d.ts +29 -29
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/assets/baccarat.svg +0 -43
- package/dist/assets/fav.svg +0 -9
- package/dist/assets/favorite.svg +0 -12
- package/dist/assets/seat.svg +0 -6
- package/dist/assets/unfav.svg +0 -20
- package/dist/casino-game-thumb-view/p-1bbf4b70.entry.js +0 -1
- package/dist/casino-game-thumb-view/p-42bf2034.entry.js +0 -1
- package/dist/casino-game-thumb-view/p-46dbb1cb.js +0 -1
- package/dist/casino-game-thumb-view/p-6a6b2a78.js +0 -8
- package/dist/casino-game-thumb-view/p-7ae107ed.entry.js +0 -1
- package/dist/casino-game-thumb-view/p-9cbfffbc.entry.js +0 -1
- package/dist/casino-game-thumb-view/p-d961aec4.entry.js +0 -1
- package/dist/casino-game-thumb-view/p-db43bb56.entry.js +0 -7
- package/dist/cjs/game-thumbnail-31d518f0.js +0 -78
- package/dist/cjs/index-65a1d768.js +0 -1796
- package/dist/cjs/locale.utils-aa160787.js +0 -132
- package/dist/components/casino-extrainfo-baccarat.d.ts +0 -11
- package/dist/components/casino-extrainfo-baccarat.js +0 -400
- package/dist/components/casino-extrainfo-blackjack.d.ts +0 -11
- package/dist/components/casino-extrainfo-blackjack.js +0 -92
- package/dist/components/casino-extrainfo-roulette.d.ts +0 -11
- package/dist/components/casino-extrainfo-roulette.js +0 -78
- package/dist/components/casino-game-thumb-view.d.ts +0 -11
- package/dist/components/casino-game-thumb-view.js +0 -1625
- package/dist/components/casino-game-thumbnail-betlimit.d.ts +0 -11
- package/dist/components/casino-game-thumbnail-betlimit.js +0 -6
- package/dist/components/casino-game-thumbnail-betlimit2.js +0 -227
- package/dist/components/casino-game-thumbnail-extrainfo.d.ts +0 -11
- package/dist/components/casino-game-thumbnail-extrainfo.js +0 -6
- package/dist/components/casino-game-thumbnail-extrainfo2.js +0 -96
- package/dist/components/casino-game-thumbnail-overlay.d.ts +0 -11
- package/dist/components/casino-game-thumbnail-overlay.js +0 -6
- package/dist/components/casino-game-thumbnail-overlay2.js +0 -69
- package/dist/components/casino-normal-game-thumbnail.d.ts +0 -11
- package/dist/components/casino-normal-game-thumbnail.js +0 -52
- package/dist/components/game-thumbnail.js +0 -72
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/locale.utils.js +0 -130
- package/dist/esm/game-thumbnail-0a56ee03.js +0 -72
- package/dist/esm/index-1e44dd9f.js +0 -1769
- package/dist/esm/locale.utils-e0cf897e.js +0 -130
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/utils-e9314132.js +0 -5739
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-game-thumb-view/.stencil/packages/casino-game-thumb-view/stencil.config.d.ts +0 -2
- /package/dist/casino-game-thumb-view/{p-2d5f59fe.js → p-2d02adb1.js} +0 -0
- /package/dist/casino-game-thumb-view/{p-1e63a1ab.js → p-59ceeaaa.js} +0 -0
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const index = require('./index-
|
6
|
-
const gameThumbnail = require('./game-thumbnail-
|
5
|
+
const index = require('./index-48d13981.js');
|
6
|
+
const gameThumbnail = require('./game-thumbnail-5a34c727.js');
|
7
7
|
|
8
8
|
var CasinoGameCategory;
|
9
9
|
(function (CasinoGameCategory) {
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
CasinoGameCategory["ROULETTE"] = "ROULETTE";
|
11
|
+
CasinoGameCategory["POKER"] = "POKER";
|
12
|
+
CasinoGameCategory["BLACKJACK"] = "BLACKJACK";
|
13
13
|
})(CasinoGameCategory || (CasinoGameCategory = {}));
|
14
14
|
var BaccaratWinner;
|
15
15
|
(function (BaccaratWinner) {
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
BaccaratWinner["PLAYER"] = "Player";
|
17
|
+
BaccaratWinner["WINNER"] = "Banker";
|
18
|
+
BaccaratWinner["TIE"] = "Tie";
|
19
19
|
})(BaccaratWinner || (BaccaratWinner = {}));
|
20
20
|
|
21
21
|
const BACCARAT_ROW = 6;
|
@@ -23,344 +23,349 @@ const BACCARTAT_COLUMN = 40;
|
|
23
23
|
const TIE_ANGLE = 135;
|
24
24
|
const PLAYER_ANGLE = 45;
|
25
25
|
class BaccaratSvg {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
resetSvg() {
|
36
|
-
this.svgGroupObj.innerHTML = '';
|
37
|
-
}
|
38
|
-
createTag(tag, attrs) {
|
39
|
-
let oTag = document.createElementNS(this.svgNS, tag);
|
40
|
-
Object.keys(attrs).forEach((attr) => {
|
41
|
-
oTag.setAttribute(attr, attrs[attr]);
|
42
|
-
});
|
43
|
-
return oTag;
|
44
|
-
}
|
45
|
-
;
|
46
|
-
//Y1 = Y2, X1=0;
|
47
|
-
createHLine(lineIdx) {
|
48
|
-
return this.createTag('line', {
|
49
|
-
'x1': 0,
|
50
|
-
'x2': this.svgWidth,
|
51
|
-
'y1': lineIdx * this.cellHeight,
|
52
|
-
'y2': lineIdx * this.cellHeight
|
53
|
-
});
|
54
|
-
}
|
55
|
-
createVLine(lineIdx) {
|
56
|
-
return this.createTag('line', {
|
57
|
-
'x1': lineIdx * this.cellWidth,
|
58
|
-
'x2': lineIdx * this.cellWidth,
|
59
|
-
'y1': 0,
|
60
|
-
'y2': this.svgHeight
|
61
|
-
});
|
62
|
-
}
|
63
|
-
createBaccaratBoard(parentEle) {
|
64
|
-
this.parentEle = parentEle;
|
65
|
-
this.svgWidth = parentEle.clientWidth;
|
66
|
-
this.cellWidth = this.svgWidth / BACCARTAT_COLUMN;
|
67
|
-
this.cellHeight = this.cellWidth;
|
68
|
-
this.svgHeight = this.cellHeight * BACCARAT_ROW;
|
69
|
-
let dynamicStyles = {};
|
70
|
-
if (this.svgWidth < 300) {
|
71
|
-
dynamicStyles = {
|
72
|
-
name: 'Min',
|
73
|
-
strokeWidth: 0.8,
|
74
|
-
cellPadding: 2
|
75
|
-
};
|
26
|
+
constructor() {
|
27
|
+
this.svgNS = 'http://www.w3.org/2000/svg';
|
28
|
+
this.svgVersion = '1.1';
|
29
|
+
this.markGroupExtraClass = {
|
30
|
+
name: '',
|
31
|
+
strokeWidth: 1.8,
|
32
|
+
cellPadding: 6
|
33
|
+
};
|
76
34
|
}
|
77
|
-
|
78
|
-
|
79
|
-
name: 'Mid',
|
80
|
-
strokeWidth: 1.5,
|
81
|
-
cellPadding: 3.8
|
82
|
-
};
|
35
|
+
resetSvg() {
|
36
|
+
this.svgGroupObj.innerHTML = '';
|
83
37
|
}
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
'style': 'cursor: pointer',
|
91
|
-
'stroke': '#a1acb696',
|
92
|
-
'stroke-width': '0.6px',
|
93
|
-
'fill': 'transparent'
|
94
|
-
});
|
95
|
-
let markGroup = this.createTag('g', {
|
96
|
-
'style': 'cursor: pointer', 'class': `BoardRoundsGroup ${this.markGroupExtraClass.name}`,
|
97
|
-
'stroke-width': this.markGroupExtraClass.strokeWidth, 'fill': 'transparent'
|
98
|
-
});
|
99
|
-
for (let i = 0; i < BACCARAT_ROW + 1; i++) {
|
100
|
-
svgGroup.appendChild(this.createHLine(i));
|
38
|
+
createTag(tag, attrs) {
|
39
|
+
let oTag = document.createElementNS(this.svgNS, tag);
|
40
|
+
Object.keys(attrs).forEach((attr) => {
|
41
|
+
oTag.setAttribute(attr, attrs[attr]);
|
42
|
+
});
|
43
|
+
return oTag;
|
101
44
|
}
|
102
|
-
|
103
|
-
|
45
|
+
;
|
46
|
+
//Y1 = Y2, X1=0;
|
47
|
+
createHLine(lineIdx) {
|
48
|
+
return this.createTag('line', {
|
49
|
+
'x1': 0,
|
50
|
+
'x2': this.svgWidth,
|
51
|
+
'y1': lineIdx * this.cellHeight,
|
52
|
+
'y2': lineIdx * this.cellHeight
|
53
|
+
});
|
104
54
|
}
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
getRadius() {
|
112
|
-
return (this.cellHeight - this.markGroupExtraClass.cellPadding) / 2;
|
113
|
-
}
|
114
|
-
addAnimate(objToAddAnimate) {
|
115
|
-
let animate = this.createTag('animate', {
|
116
|
-
'attributeName': 'opacity', attributeType: 'XML', 'from': '0', to: 0.8, repeatCount: '5',
|
117
|
-
begin: '0s', dur: '1.5s', 'calcMode': 'spline', keySplines: "0.1 0.8 0.9 0.1", fill: 'freeze'
|
118
|
-
});
|
119
|
-
objToAddAnimate.appendChild(animate);
|
120
|
-
}
|
121
|
-
markNewRound(x, y, options, markNew = false) {
|
122
|
-
let centre = this.getCenterPoint(x, y);
|
123
|
-
let svgG = this.createTag('g', {
|
124
|
-
'class': `Round ${markNew ? 'NewRound' : ''} ${options.winner === BaccaratWinner.TIE ? 'Tie' : ''}`,
|
125
|
-
'part': `Round ${markNew ? 'NewRound' : ''}`, 'opacity': markNew ? 0.1 : 1
|
126
|
-
});
|
127
|
-
//RoundWinner: TIE
|
128
|
-
if (options.winner === BaccaratWinner.TIE) {
|
129
|
-
svgG.appendChild(this.createTieSvg(x, y));
|
130
|
-
this.svgGroupObj.appendChild(svgG);
|
131
|
-
if (options.ties && options.ties > 1) {
|
132
|
-
let text = this.createTag('text', {
|
133
|
-
'x': centre.cx - 1.5,
|
134
|
-
'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
|
135
|
-
'fill': '#12153d',
|
136
|
-
'class': 'TieNumber',
|
137
|
-
'font-size': `${this.markGroupExtraClass.fontSize}px`,
|
138
|
-
'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
|
55
|
+
createVLine(lineIdx) {
|
56
|
+
return this.createTag('line', {
|
57
|
+
'x1': lineIdx * this.cellWidth,
|
58
|
+
'x2': lineIdx * this.cellWidth,
|
59
|
+
'y1': 0,
|
60
|
+
'y2': this.svgHeight
|
139
61
|
});
|
140
|
-
text.innerHTML = options.ties;
|
141
|
-
svgG.appendChild(text);
|
142
|
-
}
|
143
|
-
this.svgGroupObj.appendChild(svgG);
|
144
|
-
return;
|
145
62
|
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
63
|
+
createBaccaratBoard(parentEle) {
|
64
|
+
this.parentEle = parentEle;
|
65
|
+
this.svgWidth = parentEle.clientWidth;
|
66
|
+
this.cellWidth = this.svgWidth / BACCARTAT_COLUMN;
|
67
|
+
this.cellHeight = this.cellWidth;
|
68
|
+
this.svgHeight = this.cellHeight * BACCARAT_ROW;
|
69
|
+
let dynamicStyles = {};
|
70
|
+
if (this.svgWidth < 300) {
|
71
|
+
dynamicStyles = {
|
72
|
+
name: 'Min',
|
73
|
+
strokeWidth: 0.8,
|
74
|
+
cellPadding: 2
|
75
|
+
};
|
76
|
+
}
|
77
|
+
else if (this.svgWidth >= 300 && this.svgWidth < 500) {
|
78
|
+
dynamicStyles = {
|
79
|
+
name: 'Mid',
|
80
|
+
strokeWidth: 1.5,
|
81
|
+
cellPadding: 3.8
|
82
|
+
};
|
83
|
+
}
|
84
|
+
this.markGroupExtraClass = Object.assign(Object.assign({}, this.markGroupExtraClass), dynamicStyles);
|
85
|
+
this.markGroupExtraClass.fontSize = this.cellWidth - this.markGroupExtraClass.cellPadding * 0.8;
|
86
|
+
this.markGroupExtraClass.pairDotR = this.markGroupExtraClass.strokeWidth / 2;
|
87
|
+
this.markGroupExtraClass.pairBackDotR = this.markGroupExtraClass.pairDotR + 0.4;
|
88
|
+
let svgObj = this.createTag('svg', { 'xmlns': this.svgNS, 'version': this.svgVersion, 'width': '100%' });
|
89
|
+
let svgGroup = this.createTag('g', {
|
90
|
+
'style': 'cursor: pointer',
|
91
|
+
'stroke': '#a1acb696',
|
92
|
+
'stroke-width': '0.6px',
|
93
|
+
'fill': 'transparent'
|
94
|
+
});
|
95
|
+
let markGroup = this.createTag('g', {
|
96
|
+
'style': 'cursor: pointer', 'class': `BoardRoundsGroup ${this.markGroupExtraClass.name}`,
|
97
|
+
'stroke-width': this.markGroupExtraClass.strokeWidth, 'fill': 'transparent'
|
163
98
|
});
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
99
|
+
for (let i = 0; i < BACCARAT_ROW + 1; i++) {
|
100
|
+
svgGroup.appendChild(this.createHLine(i));
|
101
|
+
}
|
102
|
+
for (let i = 0; i < BACCARTAT_COLUMN + 1; i++) {
|
103
|
+
svgGroup.appendChild(this.createVLine(i));
|
104
|
+
}
|
105
|
+
parentEle.setAttribute('style', `height: ${this.svgHeight}px`);
|
106
|
+
svgObj.appendChild(svgGroup);
|
107
|
+
svgObj.appendChild(markGroup);
|
108
|
+
parentEle.replaceChildren(svgObj);
|
109
|
+
this.svgGroupObj = markGroup;
|
168
110
|
}
|
169
|
-
|
170
|
-
|
171
|
-
dots.forEach(dot => svgG.appendChild(dot));
|
111
|
+
getRadius() {
|
112
|
+
return (this.cellHeight - this.markGroupExtraClass.cellPadding) / 2;
|
172
113
|
}
|
173
|
-
|
174
|
-
|
175
|
-
|
114
|
+
addAnimate(objToAddAnimate) {
|
115
|
+
let animate = this.createTag('animate', {
|
116
|
+
'attributeName': 'opacity', attributeType: 'XML', 'from': '0', to: 0.8, repeatCount: '5',
|
117
|
+
begin: '0s', dur: '1.5s', 'calcMode': 'spline', keySplines: "0.1 0.8 0.9 0.1", fill: 'freeze'
|
118
|
+
});
|
119
|
+
objToAddAnimate.appendChild(animate);
|
176
120
|
}
|
177
|
-
|
178
|
-
|
121
|
+
markNewRound(x, y, options, markNew = false) {
|
122
|
+
let centre = this.getCenterPoint(x, y);
|
123
|
+
let svgG = this.createTag('g', {
|
124
|
+
'class': `Round ${markNew ? 'NewRound' : ''} ${options.winner === BaccaratWinner.TIE ? 'Tie' : ''}`,
|
125
|
+
'part': `Round ${markNew ? 'NewRound' : ''}`, 'opacity': markNew ? 0.1 : 1
|
126
|
+
});
|
127
|
+
//RoundWinner: TIE
|
128
|
+
if (options.winner === BaccaratWinner.TIE) {
|
129
|
+
svgG.appendChild(this.createTieSvg(x, y));
|
130
|
+
this.svgGroupObj.appendChild(svgG);
|
131
|
+
if (options.ties && options.ties > 1) {
|
132
|
+
let text = this.createTag('text', {
|
133
|
+
'x': centre.cx - 1.5,
|
134
|
+
'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
|
135
|
+
'fill': '#12153d',
|
136
|
+
'class': 'TieNumber',
|
137
|
+
'font-size': `${this.markGroupExtraClass.fontSize}px`,
|
138
|
+
'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
|
139
|
+
});
|
140
|
+
text.innerHTML = options.ties;
|
141
|
+
svgG.appendChild(text);
|
142
|
+
}
|
143
|
+
this.svgGroupObj.appendChild(svgG);
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
svgG.appendChild(this.createTag('circle', {
|
147
|
+
r: this.getRadius(),
|
148
|
+
'class': 'Round',
|
149
|
+
'stroke': options.color,
|
150
|
+
'cx': x * this.cellHeight + (this.cellHeight) / 2,
|
151
|
+
'cy': y * this.cellHeight + (this.cellHeight) / 2
|
152
|
+
}));
|
153
|
+
if (options.ties) {
|
154
|
+
svgG.appendChild(this.createTieSvg(x, y));
|
155
|
+
if (options.ties > 1) {
|
156
|
+
let text = this.createTag('text', {
|
157
|
+
'x': centre.cx - 1.5,
|
158
|
+
'y': centre.cy + this.markGroupExtraClass.fontSize / 2 - 1.1,
|
159
|
+
'fill': '#12153d',
|
160
|
+
'class': 'TieNumber',
|
161
|
+
'font-size': `${this.markGroupExtraClass.fontSize}px`,
|
162
|
+
'font-weight': this.markGroupExtraClass.fontSize > 7 ? 'bold' : ''
|
163
|
+
});
|
164
|
+
text.innerHTML = options.ties;
|
165
|
+
svgG.appendChild(text);
|
166
|
+
}
|
167
|
+
this.svgGroupObj.appendChild(svgG);
|
168
|
+
}
|
169
|
+
if (options.bankerPair) {
|
170
|
+
let dots = this.createPairDot(x, y, options.pairColor.banker, PLAYER_ANGLE + 180);
|
171
|
+
dots.forEach(dot => svgG.appendChild(dot));
|
172
|
+
}
|
173
|
+
if (options.playerPair) {
|
174
|
+
let dots = this.createPairDot(x, y, options.pairColor.player, PLAYER_ANGLE);
|
175
|
+
dots.forEach(dot => svgG.appendChild(dot));
|
176
|
+
}
|
177
|
+
if (options.includeAnimate) {
|
178
|
+
this.addAnimate(svgG);
|
179
|
+
}
|
180
|
+
this.svgGroupObj.appendChild(svgG);
|
179
181
|
}
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
182
|
+
markRound(x, y, color, includeAnimate = false) {
|
183
|
+
let circleSvg = this.createTag('circle', {
|
184
|
+
r: this.getRadius(),
|
185
|
+
'class': 'Round',
|
186
|
+
'stroke': color,
|
187
|
+
'cx': x * this.cellHeight + (this.cellHeight) / 2,
|
188
|
+
'cy': y * this.cellHeight + (this.cellHeight) / 2
|
189
|
+
});
|
190
|
+
if (includeAnimate) {
|
191
|
+
this.addAnimate(circleSvg);
|
192
|
+
}
|
193
|
+
this.svgGroupObj.appendChild(circleSvg);
|
192
194
|
}
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
195
|
+
getCenterPoint(x, y) {
|
196
|
+
return {
|
197
|
+
'cx': x * this.cellHeight + (this.cellHeight) / 2,
|
198
|
+
'cy': y * this.cellHeight + (this.cellHeight) / 2
|
199
|
+
};
|
200
|
+
}
|
201
|
+
createTieSvg(x, y) {
|
202
|
+
let centerXY = this.getCenterPoint(x, y), angle = TIE_ANGLE, r = (this.cellHeight) / 2;
|
203
|
+
const x1 = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
|
204
|
+
const y1 = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
|
205
|
+
const x2 = centerXY.cx + r * Math.cos((angle + 180) * Math.PI / 180);
|
206
|
+
const y2 = centerXY.cy + r * Math.sin((angle + 180) * Math.PI / 180);
|
207
|
+
return this.createTag('line', {
|
208
|
+
x1, y1, x2, y2, 'class': 'Tie',
|
209
|
+
'stroke': 'green', 'opacity': '0.8', 'stroke-width': '1.8px'
|
210
|
+
});
|
211
|
+
}
|
212
|
+
createPairDot(x, y, pairColor, angle) {
|
213
|
+
let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
|
214
|
+
const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
|
215
|
+
const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
|
216
|
+
return [
|
217
|
+
this.createTag('circle', {
|
218
|
+
cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
|
219
|
+
'stroke': '#fff'
|
220
|
+
}),
|
221
|
+
this.createTag('circle', {
|
222
|
+
cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
|
223
|
+
'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
|
224
|
+
})
|
225
|
+
];
|
226
|
+
}
|
227
|
+
markTie(x, y, includeAnimate = false) {
|
228
|
+
let line = this.createTieSvg(x, y);
|
229
|
+
if (includeAnimate) {
|
230
|
+
this.addAnimate(line);
|
231
|
+
}
|
232
|
+
this.svgGroupObj.appendChild(line);
|
233
|
+
}
|
234
|
+
markPair(x, y, pairColor, angle) {
|
235
|
+
let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
|
236
|
+
const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
|
237
|
+
const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
|
238
|
+
this.svgGroupObj.appendChild(this.createTag('circle', {
|
239
|
+
cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
|
240
|
+
'stroke': '#fff'
|
241
|
+
}));
|
242
|
+
this.svgGroupObj.appendChild(this.createTag('circle', {
|
243
|
+
cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
|
244
|
+
'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
|
245
|
+
}));
|
246
|
+
}
|
247
|
+
markBankerPair(x, y, pairColor) {
|
248
|
+
this.markPair(x, y, pairColor, 225);
|
249
|
+
}
|
250
|
+
markPlayerPair(x, y, pairColor) {
|
251
|
+
this.markPair(x, y, pairColor, 45);
|
231
252
|
}
|
232
|
-
this.svgGroupObj.appendChild(line);
|
233
|
-
}
|
234
|
-
markPair(x, y, pairColor, angle) {
|
235
|
-
let centerXY = this.getCenterPoint(x, y), r = this.getRadius() + this.markGroupExtraClass.pairDotR;
|
236
|
-
const cx = centerXY.cx + r * Math.cos(angle * Math.PI / 180);
|
237
|
-
const cy = centerXY.cy + r * Math.sin(angle * Math.PI / 180);
|
238
|
-
this.svgGroupObj.appendChild(this.createTag('circle', {
|
239
|
-
cx, cy, r: this.markGroupExtraClass.pairBackDotR, 'class': 'DotBack',
|
240
|
-
'stroke': '#fff'
|
241
|
-
}));
|
242
|
-
this.svgGroupObj.appendChild(this.createTag('circle', {
|
243
|
-
cx, cy, r: this.markGroupExtraClass.pairDotR, 'class': 'Dot',
|
244
|
-
'stroke': pairColor, 'stroke-width': '0.8px', 'fill': pairColor
|
245
|
-
}));
|
246
|
-
}
|
247
|
-
markBankerPair(x, y, pairColor) {
|
248
|
-
this.markPair(x, y, pairColor, 225);
|
249
|
-
}
|
250
|
-
markPlayerPair(x, y, pairColor) {
|
251
|
-
this.markPair(x, y, pairColor, 45);
|
252
|
-
}
|
253
253
|
}
|
254
254
|
|
255
255
|
const casinoExtrainfoBaccaratCss = ":host {\n display: block;\n}\n\n.BaccaratBoard {\n container-type: inline-size;\n min-height: 30px;\n width: 100%;\n}\n.BaccaratBoard svg {\n background: #fff;\n opacity: 0.99;\n height: 100%;\n}\n\n.LiveProps.BaccaratProps div.LiveIcons {\n margin-bottom: 0px;\n padding: 0px;\n width: 100%;\n}\n\nsvg circle {\n transition: stroke-dashoffset 0s ease 2s;\n}\n\ng.BoardRoundsGroup {\n stroke-width: 1.8px;\n}\n\n@container (max-width: 300px) {\n g.BoardRoundsGroup {\n stroke-width: 0.9px;\n }\n}\nsvg .Round.NewRound {\n opacity: 1;\n -webkit-animation-name: fadeInFromNone;\n animation-name: fadeInFromNone;\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n\n@-webkit-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@-moz-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@-o-keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 30% {\n display: block;\n opacity: 1;\n }\n 60% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}\n@keyframes fadeInFromNone {\n 0% {\n display: none;\n opacity: 0;\n }\n 1% {\n display: block;\n opacity: 0;\n }\n 30% {\n display: block;\n opacity: 1;\n }\n 60% {\n display: block;\n opacity: 0;\n }\n 100% {\n display: block;\n opacity: 1;\n }\n}";
|
256
|
+
const CasinoExtrainfoBaccaratStyle0 = casinoExtrainfoBaccaratCss;
|
256
257
|
|
257
258
|
const CasinoExtrainfoBaccarat = class {
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
setTimeout(() => {
|
268
|
-
this.initBaccaratRoundsBoard();
|
269
|
-
}, 100);
|
270
|
-
}
|
259
|
+
constructor(hostRef) {
|
260
|
+
index.registerInstance(this, hostRef);
|
261
|
+
this.baccaratSvg = new BaccaratSvg();
|
262
|
+
this.isBoardInited = false;
|
263
|
+
this.filledCells = [];
|
264
|
+
this.language = undefined;
|
265
|
+
this.showRoundBoard = undefined;
|
266
|
+
this.gameInfo = undefined;
|
267
|
+
this.gameDetails = undefined;
|
271
268
|
}
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
this.gameDetails = Object.assign({}, this.gameDetails);
|
287
|
-
(_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameDetailUpdated(details);
|
288
|
-
// init board when the svg board init finished
|
289
|
-
setTimeout(() => {
|
290
|
-
this.isBoardInited = true;
|
291
|
-
}, 200);
|
292
|
-
}
|
293
|
-
async onBaccaratResultChanged(result) {
|
294
|
-
if (!result || !this.baccaratRef || this.isResetingRoundBoard) {
|
295
|
-
return;
|
269
|
+
gameDetailsHandler(newVal, oldVal) {
|
270
|
+
if (newVal.isOpen && (!oldVal || !oldVal.isOpen)) {
|
271
|
+
if (this.showRoundBoard) {
|
272
|
+
setTimeout(() => {
|
273
|
+
this.initBaccaratRoundsBoard();
|
274
|
+
}, 100);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
278
|
+
async onGameLoaded(gameInfo) {
|
279
|
+
var _a;
|
280
|
+
this.gameInfo = gameInfo;
|
281
|
+
this.gameDetails = this.gameInfo.details;
|
282
|
+
(_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameLoaded(this.gameInfo);
|
296
283
|
}
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
(result[0].location.column == 0 && result[0].location.row == 0))))) {
|
311
|
-
this.isResetingRoundBoard = true;
|
312
|
-
resetRoundBoardCells();
|
313
|
-
setTimeout(() => {
|
314
|
-
this.isResetingRoundBoard = false;
|
315
|
-
}, 1000);
|
284
|
+
/**
|
285
|
+
* Called when received update from updater
|
286
|
+
* @param details
|
287
|
+
*/
|
288
|
+
async onGameDetailUpdated(details) {
|
289
|
+
var _a;
|
290
|
+
this.gameInfo.details = this.gameDetails = details;
|
291
|
+
this.gameDetails = Object.assign({}, this.gameDetails);
|
292
|
+
(_a = this.infoWrapperRef) === null || _a === void 0 ? void 0 : _a.onGameDetailUpdated(details);
|
293
|
+
// init board when the svg board init finished
|
294
|
+
setTimeout(() => {
|
295
|
+
this.isBoardInited = true;
|
296
|
+
}, 200);
|
316
297
|
}
|
317
|
-
result
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
298
|
+
async onBaccaratResultChanged(result) {
|
299
|
+
if (!result || !this.baccaratRef || this.isResetingRoundBoard) {
|
300
|
+
return;
|
301
|
+
}
|
302
|
+
// For Tie round to mark, latestRound
|
303
|
+
let latestRound, resetRoundBoardCells = () => {
|
304
|
+
console.log('Reset Baccarat Board.');
|
305
|
+
this.filledCells = [];
|
306
|
+
this.baccaratSvg.resetSvg();
|
307
|
+
latestRound = null;
|
308
|
+
};
|
309
|
+
// Reset round board to avoid the reset(result==[]) update come earlier than last round,
|
310
|
+
// Ignore if the result.length == 0 for temporary
|
311
|
+
if (this.isBoardInited &&
|
312
|
+
(result.length == 0 ||
|
313
|
+
(result.length == 1 &&
|
314
|
+
(result[0].winner == BaccaratWinner.TIE ||
|
315
|
+
(result[0].location.column == 0 && result[0].location.row == 0))))) {
|
316
|
+
this.isResetingRoundBoard = true;
|
317
|
+
resetRoundBoardCells();
|
318
|
+
setTimeout(() => {
|
319
|
+
this.isResetingRoundBoard = false;
|
320
|
+
}, 1000);
|
330
321
|
}
|
322
|
+
result.forEach((item, i) => {
|
323
|
+
//Mark the Tie when Tie round is the first cell(0,0)
|
324
|
+
if (item.winner == BaccaratWinner.TIE) {
|
325
|
+
if (i == result.length - 1 &&
|
326
|
+
(!latestRound ||
|
327
|
+
(latestRound &&
|
328
|
+
latestRound.location.column == 0 &&
|
329
|
+
latestRound.location.row == 0))) {
|
330
|
+
let firstTieCellKey = '0-0-T';
|
331
|
+
if (this.filledCells.indexOf(firstTieCellKey) == -1) {
|
332
|
+
this.baccaratSvg.markNewRound(0, 0, Object.assign(Object.assign({}, item), { pairColor: gameThumbnail.WINNER_COLOR }), this.isBoardInited);
|
333
|
+
this.filledCells.push(firstTieCellKey);
|
334
|
+
}
|
335
|
+
}
|
336
|
+
return;
|
337
|
+
}
|
338
|
+
//cellKey to mark if a round has been marked
|
339
|
+
const cellKey = `${item.location.column}-${item.location.row}`;
|
340
|
+
const tCellKey = `${cellKey}-T`;
|
341
|
+
if (item.ties > 0 && this.filledCells.indexOf(tCellKey) == -1) {
|
342
|
+
this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { winner: BaccaratWinner.TIE }), this.isBoardInited);
|
343
|
+
this.filledCells.push(tCellKey);
|
344
|
+
}
|
345
|
+
latestRound = item;
|
346
|
+
//If current cell has been filled,duplicated data
|
347
|
+
if (this.filledCells.indexOf(cellKey) == -1) {
|
348
|
+
this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { pairColor: gameThumbnail.WINNER_COLOR }), this.isBoardInited);
|
349
|
+
this.filledCells.push(cellKey);
|
350
|
+
}
|
351
|
+
});
|
331
352
|
return;
|
332
|
-
}
|
333
|
-
//cellKey to mark if a round has been marked
|
334
|
-
const cellKey = `${item.location.column}-${item.location.row}`;
|
335
|
-
const tCellKey = `${cellKey}-T`;
|
336
|
-
if (item.ties > 0 && this.filledCells.indexOf(tCellKey) == -1) {
|
337
|
-
this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { winner: BaccaratWinner.TIE }), this.isBoardInited);
|
338
|
-
this.filledCells.push(tCellKey);
|
339
|
-
}
|
340
|
-
latestRound = item;
|
341
|
-
//If current cell has been filled,duplicated data
|
342
|
-
if (this.filledCells.indexOf(cellKey) == -1) {
|
343
|
-
this.baccaratSvg.markNewRound(item.location.column, item.location.row, Object.assign(Object.assign({}, item), { pairColor: gameThumbnail.WINNER_COLOR }), this.isBoardInited);
|
344
|
-
this.filledCells.push(cellKey);
|
345
|
-
}
|
346
|
-
});
|
347
|
-
return;
|
348
|
-
}
|
349
|
-
initBaccaratRoundsBoard() {
|
350
|
-
var _a;
|
351
|
-
this.baccaratSvg.createBaccaratBoard(this.baccaratRef);
|
352
|
-
if (((_a = this.gameDetails.results) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
353
|
-
this.onBaccaratResultChanged(this.gameDetails.results);
|
354
353
|
}
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
354
|
+
initBaccaratRoundsBoard() {
|
355
|
+
var _a;
|
356
|
+
this.baccaratSvg.createBaccaratBoard(this.baccaratRef);
|
357
|
+
if (((_a = this.gameDetails.results) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
358
|
+
this.onBaccaratResultChanged(this.gameDetails.results);
|
359
|
+
}
|
360
|
+
}
|
361
|
+
render() {
|
362
|
+
var _a;
|
363
|
+
return (index.h(index.Host, { key: '88be397ce6762f3a57c76c84b40f48dc2ba23db7' }, index.h("casino-game-thumbnail-extrainfo", { key: '177c57f40ef84d7dfa0f458336e558e195aa9ac6', ref: (el) => (this.infoWrapperRef = el), language: this.language }, ((_a = this.gameDetails) === null || _a === void 0 ? void 0 : _a.isOpen) && this.showRoundBoard && (index.h("div", { key: '7b2db6ad68e6d9bcac9b97785b2c05b05d146836', slot: "category-details", class: "LiveIcons", part: "LiveIcons" }, index.h("div", { key: '004301f9c4f9bb574757e4eace077bd9fac57472', id: "boardContainer", part: "BaccaratBoard", class: "BaccaratBoard", ref: (el) => (this.baccaratRef = el) }))))));
|
364
|
+
}
|
365
|
+
static get watchers() { return {
|
366
|
+
"gameDetails": ["gameDetailsHandler"]
|
367
|
+
}; }
|
363
368
|
};
|
364
|
-
CasinoExtrainfoBaccarat.style =
|
369
|
+
CasinoExtrainfoBaccarat.style = CasinoExtrainfoBaccaratStyle0;
|
365
370
|
|
366
371
|
exports.casino_extrainfo_baccarat = CasinoExtrainfoBaccarat;
|