@splash-tech/jackpot-sdk 3.0.0 → 3.0.2
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.
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { FooterWidgetBase } from '../../core/FooterWidgetBase';
|
|
2
2
|
var IncomingEvent;
|
|
3
3
|
(function (IncomingEvent) {
|
|
4
|
-
IncomingEvent["footerWidgetLoaded"] = "jackpot-
|
|
5
|
-
IncomingEvent["participateChange"] = "jackpot-
|
|
6
|
-
IncomingEvent["showPopup"] = "jackpot-
|
|
7
|
-
IncomingEvent["hidePopup"] = "jackpot-
|
|
4
|
+
IncomingEvent["footerWidgetLoaded"] = "jackpot-footer-widget-loaded";
|
|
5
|
+
IncomingEvent["participateChange"] = "jackpot-footer-widget-participate-change";
|
|
6
|
+
IncomingEvent["showPopup"] = "jackpot-footer-widget-popup-show";
|
|
7
|
+
IncomingEvent["hidePopup"] = "jackpot-footer-widget-popup-hide";
|
|
8
8
|
})(IncomingEvent || (IncomingEvent = {}));
|
|
9
9
|
var OutgoingEvent;
|
|
10
10
|
(function (OutgoingEvent) {
|
|
11
|
-
OutgoingEvent["footerWidgetDataInitial"] = "jackpot-
|
|
12
|
-
OutgoingEvent["footerWidgetDataUpdated"] = "jackpot-
|
|
11
|
+
OutgoingEvent["footerWidgetDataInitial"] = "jackpot-footer-widget-data-initial";
|
|
12
|
+
OutgoingEvent["footerWidgetDataUpdated"] = "jackpot-footer-widget-data-updated";
|
|
13
13
|
})(OutgoingEvent || (OutgoingEvent = {}));
|
|
14
14
|
export class DefaultClientFooterWidget extends FooterWidgetBase {
|
|
15
15
|
constructor() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { WinWidgetBase } from '../../core/WinWidgetBase';
|
|
2
2
|
var IncomingEvent;
|
|
3
3
|
(function (IncomingEvent) {
|
|
4
|
-
IncomingEvent["winWidgetLoaded"] = "jackpot-
|
|
5
|
-
IncomingEvent["winWidgetClose"] = "jackpot-
|
|
4
|
+
IncomingEvent["winWidgetLoaded"] = "jackpot-win-widget-loaded";
|
|
5
|
+
IncomingEvent["winWidgetClose"] = "jackpot-win-widget-close";
|
|
6
6
|
})(IncomingEvent || (IncomingEvent = {}));
|
|
7
7
|
var OutgoingEvent;
|
|
8
8
|
(function (OutgoingEvent) {
|
|
9
|
-
OutgoingEvent["winWidgetDataInitial"] = "jackpot-
|
|
9
|
+
OutgoingEvent["winWidgetDataInitial"] = "jackpot-win-widget-data-initial";
|
|
10
10
|
})(OutgoingEvent || (OutgoingEvent = {}));
|
|
11
11
|
export class DefaultClientWinWidget extends WinWidgetBase {
|
|
12
12
|
get route() {
|
|
@@ -48,6 +48,7 @@ export class DefaultClientWinWidget extends WinWidgetBase {
|
|
|
48
48
|
targetContainer.style.position = 'relative';
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
// container
|
|
51
52
|
const container = document.createElement('div');
|
|
52
53
|
container.dataset.winWidget = 'container';
|
|
53
54
|
Object.assign(container.style, {
|
|
@@ -57,11 +58,38 @@ export class DefaultClientWinWidget extends WinWidgetBase {
|
|
|
57
58
|
height: '100%',
|
|
58
59
|
overflow: 'hidden',
|
|
59
60
|
zIndex: '99999999', // 8
|
|
60
|
-
clipPath: 'circle(0% at 50% 50%)',
|
|
61
|
-
transition: 'clip-path 1.2s cubic-bezier(0.22, 1, 0.36, 1)',
|
|
62
61
|
});
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
// circle
|
|
63
|
+
const circle = document.createElement('div');
|
|
64
|
+
circle.dataset.winWidget = 'circle';
|
|
65
|
+
Object.assign(circle.style, {
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
left: '50%',
|
|
68
|
+
top: '50%',
|
|
69
|
+
width: '0px',
|
|
70
|
+
height: '0px',
|
|
71
|
+
borderRadius: '50%',
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
transform: 'translate(-50%, -50%)',
|
|
74
|
+
transition: 'width 1.2s cubic-bezier(0.22, 1, 0.36, 1), height 1.2s cubic-bezier(0.22, 1, 0.36, 1)',
|
|
75
|
+
});
|
|
76
|
+
// iframe
|
|
77
|
+
const viewportW = `${window.innerWidth}px`;
|
|
78
|
+
const viewportH = `${window.innerHeight}px`;
|
|
79
|
+
Object.assign(iframe.style, {
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
left: '50%',
|
|
82
|
+
top: '50%',
|
|
83
|
+
width: viewportW,
|
|
84
|
+
height: viewportH,
|
|
85
|
+
transform: 'translate(-50%, -50%)',
|
|
86
|
+
border: 'none',
|
|
87
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
88
|
+
});
|
|
89
|
+
// append iframe into the circle, then circle into the container
|
|
90
|
+
circle.appendChild(iframe);
|
|
91
|
+
container.appendChild(circle);
|
|
92
|
+
// blur overlay
|
|
65
93
|
const overlay = document.createElement('div');
|
|
66
94
|
overlay.dataset.winWidget = 'overlay';
|
|
67
95
|
Object.assign(overlay.style, {
|
|
@@ -74,14 +102,23 @@ export class DefaultClientWinWidget extends WinWidgetBase {
|
|
|
74
102
|
backdropFilter: 'blur(0px)',
|
|
75
103
|
transition: 'background 0.8s ease, backdrop-filter 0.8s ease',
|
|
76
104
|
});
|
|
105
|
+
// append overlay and container into the targetContainer
|
|
77
106
|
targetContainer.appendChild(overlay);
|
|
107
|
+
targetContainer.appendChild(container);
|
|
108
|
+
// blur animation
|
|
78
109
|
setTimeout(() => {
|
|
79
110
|
overlay.style.background = 'rgba(0,0,0,0.4)';
|
|
80
111
|
overlay.style.backdropFilter = 'blur(8px)';
|
|
81
112
|
}, 200);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
113
|
+
// circle grow animation
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
const size = Math.ceil(Math.sqrt(window.innerWidth * window.innerWidth +
|
|
117
|
+
window.innerHeight * window.innerHeight) * 2);
|
|
118
|
+
circle.style.width = `${size}px`;
|
|
119
|
+
circle.style.height = `${size}px`;
|
|
120
|
+
}, 1000);
|
|
121
|
+
});
|
|
85
122
|
this.setLaunched(true);
|
|
86
123
|
}
|
|
87
124
|
cleanupLaunchAnimation() {
|