@betarena/ad-engine 0.0.53 โ†’ 0.0.56

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/README.md CHANGED
@@ -0,0 +1,45 @@
1
+ <h1
2
+ align="left"
3
+ style=
4
+ "
5
+ background: black;
6
+ "
7
+ >
8
+ <a
9
+ href="http://betarena.com/"
10
+ target="_blank"
11
+ >
12
+ <img
13
+ style=
14
+ "
15
+ padding: 5px;
16
+ background: black;
17
+ "
18
+ src="https://user-images.githubusercontent.com/20924663/148760091-dea6a851-1aa9-4dbb-ac29-59f2ce2ad493.png" alt="BetarenaLogo"
19
+ />
20
+ </a>
21
+ </h1>
22
+
23
+ [![npm version](https://badge.fury.io/js/@betarena%2Fad-engine.svg)](https://badge.fury.io/js/@betarena%2Fad-engine)
24
+
25
+ ## ๐Ÿ“ - Package Description
26
+
27
+ This `pacakge` is a gateway for making use of [**Betarena**](http://betarena.com/) `Advert Engine` system.
28
+
29
+ ## ๐Ÿš€ - Get Started
30
+
31
+ ```shell
32
+ npm install @betarena/ad-engine@latest
33
+ # OR
34
+ # pnpm [..]
35
+ # yarm [..]
36
+ ```
37
+
38
+ ### ๐Ÿงช - Local Development
39
+
40
+ ```shell
41
+ pnpm run 'vite/dev/1-click/pnpm'
42
+ ```
43
+
44
+ > [!IMPORTANT]
45
+ > It is strongly recommended to use `pnpm`, for its (1) symlink capabilites and (2) better `node_modules/` management when working on other Betarena project simultanously, that depend on `scores-lib`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betarena/ad-engine",
3
- "version": "0.0.53",
3
+ "version": "0.0.56",
4
4
  "private": false,
5
5
  "description": "Betarena ad-engine widget",
6
6
  "keywords": [
@@ -33,8 +33,8 @@
33
33
  "build": "vite build",
34
34
  "start": "node dist/index.js",
35
35
  "vite/dev": "vite --host",
36
- "vite/dev/1-click/npm": "npm run 'npm/link/@betarena/scores-lib' & npm run 'sass/watch' & npm run 'vite/dev'",
37
- "vite/dev/1-click/pnpm": "pnpm run 'pnpm/link/@betarena/scores-lib' & pnpm run 'sass/watch' & pnpm run 'vite/dev'",
36
+ "vite/dev/1-click/npm": "npm run 'sass/watch' & npm run 'vite/dev'",
37
+ "vite/dev/1-click/pnpm": "pnpm run 'sass/watch' & pnpm run 'vite/dev'",
38
38
  "vite/preview": "vite preview",
39
39
  "svelte-check": "svelte-check --tsconfig ./tsconfig.json",
40
40
  "npm/next/@betarena/scores-lib": "npm i @betarena/scores-lib@latest",
@@ -42,6 +42,7 @@
42
42
  "npm/link": "npm link",
43
43
  "npm/bump+publish": "npm version patch && npm publish",
44
44
  "sass/watch": "sass --watch src/style/app.scss src/style/app.css",
45
+ "pnpm/link": "pnpm link --dir . --global",
45
46
  "pnpm/link/@betarena/scores-lib": "pnpm link --global @betarena/scores-lib"
46
47
  },
47
48
  "devDependencies": {
package/src/App.svelte CHANGED
@@ -1,3 +1,17 @@
1
+ <!--
2
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
3
+ โ”‚ ๐Ÿ“Œ High Order Component Overview โ”‚
4
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
5
+ โ”‚ โžค Internal Svelte Code Format :|: V.8.0 โ”‚
6
+ โ”‚ โžค Status :|: ๐Ÿ”’ LOCKED โ”‚
7
+ โ”‚ โžค Author(s) :|: @migbash โ”‚
8
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
9
+ โ”‚ ๐Ÿ“ Description โ”‚
10
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
11
+ โ”‚ Application Entrypoint โ”‚
12
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
13
+ -->
14
+
1
15
  <!--
2
16
  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
3
17
  โ”‚ ๐ŸŸฆ Svelte Component JS/TS โ”‚
@@ -24,8 +38,8 @@
24
38
  // โ”‚ 5. type(s) imports(s) โ”‚
25
39
  // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
26
40
 
27
- // import AdvertEngineWidget from "./lib/Advert-Engine-Widget.svelte";
28
- import AdvertInterScroller from "./lib/Advert-InterScroller.svelte";
41
+ import AdvertEngineWidget from './lib/Advert-Engine-Widget.svelte';
42
+
29
43
  // #endregion โžค ๐Ÿ“ฆ Package Imports
30
44
 
31
45
  </script>
@@ -41,8 +55,4 @@
41
55
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
42
56
  -->
43
57
 
44
- <!-- <AdvertEngineWidget /> -->
45
-
46
- <AdvertInterScroller containerSelector="#content">
47
- <div id="content" style="margin-inline: 20px;" class="svelte-w74u0i"><p><strong>Mallorca</strong> and <strong>Valencia </strong>will be playing against each other on Friday, November 29th, 2024, at 20:00h (UTC), in a La Liga football game in Spain, check the Mallorca vs Valencia betting tip 2024/2025 to win with your bets.</p><h4>Stadium and City where Mallorca vs Valencia will occur</h4><p>The game takes place in the small <strong>Estadi Mallorca Son Moix</strong> stadium, in the city of <strong>Palma</strong>, with a capacity for 24642 spectators, who hope to help the team to surprise in this match.</p><h4>Where to follow the live game</h4><p>At Betarena, you can find everything about the <a href="https://scores.betarena.com">match live</a>, including <strong>statistics</strong>, <strong>events</strong>, <strong>odds</strong>, and everything else that can help with your <strong>sports betting</strong>.</p><h2>Introduction to the Mallorca vs Valencia betting tip 2024/2025</h2><p>Despite the season change, the La Liga has not changed much regarding goals. Today's average goals in the competition are still similar to what was seen in the tournament's last edition. The current mark is 2.58 goals per game, which is very close to the 2.64 goals per game of the last championship.</p><h4>Mallorca last match</h4><p><strong>Mallorca</strong> comes from a <strong>win</strong> in the last match played. On that occasion the opponent was <strong>Las Palmas</strong>, in a match valid for La Liga, and the match ended <strong>2-3</strong>. Coach <strong>J. Arrasate's</strong> team lined up with this formation: 4-4-2.</p><p>Before the kick-off, the home win had odds of 2.80, which explains why it was considered to be a fairly close match.</p><p>An eye-popping performance did not accompany the victory for Mallorca. Despite this, the good appearances of <strong>Vedat Muriqi</strong> deserve mentioning. The athlete left the field as the main responsible for the positive result of the team.</p><h4>Valencia last match</h4><p>On the other hand, the <strong>visiting team</strong> arrives at this match after a <strong>victory</strong> in the last round. In a dispute valid for La Liga, Valencia, who used a 5-4-1 formation, faced the Real Betis team with a final score of <strong>4-2</strong>.</p><p>A win for the home team had odds of 2.50, which makes it clear that a close match was expected.</p><h4>Mallorca vs Valencia h2h</h4><p>Valencia was in 8th place <strong>when they last went head-to-head</strong> in La Liga against Mallorca, who was in 15th place. Valencia formed a 4-4-2 arrangement while Mallorca took to the pitch with a 5-3-2 formation.</p><p>The last time these teams met was in a <strong>La Liga</strong> themed match that took place on the 30-03-2024 during the 2023/2024 football season, it ended in a <strong>0-0 draw</strong>, a competitive one it was.</p><p>Last time a draw between these teams, what to expect now?</p><h2>Mallorca</h2><h4>La Liga leaderboard now</h4><p>Considering the home team <strong>Mallorca</strong>, standing in <strong>8th place</strong> with <strong>21 points</strong> in the La Liga competition in Spain. Their performance statistics have been such as <strong>6 wins</strong>, <strong>5 losses</strong> and, <strong>3 draws</strong>.</p><p>In the 15th round, the team has the same score as opposed to Girona who places just above in 7th place.</p><p>Mallorca will try to benefit of the home factor to get a win despite being ranked in the middle of the league table in the Spain La Liga and having no high ambitions or relegation concerns.</p><h4>Mallorca analysis</h4><p>At the end of round 14 Mallorca has a good ratio of goals made to goals conceded, with 13 goals to its credit against 12 conceded.</p><p>The average shooting on goal for the Mallorca team in the league is not the best. There are only 4 per game. This turns out to be another good indication that the team does not usually score many goals or give much work to the opposing goalkeepers.</p><p>Mallorca has a ball possession percentage of 46.07% in the league. This indicates that it is not the kind of team that shows up on the field to create play. Fans hope that something will change for the next match against Valencia and especially that the team will score more goals.</p><p>Mallorca has demonstrated their offensive prowess by scoring 13 times with 1330 attacks, while Valencia has only scored 12 times with 1091 attacks.</p><h4>Best goalscorer from Mallorca</h4><p>Until this stage of the season, in terms of individual exhibitions, the highlight is Dani Rodrรญguez. The Midfielder has scored 3 times in this competition and helped Mallorca avoiding adverse outcomes on several occasions.</p><h2>Valencia</h2><h4>La Liga leaderboard now</h4><p>With 10 points won, Valencia is in 18th place on the leaderboard, which leaves the team in the Relegation zone. The team's campaign so far is 2 wins against 6 losses, plus 4 draws.</p><p>This means that Espanyol team, in 19th place, is close behind in the 15th round with the same number of points.</p><h4>Valencia analysis</h4><p>Valencia, after 14 rounds, has conceded more goals than it has scored. The goals scored are in fact 12 while 19 are those conceded to opponents.</p><p>Recent games have demonstrated that Valencia is having difficulties in scoring goals, as they have recorded a low number of goals and a high number of matches where they failed to score. This suggests that their attacking play needs to be improved, with a focus on creating more quality chances.</p><p>The team does not shine in attack, with a scoring average of 1 goals per game. With these statistics against it, it can hardly count on a good result in the next away game.</p><h4>Best goalscorer from Valencia</h4><p>In the individual highlights of the team in the offensive sector, the focus falls on Hugo Duro so far in the competition. With 4 goals with his signature, the Attacker has helped his team Valencia to achieve victorious results this season.</p><h2>Now a few markets where you can get some return from your bets:</h2><h4>Goals Top Betting Tips</h4><p>It can also be interesting to bet on who will score in this match. The featured player of Mallorca is Dani Rodrรญguez, who has already scored 3 goals in the competition. On the other hand, the leading scorer of Valencia is Hugo Duro, he has scored in 4 opportunities.</p><p>75-90 minutes into the game is a good time to bet with most goals being made in this period.</p><p>Taking into consideration that Valencia scores an average of 0.33 goals per match when playing away, we should consider the under 2.5 betting market, especially because this team usually does not concede goals when playing out of their stadium.</p><p> Currently, at <a href="https://qg9t2.app.goo.gl/bet365_general" target="_blank" rel="noreferrer noopener">Bet365</a>, the odds for the Total Goals Under 2.5 market are quoted at 1.44.</p><h4>Corners Top Betting Tips</h4><p>The corners market can help a favorable return on your bets, the average team corners per game are 5.14 corners.</p><h4>Cards Top Betting Tips</h4><p>Highly disciplined, the teams have an average of only 4.36 yellow cards per match, when added together. In other words, the 'Under 4.5 cards' option looks like a great alternative for bettors.</p><p>On the Mallorca side, we know that it is a more aggressive team having received the red card 3 times this season, very different from Valencia who only saw the red card once. Both the red and yellow cards market can be a good bet.</p><p>This is a match with several good betting entries to have some return on sports betting.</p><p>Check other great betting tips <a href="https://scores.betarena.com/a/tag/forecasts">here</a>.</p></div>
48
- </AdvertInterScroller>
58
+ <AdvertEngineWidget />
package/src/index.js CHANGED
File without changes
package/src/index.ts CHANGED
@@ -1,5 +1,19 @@
1
- import AdvertEngineWidget from './lib/Advert-Engine-Widget.svelte';
2
- import AdvertInterScroller from './lib/Advert-InterScroller.svelte';
1
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
2
+ // โ”‚ ๐Ÿ“Œ High Order Overview โ”‚
3
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
4
+ // โ”‚ โžค Code Format // V.8.0 โ”‚
5
+ // โ”‚ โžค Status // ๐Ÿ”’ LOCKED โ”‚
6
+ // โ”‚ โžค Author(s) // @<author> โ”‚
7
+ // โ”‚ โžค Maintainer(s) // @<author> โ”‚
8
+ // โ”‚ โžค Created on // <date-created> โ”‚
9
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
10
+ // โ”‚ ๐Ÿ“ Description โ”‚
11
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
12
+ // โ”‚ <project> (Module)
13
+ // โ”‚ |: <insert-module-summary-here>
14
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
15
+
16
+ import App from './App.svelte';
3
17
 
4
18
  let
5
19
  /**
@@ -13,18 +27,16 @@ let
13
27
  // โ•ฐโ”€โ”€โ”€โ”€โ”€
14
28
  if (typeof document !== 'undefined')
15
29
  app
16
- = new AdvertEngineWidget
30
+ = new App
17
31
  (
18
32
  {
19
33
  target: document.body,
20
34
  props:
21
35
  {
22
- // authorId: 1
23
- authorArticleTagIds: [1]
24
36
  }
25
37
  }
26
38
  )
27
39
  ;
28
40
  ;
29
- export { AdvertInterScroller };
41
+
30
42
  export default app;
@@ -42,23 +42,25 @@
42
42
 
43
43
  // import '@fontsource/roboto';
44
44
 
45
- import { betarenaEndpoint } from './constants/instance.js';
45
+ import { removeNull } from '@betarena/scores-lib/dist/functions/func.common.js';
46
46
  import { betarenaAdEngineStore } from './_store.js';
47
- import { postMod } from './utils/fetch.js';
47
+ import { betarenaEndpoint } from './constants/instance.js';
48
+ import { storeSession } from './store/session.js';
49
+ import { logger } from './utils/debug.js';
48
50
  import { detectDeviceType } from './utils/device.js';
51
+ import { postMod } from './utils/fetch.js';
49
52
  import { getUserLocation } from './utils/geo.js';
50
- import { removeNull } from '@betarena/scores-lib/dist/functions/func.common.js';
51
- import { storeSession } from './store/session.js';
52
53
 
53
- import WidgetAdvertSlide from './Advert-Slide-Child.svelte';
54
54
  import WidgetAdGeneral from './Advert-General-Child.svelte';
55
+ import AdvertInterScrollerChild from './Advert-InterScroller-Child.svelte';
56
+ import WidgetAdvertSlide from './Advert-Slide-Child.svelte';
55
57
  import DevInfoBox from './misc/admin/Dev-Info-Box.svelte';
56
58
 
57
59
  import '../style/app.scss';
58
60
 
61
+ import type { AdsCreativeMain } from '@betarena/scores-lib/types/_AUTO-HASURA_.js';
59
62
  import type { IAdsRequestBody, IAdsResponseBody } from '@betarena/scores-lib/types/ad-engine/index.js';
60
63
  import type { GeoJsResponse } from './types/geojs.js';
61
- import type { AdsCreativeMain } from '@betarena/scores-lib/types/_AUTO-HASURA_.js';
62
64
 
63
65
  // #endregion โžค ๐Ÿ“ฆ Package Imports
64
66
 
@@ -126,12 +128,12 @@
126
128
  * @description
127
129
  * ๐Ÿ“ `Map` where, `key=ZoneId` and `value=HTMLElement`
128
130
  */
129
- betarenaAdsInjectMap: Map < number, Element > = new Map(),
131
+ mapBetarenaAdvertStandardElement = new Map < number, Element > (),
130
132
  /**
131
133
  * @description
132
- * ๐Ÿ“ temporary data
134
+ * ๐Ÿ“ `Map` where, `key=CreativeId` and `value=AdvertObject` (temporary)
133
135
  */
134
- creativeDataMap: Map < number, AdsCreativeMain > = new Map()
136
+ mapCreative = new Map < number, AdsCreativeMain > ()
135
137
  ;
136
138
 
137
139
  // #endregion โžค ๐Ÿ“Œ VARIABLES
@@ -166,13 +168,22 @@
166
168
  * @description
167
169
  * ๐Ÿ“ `List` of `HTMLElements` identified on `page` for a target `zone`.
168
170
  */
169
- htmlElementList = document.querySelectorAll('[data-betarena-zone-id]')
171
+ listElementTarget = document.querySelectorAll('[data-betarena-zone-id]')
170
172
  ;
171
173
 
174
+ // [๐Ÿž]
175
+ logger
176
+ (
177
+ [
178
+ '๐Ÿš checkpoint โžค generateElementMap(..) // START',
179
+ `๐Ÿ”น [var] โžค listElementTarget.length ${listElementTarget.length}`
180
+ ]
181
+ );
182
+
172
183
  // โ•ญโ”€โ”€โ”€โ”€โ”€
173
- // โ”‚ NOTE: |:| loop over elements detected as betarena elegible ads
184
+ // โ”‚ NOTE: |:| loop over elements detected as betarena elegible ads (global/outer)
174
185
  // โ•ฐโ”€โ”€โ”€โ”€โ”€
175
- for (const elem of htmlElementList)
186
+ for (const elem of listElementTarget)
176
187
  {
177
188
  const
178
189
  /**
@@ -184,7 +195,7 @@
184
195
 
185
196
  if (!value) continue;
186
197
 
187
- betarenaAdsInjectMap.set(parseInt(value), elem);
198
+ mapBetarenaAdvertStandardElement.set(parseInt(value), elem);
188
199
  }
189
200
 
190
201
  return
@@ -226,39 +237,47 @@
226
237
  ;
227
238
 
228
239
  // [๐Ÿž]
229
- console.log('response', response);
240
+ logger
241
+ (
242
+ [
243
+ '๐Ÿš checkpoint โžค injectBetarenaAds(..) // START',
244
+ `๐Ÿ”น [var] โžค response ${JSON.stringify(response)}`
245
+ ]
246
+ );
230
247
 
231
- creativeDataMap = new Map((response as IAdsResponseBody).ads ?? []);
248
+ mapCreative = new Map((response as IAdsResponseBody).ads ?? []);
232
249
 
233
250
  const
234
251
  /**
235
252
  * @description
236
- * ๐Ÿ“ `Map`
253
+ * ๐Ÿ“ `Map` where, `key=ZoneId` and `value=listCampaignId`
237
254
  */
238
255
  mapZoneIdToCampaignId = new Map ((response as IAdsResponseBody).mapZoneIdToCampaignId),
239
256
  /**
240
257
  * @description
241
- * ๐Ÿ“ `Map`
258
+ * ๐Ÿ“ `Map` where, `key=CampaignId` and `value=listCreativeId`
242
259
  */
243
260
  mapCampaignIdToCreativeId = new Map ((response as IAdsResponseBody).mapCampaignIdToCreativeId),
244
261
  /**
245
262
  * @description
246
- * ๐Ÿ“ `Map`
263
+ * ๐Ÿ“ `Map` where, `key=ZoneId` and `value=listAuthorId`
247
264
  */
248
265
  mapZoneToAuthorIds = new Map ((response as IAdsResponseBody).mapZoneIdToAuthorIds),
249
266
  /**
250
267
  * @description
251
- * ๐Ÿ“ `Map`
268
+ * ๐Ÿ“ `Map` where, `key=ZoneId` and `value=listTagId`
252
269
  */
253
270
  mapZoneToTagIds = new Map ((response as IAdsResponseBody).mapZoneIdToTagIds)
254
271
  ;
255
272
 
256
273
  // โ•ญโ”€โ”€โ”€โ”€โ”€
257
274
  // โ”‚ NOTE:
258
- // โ”‚ โžค [1] loop over retrieved/fetched elements, and
259
- // โ”‚ โžค [2] inject target `ads` in specific locations
275
+ // โ”‚ โžค [1] loop over retrieved/fetched elements identified in 'document',
276
+ // โ”‚ โžค [2] and inject target 'ADVERTS' in target specific locations.
277
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€
278
+ // โ”ƒ ZONE-ID :: 1,2,3
260
279
  // โ•ฐโ”€โ”€โ”€โ”€โ”€
261
- for (const [zoneId, element] of betarenaAdsInjectMap)
280
+ for (const [zoneId, element] of mapBetarenaAdvertStandardElement)
262
281
  {
263
282
  if (!geoLocation) continue;
264
283
 
@@ -276,55 +295,100 @@
276
295
  creativeAdData
277
296
  = removeNull
278
297
  (
279
- campaignIds.map
280
- (
281
- x =>
282
- {
283
- if (mapCampaignIdToCreativeId.has(x))
298
+ campaignIds
299
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
300
+ // โ”‚ NOTE:
301
+ // โ”‚ |: Filter out `campaign ids` that have no `creative ids`
302
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
303
+ .filter
304
+ (
305
+ x =>
284
306
  {
285
- const
286
- /**
287
- * @description
288
- * ๐Ÿ“ **creative ids**
289
- */
290
- creativeIds = mapCampaignIdToCreativeId.get(x)!
307
+ if (mapCampaignIdToCreativeId.has(x))
308
+ return true;
291
309
  ;
292
-
293
- for (const creativeId of creativeIds)
310
+ return false;
311
+ }
312
+ )
313
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
314
+ // โ”‚ NOTE:
315
+ // โ”‚ |: Map over `campaign ids` and return `creative data`
316
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
317
+ .map
318
+ (
319
+ x =>
320
+ {
321
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
322
+ // โ”‚ NOTE:
323
+ // โ”‚ |: Loop over creative data and inject adverts
324
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
325
+ for (const creativeId of mapCampaignIdToCreativeId.get(x)!)
294
326
  {
295
- if (creativeDataMap.has(creativeId))
296
- return creativeDataMap.get(creativeId);
327
+ if (mapCreative.has(creativeId))
328
+ return mapCreative.get(creativeId);
297
329
  ;
298
330
  }
299
331
  }
300
- }
301
- )
332
+ )
302
333
  ) as AdsCreativeMain[]
303
334
  ;
304
335
 
305
336
  // [๐Ÿž]
306
- // console.log('creativeAdData', creativeAdData);
307
-
308
- for (const adData of (creativeAdData ?? []))
337
+ logger
338
+ (
339
+ [
340
+ `๐Ÿ”น [var] โžค creativeAdData.length ${creativeAdData.length}`
341
+ ]
342
+ );
343
+
344
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
345
+ // โ”‚ NOTE:
346
+ // โ”‚ |: Loop over creative data and inject adverts, based on respective `zoneId`.
347
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
348
+ if (zoneId == 1)
309
349
  {
310
- new WidgetAdGeneral
311
- (
312
- {
313
- target: element,
314
- props:
350
+ for (const adData of (creativeAdData ?? []))
351
+ new WidgetAdGeneral
352
+ (
315
353
  {
316
- adData
354
+ target: element,
355
+ props:
356
+ {
357
+ adData
358
+ }
317
359
  }
318
- }
319
- );
360
+ );
361
+ ;
362
+ }
363
+ else if (zoneId == 2 || zoneId == 3)
364
+ {
365
+ for (const adData of (creativeAdData ?? []))
366
+ new AdvertInterScrollerChild
367
+ (
368
+ {
369
+ target: element,
370
+ props:
371
+ {
372
+ instanceNode: element,
373
+ objectAdverData: adData
374
+ }
375
+ }
376
+ );
377
+ ;
320
378
  }
321
379
  }
322
380
 
323
381
  // โ•ญโ”€โ”€โ”€โ”€โ”€
324
- // โ”‚ CHECK |:| for injection of 'global' placements ads (based on global page data)
382
+ // โ”‚ CHECK
383
+ // โ”‚ |: for case of injection of 'GLOBAL' placements for adverts,
384
+ // โ”‚ |: (a.k.a SLIDER / POPUP ads)
325
385
  // โ•ฐโ”€โ”€โ”€โ”€โ”€
326
386
  if (authorId || authorArticleTagIds.length > 0)
327
387
  {
388
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
389
+ // โ”‚ NOTE:
390
+ // โ”‚ |: Loop over creative data and inject adverts
391
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
328
392
  for (const [zoneId, authorIds] of mapZoneToAuthorIds)
329
393
  {
330
394
  if (!authorId || (authorIds.length > 0 && !authorIds.includes(authorId)))
@@ -361,8 +425,8 @@
361
425
 
362
426
  for (const creativeId of creativeIds)
363
427
  {
364
- if (creativeDataMap.has(creativeId))
365
- return creativeDataMap.get(creativeId);
428
+ if (mapCreative.has(creativeId))
429
+ return mapCreative.get(creativeId);
366
430
  ;
367
431
  }
368
432
  }
@@ -372,10 +436,19 @@
372
436
  ;
373
437
 
374
438
  // [๐Ÿž]
375
- console.log('creativeAdData-HERE1', creativeAdData);
439
+ logger
440
+ (
441
+ [
442
+ '๐Ÿš checkpoint โžค injectBetarenaAds(..) // CHECKPOINT-1',
443
+ `๐Ÿ”น [var] โžค creativeAdData ${creativeAdData.length}`
444
+ ]
445
+ );
376
446
 
447
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
448
+ // โ”‚ NOTE:
449
+ // โ”‚ |: Loop over creative data and inject adverts
450
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
377
451
  for (const adData of creativeAdData)
378
- {
379
452
  new WidgetAdvertSlide
380
453
  (
381
454
  {
@@ -386,9 +459,13 @@
386
459
  }
387
460
  }
388
461
  );
389
- }
462
+ ;
390
463
  }
391
464
 
465
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
466
+ // โ”‚ NOTE:
467
+ // โ”‚ |: Loop over creative data and inject adverts
468
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
392
469
  for (const [zoneId, tagIds] of mapZoneToTagIds)
393
470
  {
394
471
  if (tagIds.length > 0 && authorArticleTagIds.filter(x => { return tagIds.includes(x) } ).length == 0)
@@ -425,8 +502,8 @@
425
502
 
426
503
  for (const creativeId of creativeIds)
427
504
  {
428
- if (creativeDataMap.has(creativeId))
429
- return creativeDataMap.get(creativeId);
505
+ if (mapCreative.has(creativeId))
506
+ return mapCreative.get(creativeId);
430
507
  ;
431
508
  }
432
509
  }
@@ -436,10 +513,19 @@
436
513
  ;
437
514
 
438
515
  // [๐Ÿž]
439
- console.log('creativeAdData-HERE2', creativeAdData);
516
+ logger
517
+ (
518
+ [
519
+ '๐Ÿš checkpoint โžค injectBetarenaAds(..) // CHECKPOINT-2',
520
+ `๐Ÿ”น [var] โžค creativeAdData ${creativeAdData.length}`
521
+ ]
522
+ );
440
523
 
524
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
525
+ // โ”‚ NOTE:
526
+ // โ”‚ |: Loop over creative data and inject adverts
527
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
441
528
  for (const adData of creativeAdData)
442
- {
443
529
  new WidgetAdvertSlide
444
530
  (
445
531
  {
@@ -450,16 +536,34 @@
450
536
  }
451
537
  }
452
538
  );
453
- }
539
+ ;
454
540
  }
455
541
  }
456
542
  // โ•ญโ”€โ”€โ”€โ”€โ”€
457
- // โ”‚ CHECK |:| for case where no author or tag ids are present (global ads), but the ads are still fetched
543
+ // โ”‚ CHECK
544
+ // โ”‚ |: otherwise, case where NO (1) 'authorId' OR (2) 'tagIds' are present (a.k.a Global Ads),
545
+ // โ”‚ |: but data for ADS was still fetched (a.k.a Advert Condition was RETRIVED/HIT)
546
+ // โ”‚ |: inject SLIDER adverts in 'document.body'
458
547
  // โ•ฐโ”€โ”€โ”€โ”€โ”€
459
548
  else
460
549
  {
461
- for (const [adId, adData] of creativeDataMap)
550
+ // [๐Ÿž]
551
+ logger
552
+ (
553
+ [
554
+ '๐Ÿš checkpoint โžค injectBetarenaAds(..) // CHECKPOINT-3',
555
+ `๐Ÿ”น [var] โžค mapCreative.length ${mapCreative.size}`
556
+ ]
557
+ );
558
+
559
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
560
+ // โ”‚ NOTE:
561
+ // โ”‚ |: Loop over creative data and inject adverts
562
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
563
+ for (const [, adData] of mapCreative)
462
564
  {
565
+ if (adData.type != 1) continue;
566
+
463
567
  new WidgetAdvertSlide
464
568
  (
465
569
  {
@@ -494,17 +598,25 @@
494
598
  generateElementMap();
495
599
 
496
600
  // [๐Ÿž]
497
- // console.log('elements', betarenaAdsInjectMap);
498
- // console.log('elements', zoneIds);
601
+ logger
602
+ (
603
+ [
604
+ '๐Ÿš checkpoint โžค initialize(..) // START',
605
+ `๐Ÿ”น [var] โžค mapBetarenaAdvertStandardElement.size ${mapBetarenaAdvertStandardElement.size}`
606
+ // `๐Ÿ”น [var] โžค zoneIds ${JSON.stringify(zoneIds)}`
607
+ ]
608
+ );
499
609
 
500
610
  injectBetarenaAds
501
611
  (
502
612
  {
503
613
  deviceType,
504
- isoCountryCode: geoLocation?.country_code ?? 'EN',
614
+ // deviceType: 'mobile',
615
+ isoCountryCode: geoLocation.country_code ?? 'EN',
616
+ // isoCountryCode: 'BR',
505
617
  authorId,
506
618
  tagIds: authorArticleTagIds,
507
- zoneIds: [...betarenaAdsInjectMap.keys()]
619
+ zoneIds: [...mapBetarenaAdvertStandardElement.keys()]
508
620
  }
509
621
  );
510
622
 
@@ -527,7 +639,11 @@
527
639
  async () =>
528
640
  {
529
641
  betarenaAdEngineStore.useLocalStorage();
530
- await initialize();
642
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
643
+ // โ”‚ NOTE:
644
+ // โ”‚ |: Delay initialization to ensure all elements are loaded on page
645
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
646
+ setTimeout(() => { initialize(); return; }, 1000);
531
647
  return;
532
648
  }
533
649
  );
@@ -542,7 +658,6 @@
542
658
  () =>
543
659
  {
544
660
  detectDeviceType();
545
- console.log(detectDeviceType());
546
661
  return;
547
662
  }
548
663
  }
@@ -565,14 +680,14 @@
565
680
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
566
681
  -->
567
682
 
568
- {#if import.meta.env.DEV}
683
+ {#if false}
569
684
  <!--
570
685
  โ•ญโ”€โ”€โ”€โ”€โ”€
571
686
  โ”‚ [๐Ÿž]
572
687
  โ”‚ โžค Testing Configuration(s)
573
688
  โ•ฐโ”€โ”€โ”€โ”€โ”€
574
689
  -->
575
- <!-- <DevInfoBox>
690
+ <DevInfoBox>
576
691
  <p>
577
692
  [detected] Device Type :|: {deviceType}
578
693
  </p>
@@ -580,7 +695,7 @@
580
695
  [detected] Geo-Location :|: {geoLocation?.country_code}
581
696
  </p>
582
697
  <p>
583
- [detected] Page Advert Snippets Number :|: {betarenaAdsInjectMap.size}
698
+ [detected] Page Advert Snippets Number :|: {mapBetarenaAdvertStandardElement.size}
584
699
  </p>
585
700
  <p>
586
701
  [properties] AuthorId :|: {authorId}
@@ -589,9 +704,9 @@
589
704
  [properties] AuthorArticleTagIds :|: [{authorArticleTagIds}]
590
705
  </p>
591
706
  <p>
592
- [data] Adverts Fetched Number :|: {creativeDataMap.size}
707
+ [data] Adverts Fetched Number :|: {mapCreative.size}
593
708
  </p>
594
- </DevInfoBox> -->
709
+ </DevInfoBox>
595
710
 
596
711
  <!--
597
712
  โ•ญโ”€โ”€โ”€โ”€โ”€
@@ -599,17 +714,20 @@
599
714
  โ”‚ โžค Testing Advert(s)
600
715
  โ•ฐโ”€โ”€โ”€โ”€โ”€
601
716
  -->
602
- <!--
603
- <div
717
+ <!-- <div
604
718
  data-betarena-zone-id=1
605
719
  >
606
- </div>
720
+ </div> -->
607
721
 
608
722
  <hr>
609
723
 
610
724
  <div
611
725
  data-betarena-zone-id=2
612
726
  >
727
+ {#each { length: 25 } as _, i}
728
+ <p>
729
+ Loren ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, vestibulum mi id.
730
+ </p>
731
+ {/each}
613
732
  </div>
614
- -->
615
733
  {/if}
@@ -0,0 +1,395 @@
1
+ <!--
2
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
3
+ โ”‚ ๐Ÿ“Œ High Order Component Overview โ”‚
4
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
5
+ โ”‚ โžค Internal Svelte Code Format :|: V.8.0 โ”‚
6
+ โ”‚ โžค Status :|: ๐Ÿ”’ LOCKED โ”‚
7
+ โ”‚ โžค Author(s) :|: @migbash โ”‚
8
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
9
+ โ”‚ ๐Ÿ“ Description โ”‚
10
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
11
+ โ”‚ Betarena Ad-Engine Component - Interscroller โ”‚
12
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
13
+ -->
14
+
15
+ <!--
16
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
17
+ โ”‚ ๐ŸŸฆ Svelte Component JS/TS โ”‚
18
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
19
+ โ”‚ โžค HINT: โ”‚ Access snippets for '<script> [..] </script>' those found in โ”‚
20
+ โ”‚ โ”‚ '.vscode/snippets.code-snippets' via intellisense using 'doc' โ”‚
21
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
22
+ -->
23
+
24
+ <script lang="ts">
25
+
26
+ // #region โžค ๐Ÿ“ฆ Package Imports
27
+
28
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
29
+ // โ”‚ NOTE: โ”‚
30
+ // โ”‚ Please add inside 'this' region the 'imports' that are required โ”‚
31
+ // โ”‚ by 'this' .svelte file is ran. โ”‚
32
+ // โ”‚ IMPORTANT โ”‚
33
+ // โ”‚ Please, structure the imports as follows: โ”‚
34
+ // โ”‚ 1. svelte/sveltekit imports โ”‚
35
+ // โ”‚ 2. project-internal files and logic โ”‚
36
+ // โ”‚ 3. component import(s) โ”‚
37
+ // โ”‚ 4. assets import(s) โ”‚
38
+ // โ”‚ 5. type(s) imports(s) โ”‚
39
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
40
+
41
+ import { onMount } from 'svelte';
42
+
43
+ import { betarenaEndpoint } from './constants/instance.js';
44
+ import { storeAdmin } from './store/admin.js';
45
+ import { postMod } from './utils/fetch.js';
46
+
47
+ import type { AdsCreativeMain } from '@betarena/scores-lib/types/_AUTO-HASURA_.js';
48
+
49
+ // #endregion โžค ๐Ÿ“ฆ Package Imports
50
+
51
+ // #region โžค ๐Ÿ“Œ VARIABLES
52
+
53
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
54
+ // โ”‚ NOTE: โ”‚
55
+ // โ”‚ Please add inside 'this' region the 'variables' that are to be โ”‚
56
+ // โ”‚ and are expected to be used by 'this' .svelte file / component. โ”‚
57
+ // โ”‚ IMPORTANT โ”‚
58
+ // โ”‚ Please, structure the imports as follows: โ”‚
59
+ // โ”‚ 1. export const / let [..] โ”‚
60
+ // โ”‚ 2. const [..] โ”‚
61
+ // โ”‚ 3. let [..] โ”‚
62
+ // โ”‚ 4. $: [..] โ”‚
63
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
64
+
65
+ export let
66
+ /**
67
+ * @description
68
+ * ๐Ÿ“
69
+ */
70
+ listStrInsertAfter: [number, string] | undefined = [-1, 'p'],
71
+ /**
72
+ * @augments AdsCreativeMain
73
+ */
74
+ objectAdverData: AdsCreativeMain,
75
+ /**
76
+ * @description
77
+ * ๐Ÿ“
78
+ */
79
+ instanceNode: Element
80
+ ;
81
+
82
+ let
83
+ /**
84
+ * @description
85
+ * ๐Ÿ“
86
+ */
87
+ instanceAdvertInterscroller: HTMLDivElement
88
+ ;
89
+
90
+ // #endregion โžค ๐Ÿ“Œ VARIABLES
91
+
92
+ // #region โžค ๐Ÿ› ๏ธ METHODS
93
+
94
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
95
+ // โ”‚ NOTE: โ”‚
96
+ // โ”‚ Please add inside 'this' region the 'methods' that are to be โ”‚
97
+ // โ”‚ and are expected to be used by 'this' .svelte file / component. โ”‚
98
+ // โ”‚ IMPORTANT โ”‚
99
+ // โ”‚ Please, structure the imports as follows: โ”‚
100
+ // โ”‚ 1. function (..) โ”‚
101
+ // โ”‚ 2. async function (..) โ”‚
102
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
103
+
104
+ /**
105
+ * @author
106
+ * @ivanzob
107
+ * @summary
108
+ * ๐ŸŸฆ HELPER
109
+ * @description
110
+ * ๐Ÿ“ Inject Advert data
111
+ * @return { void }
112
+ */
113
+ function injectBetarenaInterscrollerAd
114
+ (
115
+ ): void
116
+ {
117
+ if (!instanceNode) return;
118
+
119
+ const
120
+ // โ•ญโ”€โ”€โ”€โ”€โ”€
121
+ // โ”‚ NOTE: |:| Destructuring listStrInsertAfter
122
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€
123
+ [
124
+ count,
125
+ n
126
+ ] = listStrInsertAfter ?? [-1, 'p'],
127
+ /**
128
+ * @description
129
+ * ๐Ÿ“
130
+ */
131
+ insertAfterNodes
132
+ = instanceNode.querySelectorAll(n)
133
+ ;
134
+
135
+ if (!insertAfterNodes.length)
136
+ return;
137
+ ;
138
+
139
+ let
140
+ /**
141
+ * @description
142
+ */
143
+ afterNode
144
+ ;
145
+
146
+ if (count >= 0)
147
+ afterNode = insertAfterNodes[count];
148
+ else if (count === -1)
149
+ if (insertAfterNodes.length > 2)
150
+ afterNode
151
+ = insertAfterNodes
152
+ [
153
+ Math.floor
154
+ (
155
+ Math.random() * (insertAfterNodes.length - 2)
156
+ ) + 1
157
+ ]
158
+ ;
159
+ else
160
+ afterNode = insertAfterNodes[0];
161
+ ;
162
+
163
+ if (!afterNode) return;
164
+
165
+ const
166
+ /**
167
+ * @description
168
+ * ๐Ÿ“
169
+ */
170
+ pos
171
+ = instanceNode.getBoundingClientRect()
172
+ ;
173
+
174
+ instanceAdvertInterscroller.style.display = 'flex';
175
+ instanceAdvertInterscroller.style.left = `${-pos.left}px`;
176
+
177
+ afterNode.insertAdjacentElement
178
+ (
179
+ 'afterend',
180
+ instanceAdvertInterscroller
181
+ );
182
+
183
+ return;
184
+ }
185
+
186
+ // #endregion โžค ๐Ÿ› ๏ธ METHODS
187
+
188
+ // #region โžค ๐Ÿ”„ LIFECYCLE [SVELTE]
189
+
190
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
191
+ // โ”‚ NOTE: โ”‚
192
+ // โ”‚ Please add inside 'this' region the 'logic' that should run โ”‚
193
+ // โ”‚ immediately and as part of the 'lifecycle' of svelteJs, โ”‚
194
+ // โ”‚ as soon as 'this' .svelte file is ran. โ”‚
195
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
196
+
197
+ onMount
198
+ (
199
+ () =>
200
+ {
201
+ injectBetarenaInterscrollerAd();
202
+
203
+ storeAdmin.updateData
204
+ (
205
+ [
206
+ ['numberOfAdvertsActive', null]
207
+ ]
208
+ );
209
+
210
+ return;
211
+ }
212
+ );
213
+
214
+ // #endregion โžค ๐Ÿ”„ LIFECYCLE [SVELTE]
215
+
216
+ </script>
217
+
218
+ <!--
219
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
220
+ โ”‚ ๐Ÿ’  Svelte Component HTML โ”‚
221
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
222
+ โ”‚ โžค HINT: โ”‚ Use 'Ctrl + Space' to autocomplete global class=styles, dynamically โ”‚
223
+ โ”‚ โ”‚ imported from './static/app.css' โ”‚
224
+ โ”‚ โžค HINT: โ”‚ access custom Betarena Scores VScode Snippets by typing emmet-like โ”‚
225
+ โ”‚ โ”‚ abbrev. โ”‚
226
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
227
+ -->
228
+
229
+ <div
230
+ id="inter-outer"
231
+ bind:this={instanceAdvertInterscroller}
232
+ class="interscroller-wrapper"
233
+ style=
234
+ "
235
+ display: none;
236
+ height: 100vh;
237
+ right: 0px;
238
+ width: 100vw;
239
+ max-width: 100vw;
240
+ "
241
+ >
242
+ <h2 class="info-box">
243
+ Advertisement
244
+ </h2>
245
+
246
+ <div
247
+ id="intscdiv"
248
+ class="interscroller-bg-wrapper"
249
+ style="height: 100%; right: 0px; clip: rect(0px 100vw 100vh 0px); width: 100vw;"
250
+ >
251
+ <div
252
+ id="nxtads"
253
+ class=
254
+ "
255
+ interscroller-bg
256
+ "
257
+ style=
258
+ "
259
+ height: 100%;
260
+ width: 100%;
261
+ padding: 0px;
262
+ overflow: hidden;
263
+ text-align: center;
264
+ "
265
+ >
266
+ <div
267
+ style=
268
+ "
269
+ margin: 0px auto;
270
+ width: 100%;
271
+ height: 100%;
272
+ "
273
+ >
274
+ <a
275
+ target="_blank"
276
+ on:click=
277
+ {
278
+ () =>
279
+ {
280
+ postMod
281
+ (
282
+ `${betarenaEndpoint}/ad/update/click`,
283
+ {
284
+ creativeId: objectAdverData.id
285
+ }
286
+ );
287
+ }
288
+ }
289
+ href={objectAdverData.data?.cta_link}
290
+ >
291
+ <img
292
+ alt="ad_image"
293
+ class="ad_image"
294
+ src={objectAdverData.data?.media}
295
+ width="100%"
296
+ height="100%"
297
+ />
298
+ </a>
299
+ </div>
300
+ </div>
301
+ </div>
302
+
303
+ <h2 class="info-box">
304
+ Scroll to continue
305
+ </h2>
306
+ </div>
307
+
308
+ <!--
309
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
310
+ โ”‚ ๐ŸŒŠ Svelte Component CSS/SCSS โ”‚
311
+ โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
312
+ โ”‚ โžค HINT: โ”‚ auto-fill/auto-complete iniside <style> for var() โ”‚
313
+ โ”‚ โ”‚ values by typing/CTRL+SPACE โ”‚
314
+ โ”‚ โžค HINT: โ”‚ access custom Betarena Scores CSS VScode Snippets by typing 'style...' โ”‚
315
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
316
+ -->
317
+
318
+ <style lang="scss">
319
+
320
+ /*
321
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
322
+ โ”‚ ๐Ÿ“ฒ MOBILE-FIRST โ”‚
323
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
324
+ */
325
+
326
+ .info-box
327
+ {
328
+ color: var(--colors-text-text-primary-900, #fbfbfb);
329
+ text-align: center;
330
+ font-family: Roboto;
331
+ font-size: 12px !important;
332
+ font-style: normal;
333
+ font-weight: 700 !important;
334
+ line-height: 38px !important; /* 190% */
335
+ text-transform: uppercase;
336
+ width: 100%;
337
+ margin: 0 !important;
338
+ z-index: 1;
339
+ background: var(--colors-background-bg-secondary, #313131);
340
+ }
341
+
342
+ .interscroller-wrapper
343
+ {
344
+ position: relative !important;
345
+ cursor: pointer !important;
346
+ background: #ffffff !important;
347
+ z-index: 10000000 !important;
348
+ flex-direction: column;
349
+ justify-content: space-between;
350
+ }
351
+
352
+ .interscroller-bg-wrapper
353
+ {
354
+ position: absolute !important;
355
+ width: 100% !important;
356
+ left: 0 !important;
357
+ }
358
+
359
+ .interscroller-bg
360
+ {
361
+ position: fixed !important;
362
+ height: 100% !important;
363
+ top: 0;
364
+ backface-visibility: hidden !important;
365
+ -webkit-backface-visibility: hidden !important;
366
+ border: 0 !important;
367
+ }
368
+
369
+ .ad_image
370
+ {
371
+ width: 100% !important;
372
+ height: 100% !important;
373
+ max-width: 100vw !important;
374
+ max-height: 100% !important;
375
+ touch-action: manipulation;
376
+ user-select: none;
377
+ -webkit-user-drag: none;
378
+ -webkit-touch-callout: none;
379
+ }
380
+
381
+ /*
382
+ โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
383
+ โ”‚ โšก๏ธ RESPONSIVNESS โ”‚
384
+ โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
385
+ */
386
+
387
+ @media (min-width: 768px)
388
+ {
389
+ .info-box
390
+ {
391
+ font-size: 20px !important;
392
+ }
393
+ }
394
+
395
+ </style>
@@ -0,0 +1,49 @@
1
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
2
+ // โ”‚ ๐Ÿ“Œ High Order Overview โ”‚
3
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
4
+ // โ”‚ โžค Code Format // V.8.0 โ”‚
5
+ // โ”‚ โžค Status // ๐Ÿ”’ LOCKED โ”‚
6
+ // โ”‚ โžค Author(s) // @migbash โ”‚
7
+ // โ”‚ โžค Maintainer(s) // @migbash โ”‚
8
+ // โ”‚ โžค Created on // 05-12-2024 โ”‚
9
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
10
+ // โ”‚ ๐Ÿ“ Description โ”‚
11
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
12
+ // โ”‚ BETARENA (Module)
13
+ // โ”‚ |: Debug Logic
14
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
15
+
16
+ /* eslint-disable new-cap */
17
+
18
+ // #region ๐Ÿ“ฆ Package]
19
+
20
+ import chalk from 'chalk';
21
+
22
+ // #endregion โžค ๐Ÿ“ฆ Package Imports
23
+
24
+ /**
25
+ * @author
26
+ * @migbash
27
+ * @summary
28
+ * [๐Ÿž]
29
+ * @description
30
+ * ๐Ÿ“ Custom `console.log(..)` wrapper for general logging.
31
+ * @param { string[] } listMsg
32
+ * ๐Ÿ’  **[required]** The message.
33
+ * @return { void }
34
+ */
35
+ export function logger
36
+ (
37
+ listMsg: string[]
38
+ ): void
39
+ {
40
+ // [๐Ÿž]
41
+ // eslint-disable-next-line no-console
42
+ console.log(chalk.hex('#FF7F50')('๐Ÿ“ฆ [ad-engine] :: โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€'));
43
+ for (const message of listMsg)
44
+ // [๐Ÿž]
45
+ // eslint-disable-next-line no-console
46
+ console.log(chalk.hex('#FF7F50')(`๐Ÿ“ฆ [ad-engine] :: ${message}`));
47
+ ;
48
+ return;
49
+ }
@@ -1,3 +1,24 @@
1
+ // โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
2
+ // โ”‚ ๐Ÿ“Œ High Order Overview โ”‚
3
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
4
+ // โ”‚ โžค Code Format // V.8.0 โ”‚
5
+ // โ”‚ โžค Status // ๐Ÿ”’ LOCKED โ”‚
6
+ // โ”‚ โžค Author(s) // @migbash โ”‚
7
+ // โ”‚ โžค Maintainer(s) // @migbash โ”‚
8
+ // โ”‚ โžค Created on // <date-created> โ”‚
9
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
10
+ // โ”‚ ๐Ÿ“ Description โ”‚
11
+ // โ”ฃโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ซ
12
+ // โ”‚ BETARENA (Module)
13
+ // โ”‚ |: Device Logic
14
+ // โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
15
+
16
+ // #region โžค ๐Ÿ“ฆ Package Imports
17
+
18
+ import { logger } from './debug.js';
19
+
20
+ // #endregion โžค ๐Ÿ“ฆ Package Imports
21
+
1
22
  /**
2
23
  * @author
3
24
  * @migbash
@@ -27,11 +48,30 @@ export function detectDeviceType
27
48
  isUserAgentTablet = /tablet|ipad/.test(userAgentObject)
28
49
  ;
29
50
 
51
+ let
52
+ /**
53
+ * @description
54
+ * ๐Ÿ“ Type of device
55
+ */
56
+ strDeviceType = 'desktop'
57
+ ;
58
+
30
59
  if (isUserAgentMobile)
31
- return 'mobile';
60
+ strDeviceType = 'mobile';
32
61
  else if (isUserAgentTablet)
33
- return 'tablet';
62
+ strDeviceType = 'tablet';
34
63
  else
35
- return 'desktop';
64
+ strDeviceType = 'desktop';
36
65
  ;
66
+
67
+ // [๐Ÿž]
68
+ logger
69
+ (
70
+ [
71
+ `๐Ÿ”น [var] โžค strDeviceType ${JSON.stringify(strDeviceType)}`,
72
+ '๐Ÿš checkpoint โžค detectDeviceType(..) // END'
73
+ ]
74
+ );
75
+
76
+ return strDeviceType;
37
77
  }
@@ -1,155 +0,0 @@
1
- <script lang="ts">
2
- import { onMount } from "svelte";
3
- // import { postMod } from "./utils/fetch";
4
- export let containerSelector = "#content";
5
- export let insertAfter = ["random", "p"];
6
- let adData = {
7
- id: 0,
8
- image: "",
9
- link: "",
10
- };
11
- let targetNode;
12
- let adNode: HTMLDivElement;
13
-
14
- // Fetch ad content
15
- async function fetchAd() {
16
- adData = {
17
- id: 1,
18
- image:
19
- "https://firebasestorage.googleapis.com/v0/b/betarena-ios.appspot.com/o/Betarena_Media%2Fads%2F0x1510ea733e1e81f9bcfcc4eabb5a2226d1a9f9ea18da9aea119ba28b8ed6be81%2FBRBet365ADInterscroller.png?alt=media&token=4b1ef015-2643-4834-9081-f2c763531a21",
20
- link: "http://google.com",
21
- };
22
- }
23
-
24
- function trackClick() {
25
- // postMod(`${betarenaEndpoint}/ad/update/click`, {
26
- // creativeId: adData.id,
27
- // });
28
- }
29
-
30
- onMount(async () => {
31
- targetNode = document.querySelector(containerSelector);
32
- await fetchAd();
33
- injectAdd(targetNode);
34
- });
35
-
36
- function injectAdd(node: Element | null) {
37
- if (!node) return;
38
- const [count, n] = insertAfter;
39
- const insertAfterNodes = node.querySelectorAll(n);
40
- if (!insertAfterNodes.length) return;
41
- let afterNode;
42
- if (typeof count === "number") {
43
- afterNode = insertAfterNodes[count];
44
- }
45
- if (count === "random") {
46
- if (insertAfterNodes.length > 2) {
47
- let randomCount =
48
- Math.floor(Math.random() * (insertAfterNodes.length - 2)) + 1;
49
- afterNode = insertAfterNodes[randomCount];
50
- } else {
51
- afterNode = insertAfterNodes[0];
52
- }
53
- }
54
- if (!afterNode) return;
55
- const pos = node.getBoundingClientRect();
56
- adNode.style.display = "flex";
57
- adNode.style.left = `${-pos.left}px`;
58
- afterNode.insertAdjacentElement("afterend", adNode);
59
- setTimeout(() => {
60
- window.addEventListener("scroll", handleScroll);
61
- }, 1000);
62
- }
63
- function handleScroll() {
64
- if (!adNode) return;
65
- const rect = adNode.getBoundingClientRect();
66
- if (rect.bottom < 0) {
67
- adNode.style.display = "none";
68
- window.removeEventListener("scroll", handleScroll);
69
- }
70
- }
71
- </script>
72
-
73
- <slot />
74
- <div
75
- id="inter-outer"
76
- bind:this={adNode}
77
- class="interscroller-wrapper"
78
- style="display: none; height: 100vh; right: 0px; width: 100vw;"
79
- >
80
- <h2 class="info-box">Advertisement</h2>
81
- <div
82
- id="intscdiv"
83
- class="interscroller-bg-wrapper"
84
- style="height: 100%; right: 0px; clip: rect(0px 100vw 100vh 0px); width: 100vw;"
85
- >
86
- <div
87
- id="nxtads"
88
- class="interscroller-bg"
89
- style="height: 100%; width: 100%; padding: 0px; overflow: hidden; text-align: center;"
90
- >
91
- <div
92
- id="smt-130304454"
93
- style="margin: 0px auto;width: 100%;height: 100%;/* position: absolute; *//* z-index: 1000000000; */"
94
- >
95
- <a target="_blank" on:click={trackClick} href={adData.link}>
96
- <img
97
- alt="ad_image"
98
- src={adData.image}
99
- width="100%"
100
- height="100%"
101
- />
102
- </a>
103
- </div>
104
- </div>
105
- </div>
106
- <h2 class="info-box">Scroll to continue</h2>
107
- </div>
108
-
109
- <style>
110
- .info-box {
111
- color: var(--colors-text-text-primary-900, #fbfbfb);
112
- text-align: center;
113
- font-family: Roboto;
114
- font-size: 12px;
115
- font-style: normal;
116
- font-weight: 700;
117
- line-height: 38px; /* 190% */
118
- text-transform: uppercase;
119
- width: 100%;
120
- margin: 0;
121
- z-index: 1;
122
- background: var(--colors-background-bg-primary-solid, #313131);
123
- }
124
- .interscroller-wrapper {
125
- position: relative !important;
126
- cursor: pointer !important;
127
- background: #ffffff !important;
128
- z-index: 10000000 !important;
129
- flex-direction: column;
130
- justify-content: space-between;
131
- /*border-top: 2px solid #cccccc;
132
- border-bottom: 2px solid #cccccc;*/
133
- }
134
-
135
- .interscroller-bg-wrapper {
136
- position: absolute !important;
137
- width: 100% !important;
138
- left: 0 !important;
139
- }
140
-
141
- .interscroller-bg {
142
- position: fixed !important;
143
- height: 100% !important;
144
- top: 0;
145
- backface-visibility: hidden !important;
146
- -webkit-backface-visibility: hidden !important;
147
- border: 0 !important;
148
- }
149
-
150
- @media (min-width: 768px) {
151
- .info-box {
152
- font-size: 20px;
153
- }
154
- }
155
- </style>