@shortkitsdk/web 0.3.0 → 0.3.1
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/dist/shortkit.cjs +147 -40
- package/dist/shortkit.js +147 -40
- package/dist/shortkit.min.js +1 -1
- package/dist/shortkit.mjs +147 -40
- package/dist/shortkit.slim.cjs +147 -40
- package/dist/shortkit.slim.js +147 -40
- package/dist/shortkit.slim.min.js +1 -1
- package/dist/shortkit.slim.mjs +147 -40
- package/package.json +1 -1
package/dist/shortkit.js
CHANGED
|
@@ -33851,7 +33851,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
33851
33851
|
}
|
|
33852
33852
|
setMuted(muted) {
|
|
33853
33853
|
this.isMuted = muted;
|
|
33854
|
-
for (const [, player] of this.pool.
|
|
33854
|
+
for (const [, player] of this.pool.assignments) {
|
|
33855
33855
|
player.muted = muted;
|
|
33856
33856
|
}
|
|
33857
33857
|
this._pushPlayerState({ isMuted: muted });
|
|
@@ -33864,7 +33864,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
33864
33864
|
}
|
|
33865
33865
|
setPlaybackRate(rate) {
|
|
33866
33866
|
this.playbackRate = rate;
|
|
33867
|
-
for (const [, player] of this.pool.
|
|
33867
|
+
for (const [, player] of this.pool.assignments) {
|
|
33868
33868
|
player.playbackRate = rate;
|
|
33869
33869
|
}
|
|
33870
33870
|
this._pushPlayerState({ playbackRate: rate });
|
|
@@ -34341,11 +34341,10 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
34341
34341
|
const player = this.pool.getPlayer(id);
|
|
34342
34342
|
if (player) {
|
|
34343
34343
|
player.pause();
|
|
34344
|
-
player.style.opacity = "0";
|
|
34345
34344
|
player._skRevealedFor = null;
|
|
34346
34345
|
}
|
|
34347
34346
|
this._stopTimeLoop(id);
|
|
34348
|
-
this.
|
|
34347
|
+
this._detachOverlay(id);
|
|
34349
34348
|
this._sk._tracker.deactivateContent();
|
|
34350
34349
|
}
|
|
34351
34350
|
// --- Time loop ---
|
|
@@ -34527,14 +34526,20 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
34527
34526
|
}
|
|
34528
34527
|
}
|
|
34529
34528
|
/** Clear the overlay container's DOM and unsubscribe tracked listeners. */
|
|
34530
|
-
|
|
34529
|
+
/** Unsubscribe overlay event listeners without clearing DOM. */
|
|
34530
|
+
_detachOverlay(itemId) {
|
|
34531
34531
|
const entry = this._overlayContainers.get(itemId);
|
|
34532
34532
|
if (!entry) return;
|
|
34533
34533
|
if (entry.unsub) {
|
|
34534
34534
|
entry.unsub();
|
|
34535
34535
|
entry.unsub = null;
|
|
34536
34536
|
}
|
|
34537
|
-
|
|
34537
|
+
}
|
|
34538
|
+
/** Unsubscribe and clear overlay DOM (used on destroy). */
|
|
34539
|
+
_clearOverlay(itemId) {
|
|
34540
|
+
this._detachOverlay(itemId);
|
|
34541
|
+
const entry = this._overlayContainers.get(itemId);
|
|
34542
|
+
if (entry) entry.el.innerHTML = "";
|
|
34538
34543
|
}
|
|
34539
34544
|
}
|
|
34540
34545
|
class EmbeddedFeedManager {
|
|
@@ -34648,7 +34653,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
34648
34653
|
}
|
|
34649
34654
|
setMuted(muted) {
|
|
34650
34655
|
this.isMuted = muted;
|
|
34651
|
-
for (const [, player] of this.pool.
|
|
34656
|
+
for (const [, player] of this.pool.assignments) {
|
|
34652
34657
|
player.muted = muted;
|
|
34653
34658
|
}
|
|
34654
34659
|
this._pushPlayerState({ isMuted: muted });
|
|
@@ -34661,7 +34666,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
34661
34666
|
}
|
|
34662
34667
|
setPlaybackRate(rate) {
|
|
34663
34668
|
this.playbackRate = rate;
|
|
34664
|
-
for (const [, player] of this.pool.
|
|
34669
|
+
for (const [, player] of this.pool.assignments) {
|
|
34665
34670
|
player.playbackRate = rate;
|
|
34666
34671
|
}
|
|
34667
34672
|
this._pushPlayerState({ playbackRate: rate });
|
|
@@ -34933,11 +34938,10 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
34933
34938
|
const p = this.pool.getPlayer(id);
|
|
34934
34939
|
if (p) {
|
|
34935
34940
|
p.pause();
|
|
34936
|
-
p.style.opacity = "0";
|
|
34937
34941
|
p._skRevealedFor = null;
|
|
34938
34942
|
}
|
|
34939
34943
|
this._stopTimeLoop(id);
|
|
34940
|
-
this.
|
|
34944
|
+
this._detachOverlay(id);
|
|
34941
34945
|
}
|
|
34942
34946
|
// --- Time loop (state emission only, no DOM updates) ---
|
|
34943
34947
|
_startTimeLoop(id, el, player) {
|
|
@@ -35136,14 +35140,20 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35136
35140
|
} catch (e) {
|
|
35137
35141
|
}
|
|
35138
35142
|
}
|
|
35139
|
-
|
|
35143
|
+
/** Unsubscribe overlay event listeners without clearing DOM. */
|
|
35144
|
+
_detachOverlay(itemId) {
|
|
35140
35145
|
const entry = this._overlayContainers.get(itemId);
|
|
35141
35146
|
if (!entry) return;
|
|
35142
35147
|
if (entry.unsub) {
|
|
35143
35148
|
entry.unsub();
|
|
35144
35149
|
entry.unsub = null;
|
|
35145
35150
|
}
|
|
35146
|
-
|
|
35151
|
+
}
|
|
35152
|
+
/** Unsubscribe and clear overlay DOM (used on destroy). */
|
|
35153
|
+
_clearOverlay(itemId) {
|
|
35154
|
+
this._detachOverlay(itemId);
|
|
35155
|
+
const entry = this._overlayContainers.get(itemId);
|
|
35156
|
+
if (entry) entry.el.innerHTML = "";
|
|
35147
35157
|
}
|
|
35148
35158
|
}
|
|
35149
35159
|
const MuteOnSvg = '<svg viewBox="0 0 24 24"><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"/></svg>';
|
|
@@ -35493,6 +35503,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35493
35503
|
this._isOpen = true;
|
|
35494
35504
|
this._onClose = onClose;
|
|
35495
35505
|
this._openItemId = item.id;
|
|
35506
|
+
this._openThumbnailUrl = item.thumbnailUrl || null;
|
|
35496
35507
|
const sourceRect = sourceEl.getBoundingClientRect();
|
|
35497
35508
|
const sourceRadius = parseFloat(getComputedStyle(sourceEl).borderRadius) || 12;
|
|
35498
35509
|
this.overlayEl.classList.add("skp-active");
|
|
@@ -35537,6 +35548,21 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35537
35548
|
feedEl.style.transform = "none";
|
|
35538
35549
|
feedEl.style.borderRadius = `${targetRadius}px`;
|
|
35539
35550
|
});
|
|
35551
|
+
this.feedManager.startObserver();
|
|
35552
|
+
this.feedManager._activateItem(item.id);
|
|
35553
|
+
this.overlayEl.classList.add("skp-feed-ready");
|
|
35554
|
+
const itemOverlay = feedItemEl?.querySelector('[data-ref="overlay"]');
|
|
35555
|
+
const chromeEls = [...this.overlayEl.querySelectorAll(".skp-feed-close, .sk-sidebar")];
|
|
35556
|
+
if (itemOverlay) chromeEls.push(itemOverlay);
|
|
35557
|
+
chromeEls.forEach((el) => {
|
|
35558
|
+
el.style.opacity = "0";
|
|
35559
|
+
el.style.transition = "none";
|
|
35560
|
+
});
|
|
35561
|
+
this.overlayEl.getBoundingClientRect();
|
|
35562
|
+
chromeEls.forEach((el) => {
|
|
35563
|
+
el.style.transition = "opacity .35s cubic-bezier(.32,.72,0,1)";
|
|
35564
|
+
el.style.opacity = "1";
|
|
35565
|
+
});
|
|
35540
35566
|
await this._waitForTransitionEnd(feedEl, 450);
|
|
35541
35567
|
feedEl.classList.remove("skp-flip-animating");
|
|
35542
35568
|
feedEl.style.transformOrigin = "";
|
|
@@ -35544,9 +35570,10 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35544
35570
|
feedEl.style.scrollSnapType = "";
|
|
35545
35571
|
feedEl.style.transform = "";
|
|
35546
35572
|
feedEl.style.borderRadius = "";
|
|
35547
|
-
|
|
35548
|
-
|
|
35549
|
-
|
|
35573
|
+
chromeEls.forEach((el) => {
|
|
35574
|
+
el.style.opacity = "";
|
|
35575
|
+
el.style.transition = "";
|
|
35576
|
+
});
|
|
35550
35577
|
this._escHandler = (e) => {
|
|
35551
35578
|
if (e.key === "Escape") this.close();
|
|
35552
35579
|
};
|
|
@@ -35559,33 +35586,44 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35559
35586
|
const feedWrapper = feedEl.parentNode;
|
|
35560
35587
|
const feedRect = feedEl.getBoundingClientRect();
|
|
35561
35588
|
const activeItemId = this.feedManager?.activeItemId;
|
|
35562
|
-
|
|
35563
|
-
if (activeItemId === this._openItemId) {
|
|
35564
|
-
const ejected = this.feedManager?.pool.ejectPlayer(activeItemId);
|
|
35565
|
-
if (ejected) {
|
|
35566
|
-
transferBack = true;
|
|
35567
|
-
transferVideo = ejected.video;
|
|
35568
|
-
transferHls = ejected.hls;
|
|
35569
|
-
}
|
|
35570
|
-
}
|
|
35589
|
+
const canTransfer = activeItemId === this._openItemId;
|
|
35571
35590
|
let targetRect = null;
|
|
35572
35591
|
if (this._onClose) targetRect = this._onClose("getSourceRect");
|
|
35573
35592
|
if (feedRect && targetRect) {
|
|
35574
|
-
if (this.feedManager?.activeItemId && !
|
|
35593
|
+
if (this.feedManager?.activeItemId && !canTransfer) {
|
|
35575
35594
|
this.feedManager._deactivateItem(this.feedManager.activeItemId);
|
|
35576
35595
|
}
|
|
35596
|
+
const targetItemId = canTransfer ? this._openItemId : activeItemId;
|
|
35597
|
+
if (targetItemId && this.feedManager) {
|
|
35598
|
+
const targetEl = this.feedManager.itemEls.get(targetItemId);
|
|
35599
|
+
if (targetEl) targetEl.scrollIntoView({ behavior: "instant", block: "start" });
|
|
35600
|
+
}
|
|
35601
|
+
const savedScrollTop = feedEl.scrollTop;
|
|
35577
35602
|
feedEl.style.position = "fixed";
|
|
35578
35603
|
feedEl.style.left = `${feedRect.left}px`;
|
|
35579
35604
|
feedEl.style.top = `${feedRect.top}px`;
|
|
35580
35605
|
feedEl.style.width = `${feedRect.width}px`;
|
|
35581
35606
|
feedEl.style.height = `${feedRect.height}px`;
|
|
35582
|
-
feedEl.style.zIndex =
|
|
35607
|
+
feedEl.style.zIndex = String(getComputedStyle(this.overlayEl).zIndex || 9999);
|
|
35583
35608
|
feedEl.style.margin = "0";
|
|
35584
35609
|
feedEl.style.flex = "none";
|
|
35585
35610
|
feedEl.style.aspectRatio = "unset";
|
|
35586
35611
|
feedEl.style.maxHeight = "none";
|
|
35587
35612
|
document.body.appendChild(feedEl);
|
|
35613
|
+
feedEl.scrollTop = savedScrollTop;
|
|
35588
35614
|
this.overlayEl.classList.remove("skp-active", "skp-feed-ready");
|
|
35615
|
+
let thumbOverlay = null;
|
|
35616
|
+
if (this._openThumbnailUrl) {
|
|
35617
|
+
const crossfadeItemId = canTransfer ? this._openItemId : activeItemId;
|
|
35618
|
+
const crossfadeEl = crossfadeItemId && this.feedManager?.itemEls.get(crossfadeItemId);
|
|
35619
|
+
const videoContainer = crossfadeEl?.querySelector('[data-ref="videoContainer"]');
|
|
35620
|
+
if (videoContainer) {
|
|
35621
|
+
thumbOverlay = document.createElement("img");
|
|
35622
|
+
thumbOverlay.src = this._openThumbnailUrl;
|
|
35623
|
+
thumbOverlay.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .4s cubic-bezier(.32,.72,0,1);pointer-events:none;z-index:2;";
|
|
35624
|
+
videoContainer.appendChild(thumbOverlay);
|
|
35625
|
+
}
|
|
35626
|
+
}
|
|
35589
35627
|
const scaleX = targetRect.width / feedRect.width;
|
|
35590
35628
|
const scaleY = targetRect.height / feedRect.height;
|
|
35591
35629
|
const translateX = targetRect.left - feedRect.left;
|
|
@@ -35595,29 +35633,58 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35595
35633
|
feedEl.style.transformOrigin = "0 0";
|
|
35596
35634
|
feedEl.style.overflow = "hidden";
|
|
35597
35635
|
feedEl.style.scrollSnapType = "none";
|
|
35636
|
+
feedEl.style.pointerEvents = "none";
|
|
35598
35637
|
feedEl.getBoundingClientRect();
|
|
35599
35638
|
feedEl.classList.add("skp-flip-animating");
|
|
35600
35639
|
requestAnimationFrame(() => {
|
|
35601
35640
|
feedEl.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
35602
35641
|
feedEl.style.borderRadius = `${endRadius}px`;
|
|
35642
|
+
if (thumbOverlay) thumbOverlay.style.opacity = "1";
|
|
35603
35643
|
});
|
|
35604
35644
|
await this._waitForTransitionEnd(feedEl, 450);
|
|
35645
|
+
if (thumbOverlay) thumbOverlay.remove();
|
|
35646
|
+
let transferVideo = null;
|
|
35647
|
+
let transferHls = null;
|
|
35648
|
+
if (canTransfer) {
|
|
35649
|
+
const ejected = this.feedManager?.pool.ejectPlayer(this._openItemId);
|
|
35650
|
+
if (ejected) {
|
|
35651
|
+
transferVideo = ejected.video;
|
|
35652
|
+
transferHls = ejected.hls;
|
|
35653
|
+
}
|
|
35654
|
+
}
|
|
35605
35655
|
feedEl.style.visibility = "hidden";
|
|
35606
35656
|
feedEl.classList.remove("skp-flip-animating");
|
|
35607
|
-
["position", "left", "top", "width", "height", "zIndex", "margin", "flex", "aspectRatio", "maxHeight", "transformOrigin", "overflow", "scrollSnapType", "transform", "borderRadius"].forEach((p) => feedEl.style[p] = "");
|
|
35657
|
+
["position", "left", "top", "width", "height", "zIndex", "margin", "flex", "aspectRatio", "maxHeight", "transformOrigin", "overflow", "scrollSnapType", "pointerEvents", "transform", "borderRadius"].forEach((p) => feedEl.style[p] = "");
|
|
35608
35658
|
const sidebarEl = feedWrapper.querySelector(".sk-sidebar");
|
|
35609
35659
|
feedWrapper.insertBefore(feedEl, sidebarEl);
|
|
35610
35660
|
feedEl.style.visibility = "";
|
|
35661
|
+
if (this._onClose) {
|
|
35662
|
+
this._onClose("closed", {
|
|
35663
|
+
transferVideo,
|
|
35664
|
+
transferHls,
|
|
35665
|
+
transferItemId: transferVideo ? this._openItemId : null
|
|
35666
|
+
});
|
|
35667
|
+
this._onClose = null;
|
|
35668
|
+
}
|
|
35611
35669
|
} else {
|
|
35612
35670
|
this.overlayEl.classList.remove("skp-active", "skp-feed-ready");
|
|
35613
|
-
|
|
35614
|
-
|
|
35615
|
-
|
|
35616
|
-
|
|
35617
|
-
|
|
35618
|
-
|
|
35619
|
-
|
|
35620
|
-
|
|
35671
|
+
if (this._onClose) {
|
|
35672
|
+
let transferVideo = null;
|
|
35673
|
+
let transferHls = null;
|
|
35674
|
+
if (canTransfer) {
|
|
35675
|
+
const ejected = this.feedManager?.pool.ejectPlayer(this._openItemId);
|
|
35676
|
+
if (ejected) {
|
|
35677
|
+
transferVideo = ejected.video;
|
|
35678
|
+
transferHls = ejected.hls;
|
|
35679
|
+
}
|
|
35680
|
+
}
|
|
35681
|
+
this._onClose("closed", {
|
|
35682
|
+
transferVideo,
|
|
35683
|
+
transferHls,
|
|
35684
|
+
transferItemId: transferVideo ? this._openItemId : null
|
|
35685
|
+
});
|
|
35686
|
+
this._onClose = null;
|
|
35687
|
+
}
|
|
35621
35688
|
}
|
|
35622
35689
|
if (this.feedManager) {
|
|
35623
35690
|
this.feedManager.destroy();
|
|
@@ -35669,6 +35736,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35669
35736
|
this._onClose = onClose;
|
|
35670
35737
|
this._openSlotIndex = startIndex;
|
|
35671
35738
|
this._openItemId = item.id;
|
|
35739
|
+
this._openThumbnailUrl = item.thumbnailUrl || null;
|
|
35672
35740
|
const slotRect = slotEl.getBoundingClientRect();
|
|
35673
35741
|
const slotRadius = parseFloat(getComputedStyle(slotEl).borderRadius) || 12;
|
|
35674
35742
|
if (_isPreview) {
|
|
@@ -35715,6 +35783,21 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35715
35783
|
feedEl.style.transform = "none";
|
|
35716
35784
|
feedEl.style.borderRadius = `${targetRadius}px`;
|
|
35717
35785
|
});
|
|
35786
|
+
this.feedManager.startObserver();
|
|
35787
|
+
this.feedManager._activateItem(item.id);
|
|
35788
|
+
this.overlayEl.classList.add("skw-feed-ready");
|
|
35789
|
+
const itemOverlay = feedItemEl?.querySelector('[data-ref="overlay"]');
|
|
35790
|
+
const chromeEls = [...this.overlayEl.querySelectorAll(".skw-feed-close, .sk-sidebar")];
|
|
35791
|
+
if (itemOverlay) chromeEls.push(itemOverlay);
|
|
35792
|
+
chromeEls.forEach((el) => {
|
|
35793
|
+
el.style.opacity = "0";
|
|
35794
|
+
el.style.transition = "none";
|
|
35795
|
+
});
|
|
35796
|
+
this.overlayEl.getBoundingClientRect();
|
|
35797
|
+
chromeEls.forEach((el) => {
|
|
35798
|
+
el.style.transition = "opacity .35s cubic-bezier(.32,.72,0,1)";
|
|
35799
|
+
el.style.opacity = "1";
|
|
35800
|
+
});
|
|
35718
35801
|
await this._waitForTransitionEnd(feedEl, 450);
|
|
35719
35802
|
feedEl.classList.remove("skw-flip-animating");
|
|
35720
35803
|
feedEl.style.transformOrigin = "";
|
|
@@ -35722,9 +35805,10 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35722
35805
|
feedEl.style.scrollSnapType = "";
|
|
35723
35806
|
feedEl.style.transform = "";
|
|
35724
35807
|
feedEl.style.borderRadius = "";
|
|
35725
|
-
|
|
35726
|
-
|
|
35727
|
-
|
|
35808
|
+
chromeEls.forEach((el) => {
|
|
35809
|
+
el.style.opacity = "";
|
|
35810
|
+
el.style.transition = "";
|
|
35811
|
+
});
|
|
35728
35812
|
this._escHandler = (e) => {
|
|
35729
35813
|
if (e.key === "Escape") this.close();
|
|
35730
35814
|
};
|
|
@@ -35751,6 +35835,12 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35751
35835
|
if (this.feedManager?.activeItemId && !canTransfer) {
|
|
35752
35836
|
this.feedManager._deactivateItem(this.feedManager.activeItemId);
|
|
35753
35837
|
}
|
|
35838
|
+
const targetItemId = canTransfer ? this._openItemId : activeItemId;
|
|
35839
|
+
if (targetItemId && this.feedManager) {
|
|
35840
|
+
const targetEl = this.feedManager.itemEls.get(targetItemId);
|
|
35841
|
+
if (targetEl) targetEl.scrollIntoView({ behavior: "instant", block: "start" });
|
|
35842
|
+
}
|
|
35843
|
+
const savedScrollTop = feedEl.scrollTop;
|
|
35754
35844
|
feedEl.style.position = "fixed";
|
|
35755
35845
|
feedEl.style.left = `${feedRect.left}px`;
|
|
35756
35846
|
feedEl.style.top = `${feedRect.top}px`;
|
|
@@ -35762,7 +35852,20 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35762
35852
|
feedEl.style.aspectRatio = "unset";
|
|
35763
35853
|
feedEl.style.maxHeight = "none";
|
|
35764
35854
|
document.body.appendChild(feedEl);
|
|
35855
|
+
feedEl.scrollTop = savedScrollTop;
|
|
35765
35856
|
this.overlayEl.classList.remove("skw-active", "skw-feed-ready");
|
|
35857
|
+
let thumbOverlay = null;
|
|
35858
|
+
if (this._openThumbnailUrl) {
|
|
35859
|
+
const targetItemId2 = canTransfer ? this._openItemId : activeItemId;
|
|
35860
|
+
const targetEl = targetItemId2 && this.feedManager?.itemEls.get(targetItemId2);
|
|
35861
|
+
const videoContainer = targetEl?.querySelector('[data-ref="videoContainer"]');
|
|
35862
|
+
if (videoContainer) {
|
|
35863
|
+
thumbOverlay = document.createElement("img");
|
|
35864
|
+
thumbOverlay.src = this._openThumbnailUrl;
|
|
35865
|
+
thumbOverlay.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .4s cubic-bezier(.32,.72,0,1);pointer-events:none;z-index:2;";
|
|
35866
|
+
videoContainer.appendChild(thumbOverlay);
|
|
35867
|
+
}
|
|
35868
|
+
}
|
|
35766
35869
|
const slotRadius = parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--skw-radius").trim()) || 12;
|
|
35767
35870
|
const scaleX = targetSlotRect.width / feedRect.width;
|
|
35768
35871
|
const scaleY = targetSlotRect.height / feedRect.height;
|
|
@@ -35772,13 +35875,16 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35772
35875
|
feedEl.style.transformOrigin = "0 0";
|
|
35773
35876
|
feedEl.style.overflow = "hidden";
|
|
35774
35877
|
feedEl.style.scrollSnapType = "none";
|
|
35878
|
+
feedEl.style.pointerEvents = "none";
|
|
35775
35879
|
feedEl.getBoundingClientRect();
|
|
35776
35880
|
feedEl.classList.add("skw-flip-animating");
|
|
35777
35881
|
requestAnimationFrame(() => {
|
|
35778
35882
|
feedEl.style.transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
35779
35883
|
feedEl.style.borderRadius = `${endRadius}px`;
|
|
35884
|
+
if (thumbOverlay) thumbOverlay.style.opacity = "1";
|
|
35780
35885
|
});
|
|
35781
35886
|
await this._waitForTransitionEnd(feedEl, 450);
|
|
35887
|
+
if (thumbOverlay) thumbOverlay.remove();
|
|
35782
35888
|
let transferVideo = null;
|
|
35783
35889
|
let transferHls = null;
|
|
35784
35890
|
if (canTransfer) {
|
|
@@ -35803,6 +35909,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
35803
35909
|
feedEl.style.transformOrigin = "";
|
|
35804
35910
|
feedEl.style.overflow = "";
|
|
35805
35911
|
feedEl.style.scrollSnapType = "";
|
|
35912
|
+
feedEl.style.pointerEvents = "";
|
|
35806
35913
|
feedEl.style.transform = "";
|
|
35807
35914
|
feedEl.style.borderRadius = "";
|
|
35808
35915
|
feedWrapper.insertBefore(feedEl, feedWrapper.firstChild);
|
|
@@ -36541,7 +36648,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
36541
36648
|
|
|
36542
36649
|
/* Video container */
|
|
36543
36650
|
.sk-video-container{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background-size:cover;background-position:center}
|
|
36544
|
-
.sk-video-container video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .
|
|
36651
|
+
.sk-video-container video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .35s ease}
|
|
36545
36652
|
|
|
36546
36653
|
/* Tap zone */
|
|
36547
36654
|
.sk-tap-zone{position:absolute;inset:0;z-index:3;cursor:pointer}
|
|
@@ -36557,7 +36664,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
36557
36664
|
|
|
36558
36665
|
/* Widget slot */
|
|
36559
36666
|
.skw-slot{position:relative;overflow:hidden;cursor:pointer}
|
|
36560
|
-
.skw-slot video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .
|
|
36667
|
+
.skw-slot video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .4s ease}
|
|
36561
36668
|
.skw-slot-thumb{position:absolute;inset:0;background-size:cover;background-position:center}
|
|
36562
36669
|
.skw-slot-overlay{position:absolute;inset:0;z-index:4;pointer-events:none}
|
|
36563
36670
|
.skw-slot-overlay>*{pointer-events:auto}
|