@everymatrix/player-account-menu-nd 1.37.5
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/CHANGELOG.md +7 -0
- package/README.md +30 -0
- package/dist/player-account-menu-nd.js +2 -0
- package/dist/player-account-menu-nd.js.map +1 -0
- package/dist/player-account-menu.js +2 -0
- package/dist/player-account-menu.js.map +1 -0
- package/icons/iconService.js +28 -0
- package/index.html +37 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +67 -0
- package/src/PlayerAccountMenu.svelte +476 -0
- package/src/i18n.js +27 -0
- package/src/index.ts +4 -0
- package/src/translations.js +32 -0
- package/stories/PlayerAccountMenu.stories.js +13 -0
- package/translations/translations.js +82 -0
- package/tsconfig.json +6 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
import { onMount } from "svelte";
|
|
6
|
+
import { _, addNewMessages, setLocale } from './i18n';
|
|
7
|
+
import { TRANSLATIONS } from './translations';
|
|
8
|
+
|
|
9
|
+
import '@everymatrix/general-logout';
|
|
10
|
+
|
|
11
|
+
export let endpoint:string = '';
|
|
12
|
+
export let cmsendpoint: string = '';
|
|
13
|
+
export let env:string = '';
|
|
14
|
+
export let session:string = '';
|
|
15
|
+
export let playerid:string = '';
|
|
16
|
+
export let lang:string = 'en';
|
|
17
|
+
export let selecteditem:string = '';
|
|
18
|
+
export let userroles:string = '';
|
|
19
|
+
export let clientstyling:string = '';
|
|
20
|
+
export let clientstylingurl:string = '';
|
|
21
|
+
export let translationurl:string = '';
|
|
22
|
+
export let activemenuitem:string = '';
|
|
23
|
+
|
|
24
|
+
let isLoading:boolean = false;
|
|
25
|
+
|
|
26
|
+
let customStylingContainer:HTMLElement;
|
|
27
|
+
let menuItems:Array<any> = [];
|
|
28
|
+
let selectedItem:any;
|
|
29
|
+
let userAgent:string = window.navigator.userAgent;
|
|
30
|
+
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
|
31
|
+
let defaultMenuItemsArray:any = [];
|
|
32
|
+
let sessionId:string = '';
|
|
33
|
+
|
|
34
|
+
let profileUsername:string = '';
|
|
35
|
+
let profileEmail:string = '';
|
|
36
|
+
|
|
37
|
+
const mediaQuery = window.matchMedia('(min-width: 768px)');
|
|
38
|
+
|
|
39
|
+
const setTranslationUrl = ():void => {
|
|
40
|
+
let url:string = translationurl;
|
|
41
|
+
|
|
42
|
+
fetch(url).then((res:any) => res.json())
|
|
43
|
+
.then((res) => {
|
|
44
|
+
Object.keys(res).forEach((item:any):void => {
|
|
45
|
+
addNewMessages(item, res[item]);
|
|
46
|
+
});
|
|
47
|
+
}).catch((err:any) => {
|
|
48
|
+
console.error(err);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
Object.keys(TRANSLATIONS).forEach((item) => {
|
|
53
|
+
addNewMessages(item, TRANSLATIONS[item]);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const messageHandler = (e:any):void => {
|
|
57
|
+
if (e.data) {
|
|
58
|
+
switch(e.data.type) {
|
|
59
|
+
case 'AccountMenuDetails':
|
|
60
|
+
availableMenuItemsArray = e.data.accountMenuInfo;
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
case 'UserSessionID':
|
|
64
|
+
session = e.data.session;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const setDevice = (): string => {
|
|
71
|
+
let device = getDevice(userAgent);
|
|
72
|
+
if (device){
|
|
73
|
+
if (device === 'PC'){
|
|
74
|
+
return 'dk';
|
|
75
|
+
} else if (device === 'iPad' || device === 'iPhone') {
|
|
76
|
+
return 'mtWeb';
|
|
77
|
+
} else {
|
|
78
|
+
return 'mtWeb';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const getAccountMenu = () => {
|
|
84
|
+
const url:URL = new URL(`${cmsendpoint}/${lang}/profile-menu?env=${env}`);
|
|
85
|
+
url.searchParams.append('device', setDevice())
|
|
86
|
+
fetch(url.href)
|
|
87
|
+
.then(res => res.json())
|
|
88
|
+
.then(menuData => {
|
|
89
|
+
|
|
90
|
+
menuItems = menuData;
|
|
91
|
+
setActiveMenuItem();
|
|
92
|
+
})
|
|
93
|
+
.catch(err => {
|
|
94
|
+
console.error('Error getting menu items', err);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const getPlayerInfo = ():void => {
|
|
99
|
+
let url:URL = new URL(`${endpoint}/v1/player/${playerid}/profile`);
|
|
100
|
+
|
|
101
|
+
url.searchParams.append('userRoles', userroles);
|
|
102
|
+
|
|
103
|
+
let options = {
|
|
104
|
+
method: 'GET',
|
|
105
|
+
headers: {
|
|
106
|
+
'X-SessionID': session,
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
fetch(url.href, options)
|
|
111
|
+
.then((res:any) => res.json())
|
|
112
|
+
.then((data:any):void => {
|
|
113
|
+
|
|
114
|
+
profileUsername = data.username;
|
|
115
|
+
profileEmail = data.email;
|
|
116
|
+
|
|
117
|
+
}, (err:any):void => {
|
|
118
|
+
console.error(err);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const openAccountSection = (item:any):void => {
|
|
123
|
+
window.postMessage({ type: 'ChangeAccountPage', page: item}, window.location.href);
|
|
124
|
+
|
|
125
|
+
selectedItem = item.id;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const logOut = ():void => {
|
|
129
|
+
window.postMessage({ type: 'LogOut'}, window.location.href);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const setActiveMenuItem = () => {
|
|
133
|
+
selectedItem = menuItems.find((item) => item.path.includes(activemenuitem))?.id;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const goToHome = ():void => {
|
|
137
|
+
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const setActiveLanguage = ():void => {
|
|
141
|
+
setLocale(lang);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const initialLoad = ():void => {
|
|
145
|
+
getPlayerInfo();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const setClientStyling = ():void => {
|
|
149
|
+
let sheet:HTMLElement = document.createElement('style');
|
|
150
|
+
sheet.innerHTML = clientstyling;
|
|
151
|
+
customStylingContainer.appendChild(sheet);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const setClientStylingURL = ():void => {
|
|
155
|
+
let url:URL = new URL(clientstylingurl);
|
|
156
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
157
|
+
|
|
158
|
+
fetch(url.href)
|
|
159
|
+
.then((res:any) => res.text())
|
|
160
|
+
.then((data:any) => {
|
|
161
|
+
cssFile.innerHTML = data
|
|
162
|
+
|
|
163
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
onMount(() => {
|
|
168
|
+
window.addEventListener('message', messageHandler, false);
|
|
169
|
+
return () => {
|
|
170
|
+
window.removeEventListener('message', messageHandler);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
$: lang && setActiveLanguage();
|
|
175
|
+
$: endpoint && session && playerid && lang && initialLoad();
|
|
176
|
+
$: cmsendpoint && lang && env && getAccountMenu();
|
|
177
|
+
$: activemenuitem && setActiveMenuItem();
|
|
178
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
179
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
180
|
+
$: translationurl && setTranslationUrl();
|
|
181
|
+
</script>
|
|
182
|
+
|
|
183
|
+
<div bind:this={customStylingContainer}>
|
|
184
|
+
{#if isLoading}
|
|
185
|
+
<div class="ModalLoader"></div>
|
|
186
|
+
{:else}
|
|
187
|
+
|
|
188
|
+
<div class="PlayerAccountMenuContainer {isMobile ? 'PlayerAccountMobileContainer' : ''} {mediaQuery.matches && isMobile ? 'PlayerAccountTabletContainer' : ''}">
|
|
189
|
+
<div class="PlayerAccountMenuHeader {isMobile ? 'PlayerAccountMenuHeaderMobile' : ''}">
|
|
190
|
+
{#if isMobile }
|
|
191
|
+
<div class="PlayerAccountMenuCategoryWrapper">
|
|
192
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" on:click={goToHome}><defs><style>.aaa{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><g transform="translate(-20 -158)">
|
|
193
|
+
<g transform="translate(20 158)">
|
|
194
|
+
<path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
|
|
195
|
+
</g></g>
|
|
196
|
+
</svg>
|
|
197
|
+
<h3 class="PlayerAccountMenuCategoryTitle" on:click={goToHome}>{$_('title')}</h3>
|
|
198
|
+
</div>
|
|
199
|
+
{/if}
|
|
200
|
+
<p class="PlayerAccountMenuUser">{profileUsername}</p>
|
|
201
|
+
<p class="PlayerAccountMenuEmail">{profileEmail}</p>
|
|
202
|
+
{#if isMobile}
|
|
203
|
+
<div class="PlayerAccountLogOutArea">
|
|
204
|
+
<general-logout {endpoint} {session} buttonlocation="PlayerAccountMenu" {clientstyling} {clientstylingurl}></general-logout>
|
|
205
|
+
</div>
|
|
206
|
+
{/if}
|
|
207
|
+
</div>
|
|
208
|
+
<div class="PlayerAccountMenuList">
|
|
209
|
+
{#each menuItems as menuItem}
|
|
210
|
+
<div class="PlayerAccountMenuItemBox {(selectedItem === menuItem.id && !isMobile) ? 'PlayerAccountMenuActiveItemBox' : ''}" on:click="{() => openAccountSection(menuItem)}">
|
|
211
|
+
<p class="PlayerAccountMenuItemWrapper">
|
|
212
|
+
<img class="PlayerAccountMenuItemIcon {isMobile ? 'PlayerAccountMenuItemIconMobile' : ''}" src={menuItem.img} />
|
|
213
|
+
<span class="PlayerAccountMenuItemTitle">{menuItem.label}</span>
|
|
214
|
+
</p>
|
|
215
|
+
</div>
|
|
216
|
+
{/each}
|
|
217
|
+
</div>
|
|
218
|
+
{#if !isMobile}
|
|
219
|
+
<div class="PlayerAccountLogOutArea">
|
|
220
|
+
<general-logout {endpoint} {session} buttonlocation="PlayerAccountMenu" {clientstyling} {clientstylingurl}></general-logout>
|
|
221
|
+
</div>
|
|
222
|
+
{/if}
|
|
223
|
+
</div>
|
|
224
|
+
{/if}
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
<style lang="scss">
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
.PlayerAccountMenuContainer {
|
|
233
|
+
color: var(--emfe-w-pam-typography-color-nav-bg, var(--emfe-w-color-contrast, #FFFFFF));
|
|
234
|
+
position: relative;
|
|
235
|
+
height: 100vh;
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
padding: 0 15px;
|
|
239
|
+
.PlayerAccountMenuItemWrapper {
|
|
240
|
+
margin: 0;
|
|
241
|
+
word-break: break-all;
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
span {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.PlayerAccountMenuHeader {
|
|
252
|
+
color: var(--emfe-w-pam-typography-color-nav-bg, var(--emfe-w-color-contrast, #FFFFFF));
|
|
253
|
+
flex-grow: 0;
|
|
254
|
+
padding: 30px 20px;
|
|
255
|
+
.PlayerAccountMenuUser {
|
|
256
|
+
margin-bottom: 5px;
|
|
257
|
+
font-size: 18px;
|
|
258
|
+
color: var(--emfe-w-pam-color-secondary, var(--emfe-w-color-secondary, #E98B10));
|
|
259
|
+
}
|
|
260
|
+
.PlayerAccountMenuEmail {
|
|
261
|
+
font-size: 14px;
|
|
262
|
+
text-overflow: ellipsis; overflow: hidden ;
|
|
263
|
+
}
|
|
264
|
+
p {
|
|
265
|
+
font-weight: 300;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.PlayerAccountMenuHeaderMobile {
|
|
270
|
+
color: var(--emfe-w-pam-typography-color-nav-bg, var(--emfe-w-color-contrast, #FFFFFF));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.PlayerAccountMenuItemBox {
|
|
274
|
+
padding: 16px 20px;
|
|
275
|
+
font-size: 16px;
|
|
276
|
+
line-height: 16px;
|
|
277
|
+
display: inline-flex;
|
|
278
|
+
width: 100%;
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
align-items: center;
|
|
281
|
+
border-radius: var(--emw--border-radius-medium, 20px);
|
|
282
|
+
border: 2px solid transparent;
|
|
283
|
+
cursor: pointer;
|
|
284
|
+
transition: all .3s linear;
|
|
285
|
+
&:hover {
|
|
286
|
+
transition: all .3s linear;
|
|
287
|
+
// background: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
288
|
+
background: rgba(35, 176, 78, 0.3);
|
|
289
|
+
border: 2px solid var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
290
|
+
border-radius: var(--emw--border-radius-medium, 20px);
|
|
291
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
292
|
+
}
|
|
293
|
+
.PlayerAccountMenuItemTitle {
|
|
294
|
+
margin-left: 20px;
|
|
295
|
+
}
|
|
296
|
+
.PlayerAccountMenuItemIcon {
|
|
297
|
+
width: 20px;
|
|
298
|
+
padding-top: unset;
|
|
299
|
+
}
|
|
300
|
+
.PlayerAccountMenuItemIconMobile {
|
|
301
|
+
width: 30px;
|
|
302
|
+
padding-top: 15px;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.PlayerAccountMenuList {
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.PlayerAccountMenuList::-webkit-scrollbar {
|
|
310
|
+
width: 6px;
|
|
311
|
+
}
|
|
312
|
+
/* Track */
|
|
313
|
+
.PlayerAccountMenuList::-webkit-scrollbar-track {
|
|
314
|
+
background: var(--emfe-w-color-gray-300, #58586B);
|
|
315
|
+
}
|
|
316
|
+
/* Handle */
|
|
317
|
+
.PlayerAccountMenuList::-webkit-scrollbar-thumb {
|
|
318
|
+
background: var(--emfe-w-color-gray-100, #E6E6E6);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.PlayerAccountLogOutArea {
|
|
322
|
+
background-color: rgba(253, 40, 57, 0.3);
|
|
323
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
|
324
|
+
border-radius: var(--emw--border-radius-medium, 20px);
|
|
325
|
+
width: 100%;
|
|
326
|
+
flex-grow: 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.PlayerAccountMenuActiveItemBox {
|
|
330
|
+
background: rgba(35, 176, 78, 0.3);
|
|
331
|
+
color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
332
|
+
border: 2px solid var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
333
|
+
border-radius: var(--emw--border-radius-medium, 20px);
|
|
334
|
+
transition: all .3s linear;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.PlayerAccountMobileContainer {
|
|
338
|
+
height: unset;
|
|
339
|
+
padding: 0;
|
|
340
|
+
.PlayerAccountMenuCategoryWrapper {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
gap: 10px;
|
|
344
|
+
margin-bottom: 18px;
|
|
345
|
+
}
|
|
346
|
+
.PlayerAccountMenuCategoryTitle {
|
|
347
|
+
margin: 0;
|
|
348
|
+
font-weight: 600;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.PlayerAccountMenuItemTitle {
|
|
352
|
+
margin-left: 0;
|
|
353
|
+
text-transform: capitalize;
|
|
354
|
+
line-height: 14px;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.PlayerAccountMenuEmail {
|
|
358
|
+
margin: 0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.PlayerAccountMenuList {
|
|
362
|
+
display: flex;
|
|
363
|
+
flex-direction: column;
|
|
364
|
+
align-items: flex-start;
|
|
365
|
+
margin: 0px 15px;
|
|
366
|
+
|
|
367
|
+
.PlayerAccountMenuItemBox {
|
|
368
|
+
background: rgba(35, 176, 78, 0.3);
|
|
369
|
+
color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
370
|
+
border: 2px solid var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #23B04E));
|
|
371
|
+
border-radius: var(--emw--border-radius-medium, 20px); // mobile border
|
|
372
|
+
height: 60px;
|
|
373
|
+
margin: 5px 0;
|
|
374
|
+
align-items: flex-start;
|
|
375
|
+
position: relative;
|
|
376
|
+
&.PlayerAccountMenuActiveItemBox {
|
|
377
|
+
background: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
|
|
378
|
+
}
|
|
379
|
+
.PlayerAccountMenuItemIcon {
|
|
380
|
+
width: 20px;
|
|
381
|
+
padding: 0 10px 0 15px;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.PlayerAccountMenuItemBox::after {
|
|
386
|
+
content: '';
|
|
387
|
+
display: inline-block;
|
|
388
|
+
width: 15px;
|
|
389
|
+
height: 15px;
|
|
390
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2215%22 height=%2215%22 viewBox=%220 0 15 15%22%3E%3Cdefs%3E%3Cstyle%3E.aaa%7Bfill:var(--emfe-w-color-white,%20%23FFFFFF);%7D%3C/style%3E%3C/defs%3E%3Cg transform=%22translate(-20%20-158)%22%3E%3Cg transform=%22translate(20%20158)%22%3E%3Cpath class=%22aaa%22 d=%22M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z%22 transform=%22translate(15%2015)%20rotate(180)%22%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
|
|
391
|
+
background-size: contain;
|
|
392
|
+
transform: scaleX(-1);
|
|
393
|
+
background-repeat: no-repeat;
|
|
394
|
+
position: absolute;
|
|
395
|
+
right: 15px;
|
|
396
|
+
top: 22px;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.PlayerAccountMenuItemWrapper {
|
|
400
|
+
display: flex;
|
|
401
|
+
justify-items: center;
|
|
402
|
+
align-items: center;
|
|
403
|
+
flex-flow: row;
|
|
404
|
+
gap: 6px;
|
|
405
|
+
position: absolute;
|
|
406
|
+
top: 0;
|
|
407
|
+
bottom: 0;
|
|
408
|
+
left: 0;
|
|
409
|
+
right: 0;
|
|
410
|
+
.PlayerAccountMenuItemTitle {
|
|
411
|
+
font-size: 16px;
|
|
412
|
+
line-height: 16px;
|
|
413
|
+
font-weight: 400;
|
|
414
|
+
word-break: break-word;
|
|
415
|
+
text-align: left;
|
|
416
|
+
color: var(--emfe-w-pam-typography-color-nav-bg, var(--emfe-w-color-contrast, #FFFFFF));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.PlayerAccountLogOutArea {
|
|
422
|
+
position: absolute;
|
|
423
|
+
right: 18px;
|
|
424
|
+
top: 56px;
|
|
425
|
+
bottom: unset;
|
|
426
|
+
background: transparent;
|
|
427
|
+
width: 48px;
|
|
428
|
+
border-top: 0;
|
|
429
|
+
// .PlayerAccountMenuItemBox {
|
|
430
|
+
// display: block;
|
|
431
|
+
// width: 24px;
|
|
432
|
+
// padding: 10px;
|
|
433
|
+
// svg {
|
|
434
|
+
// width: 24px;
|
|
435
|
+
// }
|
|
436
|
+
// }
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.PlayerAccountTabletContainer {
|
|
441
|
+
.PlayerAccountMenuHeader {
|
|
442
|
+
padding: 30px 40px;
|
|
443
|
+
}
|
|
444
|
+
.PlayerAccountMenuCategoryTitle {
|
|
445
|
+
font-size: 32px;
|
|
446
|
+
}
|
|
447
|
+
.PlayerAccountMenuUser {
|
|
448
|
+
font-size: 26px;
|
|
449
|
+
color: var(--emfe-w-pam-color-secondary, var(--emfe-w-color-secondary, #E98B10));
|
|
450
|
+
}
|
|
451
|
+
.PlayerAccountMenuEmail {
|
|
452
|
+
font-size: 20px;
|
|
453
|
+
}
|
|
454
|
+
.PlayerAccountMenuList {
|
|
455
|
+
column-gap: 20px;
|
|
456
|
+
row-gap: 20px;
|
|
457
|
+
padding: 0 40px 40px;
|
|
458
|
+
grid-template-columns: calc(33% - 11px) calc(33% - 11px) calc(33% - 11px);
|
|
459
|
+
.PlayerAccountMenuItemBox {
|
|
460
|
+
.PlayerAccountMenuItemIcon {
|
|
461
|
+
width: 80px;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
.PlayerAccountMenuItemWrapper {
|
|
465
|
+
gap: 28px;
|
|
466
|
+
.PlayerAccountMenuItemTitle {
|
|
467
|
+
font-size: 24px;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
.PlayerAccountLogOutArea {
|
|
472
|
+
right: 54px;
|
|
473
|
+
top: 72px;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
</style>
|
package/src/i18n.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dictionary,
|
|
3
|
+
locale,
|
|
4
|
+
addMessages,
|
|
5
|
+
_
|
|
6
|
+
} from 'svelte-i18n';
|
|
7
|
+
|
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
+
locale.subscribe((data) => {
|
|
10
|
+
if (data == null) {
|
|
11
|
+
dictionary.set(translations);
|
|
12
|
+
locale.set(_locale);
|
|
13
|
+
}
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function addNewMessages(lang, dict) {
|
|
20
|
+
addMessages(lang, dict);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const TRANSLATIONS = {
|
|
2
|
+
"en": {
|
|
3
|
+
"title": "My Account"
|
|
4
|
+
},
|
|
5
|
+
"zh-hk": {
|
|
6
|
+
"title": "我的帳戶"
|
|
7
|
+
},
|
|
8
|
+
"fr": {
|
|
9
|
+
"title": "Mon compte"
|
|
10
|
+
},
|
|
11
|
+
"tr": {
|
|
12
|
+
"title": "Hesabım"
|
|
13
|
+
},
|
|
14
|
+
"ro": {
|
|
15
|
+
"title": "Contul meu"
|
|
16
|
+
},
|
|
17
|
+
"es": {
|
|
18
|
+
"title": "Mi Cuenta"
|
|
19
|
+
},
|
|
20
|
+
"pt": {
|
|
21
|
+
"title": "Minha Conta"
|
|
22
|
+
},
|
|
23
|
+
"hr": {
|
|
24
|
+
"title": "Moj račun"
|
|
25
|
+
},
|
|
26
|
+
"pt-br": {
|
|
27
|
+
"title": "Minha conta"
|
|
28
|
+
},
|
|
29
|
+
"es-mx": {
|
|
30
|
+
"title": "Mi cuenta"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
import PlayerAccountMenu from '../src/PlayerAccountMenu';
|
|
4
|
+
|
|
5
|
+
// This default export determines where your story goes in the story list
|
|
6
|
+
export default {
|
|
7
|
+
title: 'PlayerAccountMenu',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 👇 We create a “template” of how args map to rendering
|
|
11
|
+
const PlayerAccountMenu = ({ aProperty }) => html`<player-account-menu></player-account-menu>`;
|
|
12
|
+
|
|
13
|
+
export const FirstStory = PlayerAccountMenu.bind({});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const TRANSLATIONS = {
|
|
2
|
+
en: {
|
|
3
|
+
myAccount: 'My Account',
|
|
4
|
+
profileInfo: 'Profile info',
|
|
5
|
+
accountSecurity: 'Account Security',
|
|
6
|
+
deposit: 'Deposit',
|
|
7
|
+
withdrawal: 'Withdrawal',
|
|
8
|
+
activeBonuses: 'Active bonuses',
|
|
9
|
+
selfExclusion: 'Self-exclusion',
|
|
10
|
+
accountClosure: 'Account closure'
|
|
11
|
+
},
|
|
12
|
+
de: {
|
|
13
|
+
myAccount: 'Mein Konto',
|
|
14
|
+
profileInfo: 'Profil Information',
|
|
15
|
+
accountSecurity: 'Konto Sicherheit',
|
|
16
|
+
deposit: 'Anzahlung',
|
|
17
|
+
withdrawal: 'Rückzug',
|
|
18
|
+
activeBonuses: 'Aktive Boni',
|
|
19
|
+
selfExclusion: 'Selbstausschluss',
|
|
20
|
+
accountClosure: 'Kontoschließung'
|
|
21
|
+
},
|
|
22
|
+
it: {
|
|
23
|
+
myAccount: 'Il mio conto',
|
|
24
|
+
profileInfo: 'Informazioni sul profilo',
|
|
25
|
+
accountSecurity: 'Sicurezza dell \'Account',
|
|
26
|
+
deposit: 'Depositare',
|
|
27
|
+
withdrawal: 'Ritiro',
|
|
28
|
+
activeBonuses: 'Bonus attivi',
|
|
29
|
+
selfExclusion: 'Autoesclusione',
|
|
30
|
+
accountClosure: 'Chiusura del conto'
|
|
31
|
+
},
|
|
32
|
+
fr: {
|
|
33
|
+
myAccount: 'Mon compte',
|
|
34
|
+
profileInfo: 'Informations sur le profil',
|
|
35
|
+
accountSecurity: 'Sécurité du compte',
|
|
36
|
+
deposit: 'Dépôt',
|
|
37
|
+
withdrawal: 'Retrait',
|
|
38
|
+
activeBonuses: 'Bonus actifs',
|
|
39
|
+
selfExclusion: 'Auto-exclusion',
|
|
40
|
+
accountClosure: 'La fermeture du compte'
|
|
41
|
+
},
|
|
42
|
+
es: {
|
|
43
|
+
myAccount: 'Mi cuenta',
|
|
44
|
+
profileInfo: 'Información de perfil',
|
|
45
|
+
accountSecurity: 'Seguridad de la cuenta',
|
|
46
|
+
deposit: 'Depositar',
|
|
47
|
+
withdrawal: 'Retiro',
|
|
48
|
+
activeBonuses: 'Bonificaciones activas',
|
|
49
|
+
selfExclusion: 'Autoexclusión',
|
|
50
|
+
accountClosure: 'Cierre de cuenta'
|
|
51
|
+
},
|
|
52
|
+
tr: {
|
|
53
|
+
myAccount: 'Hesabım',
|
|
54
|
+
profileInfo: 'Profil bilgisi',
|
|
55
|
+
accountSecurity: 'hesap Güvenliği',
|
|
56
|
+
deposit: 'PARA YATIR',
|
|
57
|
+
withdrawal: 'Para çekme',
|
|
58
|
+
activeBonuses: 'Aktif bonuslar',
|
|
59
|
+
selfExclusion: 'Kendini dışlama',
|
|
60
|
+
accountClosure: 'Hesap kapatma'
|
|
61
|
+
},
|
|
62
|
+
ru: {
|
|
63
|
+
myAccount: 'Мой аккаунт',
|
|
64
|
+
profileInfo: 'Информация о профиле',
|
|
65
|
+
accountSecurity: 'Безопасность аккаунта',
|
|
66
|
+
deposit: 'Депозит',
|
|
67
|
+
withdrawal: 'Вывод',
|
|
68
|
+
activeBonuses: 'Активные бонусы',
|
|
69
|
+
selfExclusion: 'Самоисключение',
|
|
70
|
+
accountClosure: 'Закрытие счета'
|
|
71
|
+
},
|
|
72
|
+
ro: {
|
|
73
|
+
myAccount: 'Contul meu',
|
|
74
|
+
profileInfo: 'Informatii despre profil',
|
|
75
|
+
accountSecurity: 'Securitatea contului',
|
|
76
|
+
deposit: 'Depunere',
|
|
77
|
+
withdrawal: 'Retragere',
|
|
78
|
+
activeBonuses: 'Bonusuri active',
|
|
79
|
+
selfExclusion: 'Auto-excludere',
|
|
80
|
+
accountClosure: 'Inchiderea contului'
|
|
81
|
+
}
|
|
82
|
+
};
|