@betarena/ad-engine 0.3.3 → 1.0.0
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/index.js +15 -15
- package/package.json +4 -9
- package/src/App.svelte +2 -12
- package/src/lib/Advert-Engine-Widget.svelte +359 -637
- package/src/lib/Advert-General-Child.svelte +39 -22
- package/src/lib/Advert-InterScroller-Child.svelte +4 -3
- package/src/lib/Advert-Slide-Child.svelte +119 -73
- package/src/lib/misc/admin/Dev-Info-Box.svelte +11 -1
- package/src/lib/store/session.ts +5 -7
- package/src/lib/types/session.d.ts +0 -10
- package/src/style/app.css +0 -3024
- package/src/style/app.css.map +0 -1
- package/src/style/app.purged.min.scss +0 -137
- package/src/style/app.scss +0 -19
- package/src/style/scss/_document.scss +0 -41
- package/src/style/scss/_root.scss +0 -439
- package/src/style/scss/animation.scss +0 -36
- package/src/style/scss/button.scss +0 -266
- package/src/style/scss/common.scss +0 -40
- package/src/style/scss/font.scss +0 -296
- package/src/style/scss/layout.scss +0 -175
- package/src/style/scss/main.scss +0 -46
- package/src/style/scss/misc.scss +0 -189
- package/src/style/scss/spacing.scss +0 -41
|
@@ -187,21 +187,17 @@
|
|
|
187
187
|
noreferrer
|
|
188
188
|
"
|
|
189
189
|
>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
m-l-10
|
|
202
|
-
"
|
|
203
|
-
/>
|
|
204
|
-
</button>
|
|
190
|
+
{adData.data?.cta_title ?? 'Receive Bonus'}
|
|
191
|
+
<img
|
|
192
|
+
src={iconArrow}
|
|
193
|
+
alt='icon-arrow'
|
|
194
|
+
title='icon-arrow'
|
|
195
|
+
loading='lazy'
|
|
196
|
+
class=
|
|
197
|
+
"
|
|
198
|
+
icon-arrow
|
|
199
|
+
"
|
|
200
|
+
/>
|
|
205
201
|
</a>
|
|
206
202
|
|
|
207
203
|
</div>
|
|
@@ -230,13 +226,27 @@
|
|
|
230
226
|
{
|
|
231
227
|
/* 🎨 style */
|
|
232
228
|
overflow: hidden;
|
|
233
|
-
border-radius: 10px
|
|
234
|
-
background-color: #
|
|
229
|
+
border-radius: 10px;
|
|
230
|
+
background-color: var(--colors-background-bg-tertiary, #EBEDEF);
|
|
231
|
+
|
|
232
|
+
*, *::before, *::after
|
|
233
|
+
{
|
|
234
|
+
box-sizing: border-box;
|
|
235
|
+
}
|
|
235
236
|
|
|
236
237
|
p
|
|
237
238
|
{
|
|
238
239
|
/* 🎨 style */
|
|
239
|
-
font-family: "Roboto
|
|
240
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
241
|
+
margin: 0;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
a
|
|
245
|
+
{
|
|
246
|
+
text-decoration: none;
|
|
247
|
+
color: inherit;
|
|
248
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
249
|
+
cursor: pointer;
|
|
240
250
|
}
|
|
241
251
|
|
|
242
252
|
img
|
|
@@ -253,6 +263,7 @@
|
|
|
253
263
|
{
|
|
254
264
|
/* 🎨 style */
|
|
255
265
|
width: 100%;
|
|
266
|
+
border: none;
|
|
256
267
|
}
|
|
257
268
|
|
|
258
269
|
div#main-box
|
|
@@ -265,19 +276,25 @@
|
|
|
265
276
|
&#title
|
|
266
277
|
{
|
|
267
278
|
/* 🎨 style */
|
|
268
|
-
color: var(--
|
|
279
|
+
color: var(--colors-text-text-primary-900, #1F2328);
|
|
269
280
|
}
|
|
270
281
|
}
|
|
271
282
|
|
|
272
|
-
|
|
283
|
+
a
|
|
273
284
|
{
|
|
274
285
|
/* 🎨 style */
|
|
286
|
+
display: block;
|
|
275
287
|
border-radius: 7.57px;
|
|
276
288
|
max-height: 50px;
|
|
277
289
|
width: 100%;
|
|
278
290
|
padding: 10px;
|
|
279
|
-
background: radial-gradient(97.9% 290.93% at 11.52% 99.71%, #
|
|
280
|
-
color: var(--
|
|
291
|
+
background: radial-gradient(97.9% 290.93% at 11.52% 99.71%, var(--colors-success-700, #087443) 0%, var(--colors-success-500, #17B26A) 100%);
|
|
292
|
+
color: var(--colors-foreground-fg-primary-900, #1F2328);
|
|
293
|
+
|
|
294
|
+
.icon-arrow
|
|
295
|
+
{
|
|
296
|
+
margin-left: 10px;
|
|
297
|
+
}
|
|
281
298
|
}
|
|
282
299
|
}
|
|
283
300
|
}
|
|
@@ -345,16 +345,16 @@
|
|
|
345
345
|
z-index: 1;
|
|
346
346
|
/* 🎨 style */
|
|
347
347
|
width: 100%;
|
|
348
|
-
color: var(--colors-text-text-primary-900, #
|
|
348
|
+
color: var(--colors-text-text-primary-900, #1F2328);
|
|
349
349
|
text-align: center;
|
|
350
|
-
font-family: Roboto;
|
|
350
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
351
351
|
font-size: 12px !important;
|
|
352
352
|
font-style: normal;
|
|
353
353
|
font-weight: 700 !important;
|
|
354
354
|
line-height: 38px !important; /* 190% */
|
|
355
355
|
text-transform: uppercase;
|
|
356
356
|
margin: 0 !important;
|
|
357
|
-
background: var(--colors-background-bg-secondary, #
|
|
357
|
+
background: var(--colors-background-bg-secondary, #F5F6F7);
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
.interscroller-bg-wrapper
|
|
@@ -387,6 +387,7 @@
|
|
|
387
387
|
{
|
|
388
388
|
/* 🎨 style */
|
|
389
389
|
text-decoration: none;
|
|
390
|
+
color: inherit;
|
|
390
391
|
height: inherit;
|
|
391
392
|
/* 🛝 layout */
|
|
392
393
|
display: block;
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
import { betarenaAdEngineStore } from './_store.js';
|
|
46
46
|
import { betarenaEndpoint } from './constants/instance.js';
|
|
47
47
|
import { storeAdmin } from './store/admin.js';
|
|
48
|
-
import { storeSession } from './store/session.js';
|
|
49
48
|
|
|
50
49
|
import iconClose from './assets/icon-close.svg';
|
|
51
50
|
import { logger } from './utils/debug.js';
|
|
@@ -72,7 +71,12 @@
|
|
|
72
71
|
/**
|
|
73
72
|
* @augments AdsCreativeMain
|
|
74
73
|
*/
|
|
75
|
-
adData: AdsCreativeMain
|
|
74
|
+
adData: AdsCreativeMain,
|
|
75
|
+
/**
|
|
76
|
+
* @description
|
|
77
|
+
* 📝 Logged-in users should not wait for the initial advert show delay.
|
|
78
|
+
*/
|
|
79
|
+
isLoggedIn = false
|
|
76
80
|
;
|
|
77
81
|
|
|
78
82
|
const
|
|
@@ -111,7 +115,6 @@
|
|
|
111
115
|
;
|
|
112
116
|
|
|
113
117
|
$: ({ isBetarenaAdShownForToday } = { ...$betarenaAdEngineStore });
|
|
114
|
-
$: ({ isDarkTheme } = { ...$storeSession });
|
|
115
118
|
|
|
116
119
|
// #endregion ➤ 📌 VARIABLES
|
|
117
120
|
|
|
@@ -138,12 +141,8 @@
|
|
|
138
141
|
{
|
|
139
142
|
if (!isBetarenaAdShownForToday)
|
|
140
143
|
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// ╰─────
|
|
144
|
-
intTimeoutForAdvertShow = setTimeout
|
|
145
|
-
(
|
|
146
|
-
() =>
|
|
144
|
+
const
|
|
145
|
+
showAdvert = () =>
|
|
147
146
|
{
|
|
148
147
|
isAdvertShown = true;
|
|
149
148
|
|
|
@@ -166,9 +165,21 @@
|
|
|
166
165
|
);
|
|
167
166
|
|
|
168
167
|
return;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
}
|
|
169
|
+
;
|
|
170
|
+
|
|
171
|
+
// ╭─────
|
|
172
|
+
// │ NOTE: |:| Advert timeout start
|
|
173
|
+
// ╰─────
|
|
174
|
+
if (isLoggedIn)
|
|
175
|
+
showAdvert();
|
|
176
|
+
else
|
|
177
|
+
intTimeoutForAdvertShow = setTimeout
|
|
178
|
+
(
|
|
179
|
+
showAdvert,
|
|
180
|
+
timeoutForAdvertShow
|
|
181
|
+
)
|
|
182
|
+
;
|
|
172
183
|
|
|
173
184
|
storeAdmin.updateData
|
|
174
185
|
(
|
|
@@ -229,16 +240,9 @@
|
|
|
229
240
|
id={CNAME}
|
|
230
241
|
in:fly={{ y: 500, duration: 500 }}
|
|
231
242
|
out:fly={{ y: 500, duration: 500 }}
|
|
232
|
-
class:dark-theme={isDarkTheme}
|
|
233
243
|
>
|
|
234
244
|
<div
|
|
235
|
-
|
|
236
|
-
"
|
|
237
|
-
position: relative;
|
|
238
|
-
height: 280px;
|
|
239
|
-
width: auto;
|
|
240
|
-
margin: 20px 19.5px 0 19.5px;
|
|
241
|
-
"
|
|
245
|
+
class="ad-banner-wrapper"
|
|
242
246
|
>
|
|
243
247
|
|
|
244
248
|
<!--
|
|
@@ -250,8 +254,7 @@
|
|
|
250
254
|
<button
|
|
251
255
|
type="button"
|
|
252
256
|
aria-label="Close advert"
|
|
253
|
-
class="
|
|
254
|
-
style="background:none;border:none;padding:0;"
|
|
257
|
+
class="ad-close-btn"
|
|
255
258
|
on:click=
|
|
256
259
|
{
|
|
257
260
|
() =>
|
|
@@ -397,15 +400,7 @@
|
|
|
397
400
|
-->
|
|
398
401
|
<p
|
|
399
402
|
id="title"
|
|
400
|
-
class=
|
|
401
|
-
"
|
|
402
|
-
s-18
|
|
403
|
-
w-700
|
|
404
|
-
m-0
|
|
405
|
-
m-b-20
|
|
406
|
-
text-center
|
|
407
|
-
color-white
|
|
408
|
-
"
|
|
403
|
+
class="ad-title"
|
|
409
404
|
>
|
|
410
405
|
{@html adData.data?.title}
|
|
411
406
|
</p>
|
|
@@ -423,10 +418,7 @@
|
|
|
423
418
|
noopener
|
|
424
419
|
noreferrer
|
|
425
420
|
"
|
|
426
|
-
|
|
427
|
-
"
|
|
428
|
-
justify-content: center;
|
|
429
|
-
"
|
|
421
|
+
class="ad-cta-link ad-cta-btn"
|
|
430
422
|
on:click=
|
|
431
423
|
{
|
|
432
424
|
() =>
|
|
@@ -448,24 +440,11 @@
|
|
|
448
440
|
}
|
|
449
441
|
}
|
|
450
442
|
>
|
|
451
|
-
<
|
|
452
|
-
class=
|
|
453
|
-
"
|
|
454
|
-
btn-primary
|
|
455
|
-
"
|
|
443
|
+
<span
|
|
444
|
+
class="ad-cta-text"
|
|
456
445
|
>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
"
|
|
460
|
-
s-16
|
|
461
|
-
w-500
|
|
462
|
-
color-white
|
|
463
|
-
uppercase
|
|
464
|
-
"
|
|
465
|
-
>
|
|
466
|
-
{adData.data?.cta_title ?? 'Recieve Bonus'}
|
|
467
|
-
</span>
|
|
468
|
-
</button>
|
|
446
|
+
{adData.data?.cta_title ?? 'Receive Bonus'}
|
|
447
|
+
</span>
|
|
469
448
|
</a>
|
|
470
449
|
|
|
471
450
|
</div>
|
|
@@ -491,6 +470,12 @@
|
|
|
491
470
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
492
471
|
*/
|
|
493
472
|
|
|
473
|
+
:global(body.disable-scroll)
|
|
474
|
+
{
|
|
475
|
+
overflow: hidden !important;
|
|
476
|
+
height: 100%;
|
|
477
|
+
}
|
|
478
|
+
|
|
494
479
|
div#global⮕widget⮕betarenaAdEngine⮕main
|
|
495
480
|
{
|
|
496
481
|
/* 📌 position */
|
|
@@ -502,7 +487,35 @@
|
|
|
502
487
|
/* 🎨 style */
|
|
503
488
|
overflow: hidden;
|
|
504
489
|
border-radius: 20px 20px 0px 0px;
|
|
505
|
-
background-color: #
|
|
490
|
+
background-color: var(--colors-background-bg-secondary, #F5F6F7FF);
|
|
491
|
+
|
|
492
|
+
/* Shadows/shadow-xl */
|
|
493
|
+
box-shadow: 0 20px 24px -4px var(--colors-effects-shadows-shadow-xl_01, rgba(255, 255, 255, 0.00)), 0 8px 8px -4px var(--colors-effects-shadows-shadow-xl_02, rgba(255, 255, 255, 0.00)), 0 3px 3px -1.5px var(--colors-effects-shadows-shadow-xl_03, rgba(255, 255, 255, 0.00));
|
|
494
|
+
|
|
495
|
+
*, *::before, *::after
|
|
496
|
+
{
|
|
497
|
+
box-sizing: border-box;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
p
|
|
501
|
+
{
|
|
502
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
503
|
+
margin: 0;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
a
|
|
507
|
+
{
|
|
508
|
+
text-decoration: none;
|
|
509
|
+
color: inherit;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
button
|
|
513
|
+
{
|
|
514
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
515
|
+
border: none;
|
|
516
|
+
outline: none;
|
|
517
|
+
cursor: pointer;
|
|
518
|
+
}
|
|
506
519
|
|
|
507
520
|
@mixin banner
|
|
508
521
|
{
|
|
@@ -522,6 +535,22 @@
|
|
|
522
535
|
margin: 0;
|
|
523
536
|
}
|
|
524
537
|
|
|
538
|
+
.ad-banner-wrapper
|
|
539
|
+
{
|
|
540
|
+
position: relative;
|
|
541
|
+
height: 280px;
|
|
542
|
+
width: auto;
|
|
543
|
+
margin: 20px 19.5px 0 19.5px;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.ad-close-btn
|
|
547
|
+
{
|
|
548
|
+
background: none;
|
|
549
|
+
border: none;
|
|
550
|
+
padding: 0;
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
}
|
|
553
|
+
|
|
525
554
|
img
|
|
526
555
|
{
|
|
527
556
|
&.close-btn
|
|
@@ -536,19 +565,16 @@
|
|
|
536
565
|
&#banner
|
|
537
566
|
{
|
|
538
567
|
@include banner;
|
|
539
|
-
/* 🎨 style */
|
|
540
568
|
}
|
|
541
569
|
}
|
|
542
570
|
|
|
543
571
|
iframe
|
|
544
572
|
{
|
|
545
|
-
/* 🎨 style */
|
|
546
573
|
@include banner;
|
|
547
574
|
}
|
|
548
575
|
|
|
549
576
|
video
|
|
550
577
|
{
|
|
551
|
-
/* 🎨 style */
|
|
552
578
|
@include banner;
|
|
553
579
|
}
|
|
554
580
|
|
|
@@ -557,25 +583,51 @@
|
|
|
557
583
|
/* 🎨 style */
|
|
558
584
|
padding: 20px 12.5px 60px 12.5px;
|
|
559
585
|
|
|
560
|
-
|
|
586
|
+
.ad-title
|
|
561
587
|
{
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
588
|
+
font-size: 18px;
|
|
589
|
+
font-weight: 700;
|
|
590
|
+
margin: 0 0 20px 0;
|
|
591
|
+
text-align: center;
|
|
592
|
+
color: var(--colors-text-text-primary-900, #1F2328);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.ad-cta-link
|
|
596
|
+
{
|
|
597
|
+
display: flex;
|
|
598
|
+
justify-content: center;
|
|
599
|
+
text-decoration: none;
|
|
600
|
+
color: inherit;
|
|
567
601
|
}
|
|
568
602
|
|
|
569
|
-
|
|
603
|
+
.ad-cta-btn
|
|
570
604
|
{
|
|
571
605
|
/* 🎨 style */
|
|
572
606
|
border-radius: 8px;
|
|
573
607
|
max-height: 48px;
|
|
574
608
|
min-height: 48px;
|
|
575
609
|
width: 100%;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
610
|
+
text-align: center;
|
|
611
|
+
font-style: normal;
|
|
612
|
+
font-weight: 500;
|
|
613
|
+
padding: 9px 20px;
|
|
614
|
+
color: var(--colors-foreground-fg-primary-900, #161A28);
|
|
615
|
+
background: var(--colors-background-bg-brand-solid, #CFE61A);
|
|
616
|
+
border: 2px solid transparent;
|
|
617
|
+
border-image: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.00) 100%) 1;
|
|
618
|
+
|
|
619
|
+
&:hover {
|
|
620
|
+
background: var(--colors-background-bg-brand-solid_hover, #B3C912);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.ad-cta-text
|
|
626
|
+
{
|
|
627
|
+
font-size: 16px;
|
|
628
|
+
font-weight: 500;
|
|
629
|
+
color: var(--colors-foreground-fg-primary-900, #1F2328);
|
|
630
|
+
text-transform: uppercase;
|
|
579
631
|
}
|
|
580
632
|
}
|
|
581
633
|
|
|
@@ -584,15 +636,9 @@
|
|
|
584
636
|
span.custom-betarena-advert-x1
|
|
585
637
|
{
|
|
586
638
|
/* 🎨 style */
|
|
587
|
-
color: var(--
|
|
639
|
+
color: var(--colors-text-text-primary_on-brand, #E4FF30) !important;
|
|
588
640
|
}
|
|
589
641
|
}
|
|
590
642
|
}
|
|
591
643
|
|
|
592
|
-
/*
|
|
593
|
-
╭──────────────────────────────────────────────────────────────────────────────╮
|
|
594
|
-
│ 🌒 DARK-THEME │
|
|
595
|
-
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
596
|
-
*/
|
|
597
|
-
|
|
598
644
|
</style>
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
<button
|
|
167
167
|
class=
|
|
168
168
|
"
|
|
169
|
-
btn
|
|
169
|
+
ad-debug-btn
|
|
170
170
|
"
|
|
171
171
|
on:click=
|
|
172
172
|
{
|
|
@@ -246,6 +246,16 @@
|
|
|
246
246
|
font-weight: bold;
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
+
|
|
250
|
+
.ad-debug-btn
|
|
251
|
+
{
|
|
252
|
+
padding: 10px 17px;
|
|
253
|
+
border-radius: 12px;
|
|
254
|
+
background-color: #e6e6e6;
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
border: none;
|
|
257
|
+
outline: none;
|
|
258
|
+
}
|
|
249
259
|
}
|
|
250
260
|
}
|
|
251
261
|
|
package/src/lib/store/session.ts
CHANGED
|
@@ -30,14 +30,15 @@ const
|
|
|
30
30
|
*/
|
|
31
31
|
storeObject: IAdEngineSessionStore
|
|
32
32
|
= {
|
|
33
|
-
isDarkTheme: false,
|
|
34
33
|
data:
|
|
35
34
|
{
|
|
36
35
|
translation:
|
|
37
36
|
{
|
|
38
37
|
language: 'en',
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
translation: {
|
|
39
|
+
advertisement: 'ADVERTISEMENT',
|
|
40
|
+
scroll: 'SCROLL TO CONTINUE',
|
|
41
|
+
},
|
|
41
42
|
},
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -114,13 +115,10 @@ function createLocalStore
|
|
|
114
115
|
/**
|
|
115
116
|
* @description
|
|
116
117
|
*/
|
|
117
|
-
// eslint-disable-next-line no-unused-vars
|
|
118
118
|
dataPoint = iterator[1]
|
|
119
119
|
;
|
|
120
120
|
|
|
121
|
-
if (dataTarget == '
|
|
122
|
-
storeObject.isDarkTheme = !storeObject.isDarkTheme;
|
|
123
|
-
else if (dataTarget == 'setTranslation')
|
|
121
|
+
if (dataTarget == 'setTranslation')
|
|
124
122
|
storeObject.data.translation = dataPoint;
|
|
125
123
|
;
|
|
126
124
|
}
|
|
@@ -8,15 +8,6 @@ import type { IAdsServiceTranslations } from "@betarena/scores-lib/types/ad-engi
|
|
|
8
8
|
*/
|
|
9
9
|
export interface IAdEngineSessionStore
|
|
10
10
|
{
|
|
11
|
-
/**
|
|
12
|
-
* @description
|
|
13
|
-
* 📝 Wether theme is dark
|
|
14
|
-
* @example
|
|
15
|
-
* :: false
|
|
16
|
-
* @default
|
|
17
|
-
* :: false
|
|
18
|
-
*/
|
|
19
|
-
isDarkTheme: boolean;
|
|
20
11
|
/**
|
|
21
12
|
* @description
|
|
22
13
|
* 📝 store data proerty (to be updated)
|
|
@@ -36,6 +27,5 @@ export interface IAdEngineSessionStore
|
|
|
36
27
|
* 📝 store data proerty (to be updated)
|
|
37
28
|
*/
|
|
38
29
|
type IAdEngineSessionDataProp =
|
|
39
|
-
| 'darkTheme'
|
|
40
30
|
| 'setTranslation';
|
|
41
31
|
;
|