@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 +45 -0
- package/package.json +4 -3
- package/src/App.svelte +17 -7
- package/src/index.js +0 -0
- package/src/index.ts +18 -6
- package/src/lib/Advert-Engine-Widget.svelte +196 -78
- package/src/lib/Advert-InterScroller-Child.svelte +395 -0
- package/src/lib/utils/debug.ts +49 -0
- package/src/lib/utils/device.ts +43 -3
- package/src/lib/Advert-InterScroller.svelte +0 -155
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
|
+
[](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.
|
|
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 '
|
|
37
|
-
"vite/dev/1-click/pnpm": "pnpm run '
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
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
|
|
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
|
-
|
|
41
|
+
|
|
30
42
|
export default app;
|
|
@@ -42,23 +42,25 @@
|
|
|
42
42
|
|
|
43
43
|
// import '@fontsource/roboto';
|
|
44
44
|
|
|
45
|
-
import {
|
|
45
|
+
import { removeNull } from '@betarena/scores-lib/dist/functions/func.common.js';
|
|
46
46
|
import { betarenaAdEngineStore } from './_store.js';
|
|
47
|
-
import {
|
|
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
|
-
|
|
131
|
+
mapBetarenaAdvertStandardElement = new Map < number, Element > (),
|
|
130
132
|
/**
|
|
131
133
|
* @description
|
|
132
|
-
* ๐ temporary
|
|
134
|
+
* ๐ `Map` where, `key=CreativeId` and `value=AdvertObject` (temporary)
|
|
133
135
|
*/
|
|
134
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
198
|
+
mapBetarenaAdvertStandardElement.set(parseInt(value), elem);
|
|
188
199
|
}
|
|
189
200
|
|
|
190
201
|
return
|
|
@@ -226,39 +237,47 @@
|
|
|
226
237
|
;
|
|
227
238
|
|
|
228
239
|
// [๐]
|
|
229
|
-
|
|
240
|
+
logger
|
|
241
|
+
(
|
|
242
|
+
[
|
|
243
|
+
'๐ checkpoint โค injectBetarenaAds(..) // START',
|
|
244
|
+
`๐น [var] โค response ${JSON.stringify(response)}`
|
|
245
|
+
]
|
|
246
|
+
);
|
|
230
247
|
|
|
231
|
-
|
|
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,
|
|
259
|
-
// โ โค [2] inject target
|
|
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
|
|
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
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
298
|
+
campaignIds
|
|
299
|
+
// โญโโโโโ
|
|
300
|
+
// โ NOTE:
|
|
301
|
+
// โ |: Filter out `campaign ids` that have no `creative ids`
|
|
302
|
+
// โฐโโโโโ
|
|
303
|
+
.filter
|
|
304
|
+
(
|
|
305
|
+
x =>
|
|
284
306
|
{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
* @description
|
|
288
|
-
* ๐ **creative ids**
|
|
289
|
-
*/
|
|
290
|
-
creativeIds = mapCampaignIdToCreativeId.get(x)!
|
|
307
|
+
if (mapCampaignIdToCreativeId.has(x))
|
|
308
|
+
return true;
|
|
291
309
|
;
|
|
292
|
-
|
|
293
|
-
|
|
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 (
|
|
296
|
-
return
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
target: element,
|
|
314
|
-
props:
|
|
350
|
+
for (const adData of (creativeAdData ?? []))
|
|
351
|
+
new WidgetAdGeneral
|
|
352
|
+
(
|
|
315
353
|
{
|
|
316
|
-
|
|
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
|
|
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 (
|
|
365
|
-
return
|
|
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
|
-
|
|
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 (
|
|
429
|
-
return
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
498
|
-
|
|
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
|
-
|
|
614
|
+
// deviceType: 'mobile',
|
|
615
|
+
isoCountryCode: geoLocation.country_code ?? 'EN',
|
|
616
|
+
// isoCountryCode: 'BR',
|
|
505
617
|
authorId,
|
|
506
618
|
tagIds: authorArticleTagIds,
|
|
507
|
-
zoneIds: [...
|
|
619
|
+
zoneIds: [...mapBetarenaAdvertStandardElement.keys()]
|
|
508
620
|
}
|
|
509
621
|
);
|
|
510
622
|
|
|
@@ -527,7 +639,11 @@
|
|
|
527
639
|
async () =>
|
|
528
640
|
{
|
|
529
641
|
betarenaAdEngineStore.useLocalStorage();
|
|
530
|
-
|
|
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
|
|
683
|
+
{#if false}
|
|
569
684
|
<!--
|
|
570
685
|
โญโโโโโ
|
|
571
686
|
โ [๐]
|
|
572
687
|
โ โค Testing Configuration(s)
|
|
573
688
|
โฐโโโโโ
|
|
574
689
|
-->
|
|
575
|
-
|
|
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 :|: {
|
|
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 :|: {
|
|
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
|
+
}
|
package/src/lib/utils/device.ts
CHANGED
|
@@ -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
|
-
|
|
60
|
+
strDeviceType = 'mobile';
|
|
32
61
|
else if (isUserAgentTablet)
|
|
33
|
-
|
|
62
|
+
strDeviceType = 'tablet';
|
|
34
63
|
else
|
|
35
|
-
|
|
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>
|