@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.
@@ -187,21 +187,17 @@
187
187
  noreferrer
188
188
  "
189
189
  >
190
- <button
191
- >
192
- {adData.data?.cta_title ?? 'Recieve Bonus'}
193
- <img
194
- id=''
195
- src={iconArrow}
196
- alt='icon-arrow'
197
- title='icon-arrow'
198
- loading='lazy'
199
- class=
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 10px 10px 10px;
234
- background-color: #383838;
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(--white);
279
+ color: var(--colors-text-text-primary-900, #1F2328);
269
280
  }
270
281
  }
271
282
 
272
- button
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%, #2E6514 0%, #66BE3C 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */;
280
- color: var(--white);
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, #fbfbfb);
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, #313131);
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
- // NOTE: |:| Advert timeour start
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
- timeoutForAdvertShow
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
- style=
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="cursor-pointer"
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
- style=
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
- <button
452
- class=
453
- "
454
- btn-primary
455
- "
443
+ <span
444
+ class="ad-cta-text"
456
445
  >
457
- <span
458
- class=
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: #232323;
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
- p
586
+ .ad-title
561
587
  {
562
- &#title
563
- {
564
- /* 🎨 style */
565
- color: var(--dark-theme);
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
- button
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
- padding: 12px;
577
- // background: radial-gradient(97.9% 290.93% at 11.52% 99.71%, #2E6514 0%, #66BE3C 100%) /* warning: gradient uses a rotation that is not supported by CSS and may not behave as expected */;
578
- color: var(--dark-theme-1-7-shade);
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(--primary) !important;
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-dark
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
 
@@ -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
- // @ts-expect-error - 📝 translation object
40
- translations: {},
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 == 'darkTheme')
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
  ;