@betarena/ad-engine 0.0.76 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betarena/ad-engine",
3
- "version": "0.0.76",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "description": "Betarena ad-engine widget",
6
6
  "keywords": [
@@ -48,7 +48,6 @@
48
48
  import { storeSession } from './store/session.js';
49
49
 
50
50
  import iconClose from './assets/icon-close.svg';
51
- import iconArrow from './assets/icon-external-link.svg';
52
51
  import { logger } from './utils/debug.js';
53
52
 
54
53
  import type { AdsCreativeMain } from '@betarena/scores-lib/types/v8/_HASURA-0.js';
@@ -88,7 +87,7 @@
88
87
  * @example
89
88
  * => 10000 (10 seconds)
90
89
  */
91
- timeoutForAdvertShow = 10000,
90
+ timeoutForAdvertShow = 0,
92
91
  /**
93
92
  * @description
94
93
  * 📝 number of `milliseconds` for advert close action show
@@ -232,132 +231,153 @@
232
231
  out:fly={{ y: 500, duration: 500 }}
233
232
  class:dark-theme={isDarkTheme}
234
233
  >
234
+ <div
235
+ style=
236
+ "
237
+ position: relative;
238
+ height: 280px;
239
+ width: auto;
240
+ margin: 20px 19.5px 0 19.5px;
241
+ "
242
+ >
235
243
 
236
- <!--
237
- ╭─────
238
- │ ➤ (image) close
239
- ╰─────
240
- -->
241
- {#if isAdvertCloseBtnShown}
242
- <img
243
- id='close'
244
- src={iconClose}
245
- alt='icon-close'
246
- title='icon-close'
247
- loading='lazy'
248
- class=
249
- "
250
- cursor-pointer
251
- "
252
- on:click=
253
- {
254
- () =>
244
+ <!--
245
+ ╭─────
246
+ │ ➤ (image) close
247
+ ╰─────
248
+ -->
249
+ {#if isAdvertCloseBtnShown}
250
+ <img
251
+ id='close'
252
+ src={iconClose}
253
+ alt='icon-close'
254
+ title='icon-close'
255
+ loading='lazy'
256
+ class=
257
+ "
258
+ cursor-pointer
259
+ "
260
+ on:click=
255
261
  {
256
- betarenaAdEngineStore.updateData
257
- (
258
- [
259
- ['toggleAdShownState', undefined]
260
- ]
261
- );
262
- document.body.classList.remove
263
- (
264
- 'disable-scroll'
265
- );
266
- return;
262
+ () =>
263
+ {
264
+ betarenaAdEngineStore.updateData
265
+ (
266
+ [
267
+ ['toggleAdShownState', undefined]
268
+ ]
269
+ );
270
+ document.body.classList.remove
271
+ (
272
+ 'disable-scroll'
273
+ );
274
+ return;
275
+ }
267
276
  }
268
- }
269
- />
270
- {/if}
277
+ />
278
+ {/if}
271
279
 
272
- <!--
273
- ╭─────
274
- │ ➤ (image) banner image
275
- ╰─────
276
- -->
277
- {#if ((adData.type == 1 || adData.type == 4) && adData.data?.media)}
278
- <a
279
- href={adData.data.video_link}
280
- target="_blank"
281
- rel=
282
- "
283
- noopener
284
- noreferrer
285
- "
286
- on:click=
287
- {
288
- () =>
280
+ <!--
281
+ ╭─────
282
+ │ ➤ (image) banner image
283
+ ╰─────
284
+ -->
285
+ {#if ((adData.type == 1 || adData.type == 4) && adData.data?.media)}
286
+ <a
287
+ href={adData.data.video_link}
288
+ target="_blank"
289
+ rel=
290
+ "
291
+ noopener
292
+ noreferrer
293
+ "
294
+ on:click=
289
295
  {
290
- new ServiceAdEngine
291
- (
292
- betarenaEndpoint
293
- ).updateAdEngineClickCounter
294
- (
295
- {
296
- query: {
297
- creativeId: adData.id
298
- },
299
- body: {}
300
- }
301
- );
302
- return;
296
+ () =>
297
+ {
298
+ new ServiceAdEngine
299
+ (
300
+ betarenaEndpoint
301
+ ).updateAdEngineClickCounter
302
+ (
303
+ {
304
+ query: {
305
+ creativeId: adData.id
306
+ },
307
+ body: {}
308
+ }
309
+ );
310
+ return;
311
+ }
303
312
  }
304
- }
305
- >
306
- <!--
307
- <iframe
313
+ >
314
+ <!--
315
+ <iframe
316
+ width=250
317
+ height=250
318
+ src={adData.data?.media}
319
+ />
320
+ -->
321
+ <video
322
+ id="banner"
308
323
  width=250
309
324
  height=250
310
- src={adData.data?.media}
325
+ src={adData.data.media}
326
+ autoplay={true}
327
+ muted={true}
328
+ playsinline={true}
329
+ loop={true}
311
330
  />
331
+ </a>
332
+
333
+ {:else if adData.type == 3 && adData.data?.code}
334
+
335
+ <!--
336
+ sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
337
+ referrerpolicy="no-referrer-when-downgrade"
312
338
  -->
313
- <video
314
- id="banner"
315
- width=250
316
- height=250
317
- src={adData.data.media}
318
- autoplay={true}
319
- muted={true}
320
- playsinline={true}
321
- loop={true}
322
- />
323
- </a>
324
339
 
325
- {:else if adData.type == 3 && adData.data?.code}
326
340
 
327
- <!--
328
- sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
329
- referrerpolicy="no-referrer-when-downgrade"
330
- -->
341
+ <iframe
342
+ title="ad"
343
+ srcdoc='
344
+ <!doctype html>
345
+ <html
346
+ style=
347
+ "
348
+ overflow: scroll;
349
+ overflow-x: hidden;
350
+ height: 280px;
351
+ width: 336px;
352
+ "
353
+ >
354
+ <head>
355
+ <meta charset="utf-8">
356
+ </head>
357
+ <body
358
+ style=
359
+ "
360
+ margin:0;
361
+ "
362
+ >
363
+ {adData.data.code}
364
+ </body>
365
+ </html>
366
+ '
367
+ />
368
+
369
+ {:else if (adData.type == 2)}
370
+ <img
371
+ id='banner'
372
+ src={adData.data?.media}
373
+ alt=''
374
+ title=''
375
+ loading='lazy'
376
+ />
377
+
378
+ {/if}
331
379
 
332
- <iframe
333
- title="ad"
334
- width=300
335
- height=250
336
- srcdoc='
337
- <!doctype html>
338
- <html>
339
- <head>
340
- <meta charset="utf-8">
341
- </head>
342
- <body
343
- style="margin:0"
344
- >
345
- {adData.data.code}
346
- </body>
347
- </html>
348
- '
349
- />
350
-
351
- {:else if (adData.type == 2)}
352
- <img
353
- id='banner'
354
- src={adData.data?.media}
355
- alt=''
356
- title=''
357
- loading='lazy'
358
- />
359
-
360
- {/if}
380
+ </div>
361
381
 
362
382
  <!--
363
383
  ╭─────
@@ -377,11 +397,12 @@
377
397
  id="title"
378
398
  class=
379
399
  "
380
- s-20
381
- w-600
400
+ s-18
401
+ w-700
382
402
  m-0
383
403
  m-b-20
384
404
  text-center
405
+ color-white
385
406
  "
386
407
  >
387
408
  {@html adData.data?.title}
@@ -400,6 +421,10 @@
400
421
  noopener
401
422
  noreferrer
402
423
  "
424
+ style=
425
+ "
426
+ justify-content: center;
427
+ "
403
428
  on:click=
404
429
  {
405
430
  () =>
@@ -421,29 +446,22 @@
421
446
  }
422
447
  >
423
448
  <button
449
+ class=
450
+ "
451
+ btn-primary
452
+ "
424
453
  >
425
454
  <span
426
455
  class=
427
456
  "
428
- s-18
457
+ s-16
429
458
  w-500
459
+ color-dark-theme-1-7-shade
460
+ uppercase
430
461
  "
431
462
  >
432
463
  {adData.data?.cta_title ?? 'Recieve Bonus'}
433
464
  </span>
434
- <img
435
- id=''
436
- src={iconArrow}
437
- alt='icon-arrow'
438
- title='icon-arrow'
439
- loading='lazy'
440
- class=
441
- "
442
- m-l-10
443
- "
444
- width="12"
445
- height="12"
446
- />
447
465
  </button>
448
466
  </a>
449
467
 
@@ -480,17 +498,25 @@
480
498
  left: 0;
481
499
  /* 🎨 style */
482
500
  overflow: hidden;
483
- border-radius: 40px 40px 0px 0px;
484
- background-color: var(--white);
501
+ border-radius: 20px 20px 0px 0px;
502
+ background-color: #232323;
485
503
 
486
504
  @mixin banner
487
505
  {
488
506
  /* 🎨 style */
489
- max-height: 355px;
490
- min-height: 355px;
491
- width: 100%;
492
- background-color: black;
507
+ min-height: unset;
508
+ max-height: unset;
509
+ height: 280px;
510
+ border: none;
511
+ width: 336px;
493
512
  object-fit: cover;
513
+
514
+ /* 📌 position */
515
+ position: absolute;
516
+ top: 50%;
517
+ left: 50%;
518
+ transform: translate(-50%, -50%);
519
+ margin: 0;
494
520
  }
495
521
 
496
522
  img
@@ -526,7 +552,7 @@
526
552
  div#main-box
527
553
  {
528
554
  /* 🎨 style */
529
- padding: 20px 20px 35px 20px;
555
+ padding: 20px 12.5px 60px 12.5px;
530
556
 
531
557
  p
532
558
  {
@@ -540,13 +566,13 @@
540
566
  button
541
567
  {
542
568
  /* 🎨 style */
543
- border-radius: 7.57px;
544
- max-height: 50px;
545
- min-height: 50px;
569
+ border-radius: 8px;
570
+ max-height: 48px;
571
+ min-height: 48px;
546
572
  width: 100%;
547
- padding: 10px;
548
- 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 */;
549
- color: var(--white);
573
+ padding: 12px;
574
+ // 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 */;
575
+ color: var(--dark-theme-1-7-shade);
550
576
  }
551
577
  }
552
578