@ray-js/ipc-player-integration 0.0.35-beta.27 → 0.0.35-beta.28
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/lib/ui/bottomLeftContent.js +15 -5
- package/lib/ui/ui.js +1 -0
- package/package.json +1 -1
|
@@ -6,8 +6,17 @@ import clsx from 'clsx';
|
|
|
6
6
|
import { useStore } from '../ctx/store';
|
|
7
7
|
import { useComponentHideState } from './hooks';
|
|
8
8
|
import { TrialBadge, useTrialBadge } from '../widgets/trialBadge';
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 右侧透明渐变 mask,用于提示横向可滑动。
|
|
11
|
+
* - 竖屏容器窄,48px 渐变区已足够明显
|
|
12
|
+
* - 横屏容器约占 65% 宽度(≥ 500px),且单个按钮就有 ~72px,
|
|
13
|
+
* 渐变区需大于一个按钮宽度才能让最右侧按钮"半隐半现",
|
|
14
|
+
* 暗示后面还有内容
|
|
15
|
+
*/
|
|
16
|
+
const getFadeMask = screenType => {
|
|
17
|
+
const fadeWidth = screenType === 'vertical' ? 60 : 120;
|
|
18
|
+
return `linear-gradient(to right, #000 calc(100% - ${fadeWidth}px), transparent 100%)`;
|
|
19
|
+
};
|
|
11
20
|
const BottomLeftContent = _ref => {
|
|
12
21
|
let {
|
|
13
22
|
ctx,
|
|
@@ -58,11 +67,12 @@ const BottomLeftContent = _ref => {
|
|
|
58
67
|
} = useTrialBadge(ctx.event, ctx.devId, trialRemainingSec);
|
|
59
68
|
const paddingLeftPx = screenType === 'vertical' ? 0 : 25;
|
|
60
69
|
const showBadge = showSmartImageQuality && showTrialBadge && canOpenSettings && gRawData && !isLowPhone && buttonState === 1 && trialRemainingSec > 0;
|
|
61
|
-
const coverHeight = screenType === 'vertical' ? 48 : 83;
|
|
70
|
+
const coverHeight = screenType === 'vertical' ? shouldHide ? 49 : 48 : shouldHide ? 84 : 83;
|
|
62
71
|
const containerHeight = screenType === 'vertical' ? 48 : 58;
|
|
63
72
|
|
|
64
73
|
// reservedRight 兼容 number(px)与 string(任意 CSS 长度,例如 "35%")
|
|
65
74
|
const rightCss = typeof reservedRight === 'number' ? `${reservedRight}px` : reservedRight;
|
|
75
|
+
const fadeMask = getFadeMask(screenType);
|
|
66
76
|
return /*#__PURE__*/React.createElement(CoverView, {
|
|
67
77
|
className: clsx('ipc-player-bottom-left-content-wrap'),
|
|
68
78
|
style: {
|
|
@@ -96,8 +106,8 @@ const BottomLeftContent = _ref => {
|
|
|
96
106
|
overflowY: 'hidden',
|
|
97
107
|
whiteSpace: 'nowrap',
|
|
98
108
|
WebkitOverflowScrolling: 'touch',
|
|
99
|
-
WebkitMaskImage:
|
|
100
|
-
maskImage:
|
|
109
|
+
WebkitMaskImage: fadeMask,
|
|
110
|
+
maskImage: fadeMask
|
|
101
111
|
},
|
|
102
112
|
className: clsx('ipc-player-bottom-left-content-container')
|
|
103
113
|
}, children));
|
package/lib/ui/ui.js
CHANGED
|
@@ -455,6 +455,7 @@ export const IPCPlayerIntegration = /*#__PURE__*/React.memo(props => {
|
|
|
455
455
|
// canOpenSettings: true,
|
|
456
456
|
// };
|
|
457
457
|
const getNgRes = await getNgRawData();
|
|
458
|
+
console.log('res===getSmartImageQualityState', res);
|
|
458
459
|
updatePlayerWidgetProps(instance, 'bottomLeft', 'TryExperience', {
|
|
459
460
|
isPurchase: res.isPurchase,
|
|
460
461
|
buttonState: res.buttonState,
|