Files
discord-decomp/sources/components_native/premium/ShineAnimation.tsx
T
2026-07-27 16:20:00 +03:00

115 lines
7.0 KiB
TypeScript

/* Metro module 7324; source: components_native/premium/ShineAnimation.tsx; dependencies: [31, 27, 33, 4501, 697, 4017, 4504, 674, 2] */
function _fun59009(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7502:6, offset: 0x016dded1, size: 410 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.Image;
const StyleSheet = value2.StyleSheet;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
Object = global.Object;
const env0_8 = Object.freeze({'FLASH_TIME_PERCENT': 0.72, 'FLASH_DURATION_PERCENT': 0.08});
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
object2.container = {overflow: 'hidden'};
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object2.shineContainer = object4;
object2.shine = {'transform': null, 'width': 56, 'flex': 0, 'height': '300%', 'top': '-10%',
transform: [{rotate: '30deg'}]};
const BACKGROUND_MOD_NORMAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_NORMAL;
object2.shineInner = {backgroundColor: BACKGROUND_MOD_NORMAL, flex: 1};
const env0_9 = Reflect.apply(createStyles, createStylesModule, [object2]);
object2 = {code: 'function ShineAnimationTsx1(){const{interpolate,progress}=this.__closure;const widthPercent=interpolate(progress.get(),[0,1],[20,160]);return{width:widthPercent+"%"};}'};
object2 = {code: 'function ShineAnimationTsx2(){const{ShineAnimationConfig,interpolateColor,progress,flashStartColor,flashEndColor}=this.__closure;const startTime=ShineAnimationConfig.FLASH_TIME_PERCENT;const duration=ShineAnimationConfig.FLASH_DURATION_PERCENT;return{backgroundColor:interpolateColor(progress.get(),[0,startTime,startTime,startTime+duration,1],[flashStartColor,flashStartColor,flashEndColor,flashEndColor,flashStartColor])};}'};
value = value.memo(ShineAnimation);
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/ShineAnimation.tsx');
exports.default = value;
}
function ShineAnimation({source, style}) { // fn#59010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7502:1124, offset: 0x016de06b, size: 620 bytes, params: 2, frame: 27
var object2;
const styles = useStyles();
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
env0_3.useEffect(_fun59011, [value2]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = ShineAnimationA;
closure.__closure = {interpolate: reanimatedRexportModule.interpolate, progress: value2};
closure.__workletHash = 4072719467417;
closure.__initData = env0_10;
const value3 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const defaultImport = importDefault(674) /* metro dependency 674 */;
let BRAND_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_360;
const value6 = defaultImport(BRAND_360).alpha(0.2).hex();
const defaultImport2 = defaultImport;
BRAND_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_360;
const value9 = defaultImport2(BRAND_360).alpha(1).hex();
const moduleValue3 = reanimatedRexportModule;
useAnimatedStyle = moduleValue3.useAnimatedStyle;
closure = ShineAnimationE;
object2 = {ShineAnimationConfig: env0_8};
object2.interpolateColor = reanimatedRexportModule.interpolateColor;
object2.progress = value2;
object2.flashStartColor = value6;
object2.flashEndColor = value9;
closure.__closure = object2;
closure.__workletHash = 9845866779228;
closure.__initData = env0_11;
const value10 = Reflect.apply(useAnimatedStyle, moduleValue3, [closure]);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [styles.container, style, value10];
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View2 style={items2}>
<View style={styles.shineContainer}>
<View3 style={value3} />
<View style={styles.shine}>
<View style={styles.shineInner} />
</View>
</View>
<Image source={source} />
</View2>
);
}
function _fun59011() { // fn#59011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7502:1219, offset: 0x016de2d7, size: 130 bytes, params: 1, frame: 21
const binding = env0_0;
const set = binding.set;
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const withDelay = value.withDelay;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
Reflect.apply(set, binding, [Reflect.apply(withDelay, value, [400,
reanimatedRexportModule.withRepeat((require(4504) /* metro dependency 4504: timing */).withTiming(1,
{duration: 1000}), -1, false)])]);
}
function ShineAnimationA() { // fn#59012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7502:1363, owner: ShineAnimation.A, offset: 0x016de359, size: 109 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = Reflect.apply((require(4017) /* metro dependency 4017: ReanimatedRexport */).interpolate, value,
[env0_0.get(), [0, 1], [20, 160]]);
return {width: '' + value + '%'};
}
function ShineAnimationE() { // fn#59013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7502:1698, owner: ShineAnimation.E, offset: 0x016de3c6, size: 143 bytes, params: 1, frame: 19
let value = environment.__proto__;
let binding = env1_8;
const FLASH_TIME_PERCENT = binding.FLASH_TIME_PERCENT;
const FLASH_DURATION_PERCENT = binding.FLASH_DURATION_PERCENT;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolateColor = value.interpolateColor;
const value3 = env0_0.get();
binding = env0_1;
const binding2 = env0_2;
return {backgroundColor: Reflect.apply(interpolateColor, value, [value3, [0, FLASH_TIME_PERCENT, FLASH_TIME_PERCENT,
FLASH_TIME_PERCENT + FLASH_DURATION_PERCENT, 1], [binding, binding, binding2, binding2, binding]])};
}