adc444c8673074c1faf56b549985ed10.json
3.47 KB
{"ast":null,"code":"Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=timing;var _base=require(\"../base\");function timing(clock,state,config){var lastTime=(0,_base.cond)(state.time,state.time,clock);var frameTime=(0,_base.add)(state.frameTime,(0,_base.sub)(clock,lastTime));var progress=config.easing((0,_base.divide)(state.frameTime,config.duration));var distanceLeft=(0,_base.sub)(config.toValue,state.position);var fullDistance=(0,_base.divide)(distanceLeft,(0,_base.sub)(1,progress));var startPosition=(0,_base.sub)(config.toValue,fullDistance);var nextProgress=config.easing((0,_base.divide)(frameTime,config.duration));var nextPosition=(0,_base.add)(startPosition,(0,_base.multiply)(fullDistance,nextProgress));return(0,_base.block)([(0,_base.cond)((0,_base.greaterOrEq)(frameTime,config.duration),[(0,_base.set)(state.position,config.toValue),(0,_base.set)(state.finished,1)],(0,_base.set)(state.position,nextPosition)),(0,_base.set)(state.frameTime,frameTime),(0,_base.set)(state.time,clock)]);}","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-reanimated/src/animations/timing.js"],"names":["timing","clock","state","config","lastTime","time","frameTime","progress","easing","duration","distanceLeft","toValue","position","fullDistance","startPosition","nextProgress","nextPosition","finished"],"mappings":"gFAAA,6BAWe,QAASA,CAAAA,MAAT,CAAgBC,KAAhB,CAAuBC,KAAvB,CAA8BC,MAA9B,CAAsC,CACnD,GAAMC,CAAAA,QAAQ,CAAG,eAAKF,KAAK,CAACG,IAAX,CAAiBH,KAAK,CAACG,IAAvB,CAA6BJ,KAA7B,CAAjB,CACA,GAAMK,CAAAA,SAAS,CAAG,cAAIJ,KAAK,CAACI,SAAV,CAAqB,cAAIL,KAAJ,CAAWG,QAAX,CAArB,CAAlB,CAEA,GAAMG,CAAAA,QAAQ,CAAGJ,MAAM,CAACK,MAAP,CAAc,iBAAON,KAAK,CAACI,SAAb,CAAwBH,MAAM,CAACM,QAA/B,CAAd,CAAjB,CACA,GAAMC,CAAAA,YAAY,CAAG,cAAIP,MAAM,CAACQ,OAAX,CAAoBT,KAAK,CAACU,QAA1B,CAArB,CACA,GAAMC,CAAAA,YAAY,CAAG,iBAAOH,YAAP,CAAqB,cAAI,CAAJ,CAAOH,QAAP,CAArB,CAArB,CACA,GAAMO,CAAAA,aAAa,CAAG,cAAIX,MAAM,CAACQ,OAAX,CAAoBE,YAApB,CAAtB,CACA,GAAME,CAAAA,YAAY,CAAGZ,MAAM,CAACK,MAAP,CAAc,iBAAOF,SAAP,CAAkBH,MAAM,CAACM,QAAzB,CAAd,CAArB,CACA,GAAMO,CAAAA,YAAY,CAAG,cAAIF,aAAJ,CAAmB,mBAASD,YAAT,CAAuBE,YAAvB,CAAnB,CAArB,CAEA,MAAO,gBAAM,CACX,eACE,sBAAYT,SAAZ,CAAuBH,MAAM,CAACM,QAA9B,CADF,CAEE,CAAC,cAAIP,KAAK,CAACU,QAAV,CAAoBT,MAAM,CAACQ,OAA3B,CAAD,CAAsC,cAAIT,KAAK,CAACe,QAAV,CAAoB,CAApB,CAAtC,CAFF,CAGE,cAAIf,KAAK,CAACU,QAAV,CAAoBI,YAApB,CAHF,CADW,CAMX,cAAId,KAAK,CAACI,SAAV,CAAqBA,SAArB,CANW,CAOX,cAAIJ,KAAK,CAACG,IAAV,CAAgBJ,KAAhB,CAPW,CAAN,CAAP,CASD","sourcesContent":["import {\n cond,\n sub,\n divide,\n multiply,\n add,\n block,\n set,\n greaterOrEq,\n} from '../base';\n\nexport default function timing(clock, state, config) {\n const lastTime = cond(state.time, state.time, clock);\n const frameTime = add(state.frameTime, sub(clock, lastTime));\n\n const progress = config.easing(divide(state.frameTime, config.duration));\n const distanceLeft = sub(config.toValue, state.position);\n const fullDistance = divide(distanceLeft, sub(1, progress));\n const startPosition = sub(config.toValue, fullDistance);\n const nextProgress = config.easing(divide(frameTime, config.duration));\n const nextPosition = add(startPosition, multiply(fullDistance, nextProgress));\n\n return block([\n cond(\n greaterOrEq(frameTime, config.duration),\n [set(state.position, config.toValue), set(state.finished, 1)],\n set(state.position, nextPosition)\n ),\n set(state.frameTime, frameTime),\n set(state.time, clock),\n ]);\n}\n"]},"metadata":{},"sourceType":"script"}