84668ef1fd63791a19e61804d6277917.json
6.98 KB
{"ast":null,"code":"'use strict';Object.defineProperty(exports,\"__esModule\",{value:true});exports.fromOrigamiTensionAndFriction=fromOrigamiTensionAndFriction;exports.fromBouncinessAndSpeed=fromBouncinessAndSpeed;exports.default=void 0;function stiffnessFromOrigamiValue(oValue){return(oValue-30)*3.62+194;}function dampingFromOrigamiValue(oValue){return(oValue-8)*3+25;}function fromOrigamiTensionAndFriction(tension,friction){return{stiffness:stiffnessFromOrigamiValue(tension),damping:dampingFromOrigamiValue(friction)};}function fromBouncinessAndSpeed(bounciness,speed){function normalize(value,startValue,endValue){return(value-startValue)/(endValue-startValue);}function projectNormal(n,start,end){return start+n*(end-start);}function linearInterpolation(t,start,end){return t*end+(1-t)*start;}function quadraticOutInterpolation(t,start,end){return linearInterpolation(2*t-t*t,start,end);}function b3Friction1(x){return 0.0007*Math.pow(x,3)-0.031*Math.pow(x,2)+0.64*x+1.28;}function b3Friction2(x){return 0.000044*Math.pow(x,3)-0.006*Math.pow(x,2)+0.36*x+2;}function b3Friction3(x){return 0.00000045*Math.pow(x,3)-0.000332*Math.pow(x,2)+0.1078*x+5.84;}function b3Nobounce(tension){if(tension<=18){return b3Friction1(tension);}else if(tension>18&&tension<=44){return b3Friction2(tension);}else{return b3Friction3(tension);}}var b=normalize(bounciness/1.7,0,20);b=projectNormal(b,0,0.8);var s=normalize(speed/1.7,0,20);var bouncyTension=projectNormal(s,0.5,200);var bouncyFriction=quadraticOutInterpolation(b,b3Nobounce(bouncyTension),0.01);return{stiffness:stiffnessFromOrigamiValue(bouncyTension),damping:dampingFromOrigamiValue(bouncyFriction)};}var _default={fromOrigamiTensionAndFriction:fromOrigamiTensionAndFriction,fromBouncinessAndSpeed:fromBouncinessAndSpeed};exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/vendor/react-native/Animated/SpringConfig.js"],"names":["stiffnessFromOrigamiValue","oValue","dampingFromOrigamiValue","fromOrigamiTensionAndFriction","tension","friction","stiffness","damping","fromBouncinessAndSpeed","bounciness","speed","normalize","value","startValue","endValue","projectNormal","n","start","end","linearInterpolation","t","quadraticOutInterpolation","b3Friction1","x","Math","pow","b3Friction2","b3Friction3","b3Nobounce","b","s","bouncyTension","bouncyFriction"],"mappings":"AAQA,a,0MAEA,QAASA,CAAAA,yBAAT,CAAmCC,MAAnC,CAA2C,CACzC,MAAO,CAACA,MAAM,CAAG,EAAV,EAAgB,IAAhB,CAAuB,GAA9B,CACD,CAED,QAASC,CAAAA,uBAAT,CAAiCD,MAAjC,CAAyC,CACvC,MAAO,CAACA,MAAM,CAAG,CAAV,EAAe,CAAf,CAAmB,EAA1B,CACD,CAED,QAASE,CAAAA,6BAAT,CAAuCC,OAAvC,CAAgDC,QAAhD,CAA0D,CACxD,MAAO,CACLC,SAAS,CAAEN,yBAAyB,CAACI,OAAD,CAD/B,CAELG,OAAO,CAAEL,uBAAuB,CAACG,QAAD,CAF3B,CAAP,CAID,CAED,QAASG,CAAAA,sBAAT,CAAgCC,UAAhC,CAA4CC,KAA5C,CAAmD,CACjD,QAASC,CAAAA,SAAT,CAAmBC,KAAnB,CAA0BC,UAA1B,CAAsCC,QAAtC,CAAgD,CAC9C,MAAO,CAACF,KAAK,CAAGC,UAAT,GAAwBC,QAAQ,CAAGD,UAAnC,CAAP,CACD,CAED,QAASE,CAAAA,aAAT,CAAuBC,CAAvB,CAA0BC,KAA1B,CAAiCC,GAAjC,CAAsC,CACpC,MAAOD,CAAAA,KAAK,CAAGD,CAAC,EAAIE,GAAG,CAAGD,KAAV,CAAhB,CACD,CAED,QAASE,CAAAA,mBAAT,CAA6BC,CAA7B,CAAgCH,KAAhC,CAAuCC,GAAvC,CAA4C,CAC1C,MAAOE,CAAAA,CAAC,CAAGF,GAAJ,CAAU,CAAC,EAAIE,CAAL,EAAUH,KAA3B,CACD,CAED,QAASI,CAAAA,yBAAT,CAAmCD,CAAnC,CAAsCH,KAAtC,C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CACAoB,CAAC,CAAGd,aAAa,CAACc,CAAD,CAAI,CAAJ,CAAO,GAAP,CAAjB,CACA,GAAIC,CAAAA,CAAC,CAAGnB,SAAS,CAACD,KAAK,CAAG,GAAT,CAAc,CAAd,CAAiB,EAAjB,CAAjB,CACA,GAAIqB,CAAAA,aAAa,CAAGhB,aAAa,CAACe,CAAD,CAAI,GAAJ,CAAS,GAAT,CAAjC,CACA,GAAIE,CAAAA,cAAc,CAAGX,yBAAyB,CAACQ,CAAD,CAAID,UAAU,CAACG,aAAD,CAAd,CAA+B,IAA/B,CAA9C,CACA,MAAO,CACLzB,SAAS,CAAEN,yBAAyB,CAAC+B,aAAD,CAD/B,CAELxB,OAAO,CAAEL,uBAAuB,CAAC8B,cAAD,CAF3B,CAAP,CAID,C,aAGc,CACb7B,6BAA6B,CAAEA,6BADlB,CAEbK,sBAAsB,CAAEA,sBAFX,C","sourcesContent":["/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n'use strict';\n\nfunction stiffnessFromOrigamiValue(oValue) {\n return (oValue - 30) * 3.62 + 194;\n}\n\nfunction dampingFromOrigamiValue(oValue) {\n return (oValue - 8) * 3 + 25;\n}\n\nfunction fromOrigamiTensionAndFriction(tension, friction) {\n return {\n stiffness: stiffnessFromOrigamiValue(tension),\n damping: dampingFromOrigamiValue(friction)\n };\n}\n\nfunction fromBouncinessAndSpeed(bounciness, speed) {\n function normalize(value, startValue, endValue) {\n return (value - startValue) / (endValue - startValue);\n }\n\n function projectNormal(n, start, end) {\n return start + n * (end - start);\n }\n\n function linearInterpolation(t, start, end) {\n return t * end + (1 - t) * start;\n }\n\n function quadraticOutInterpolation(t, start, end) {\n return linearInterpolation(2 * t - t * t, start, end);\n }\n\n function b3Friction1(x) {\n return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;\n }\n\n function b3Friction2(x) {\n return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2;\n }\n\n function b3Friction3(x) {\n return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84;\n }\n\n function b3Nobounce(tension) {\n if (tension <= 18) {\n return b3Friction1(tension);\n } else if (tension > 18 && tension <= 44) {\n return b3Friction2(tension);\n } else {\n return b3Friction3(tension);\n }\n }\n\n var b = normalize(bounciness / 1.7, 0, 20);\n b = projectNormal(b, 0, 0.8);\n var s = normalize(speed / 1.7, 0, 20);\n var bouncyTension = projectNormal(s, 0.5, 200);\n var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01);\n return {\n stiffness: stiffnessFromOrigamiValue(bouncyTension),\n damping: dampingFromOrigamiValue(bouncyFriction)\n };\n}\n\nexport { fromOrigamiTensionAndFriction, fromBouncinessAndSpeed };\nexport default {\n fromOrigamiTensionAndFriction: fromOrigamiTensionAndFriction,\n fromBouncinessAndSpeed: fromBouncinessAndSpeed\n};"]},"metadata":{},"sourceType":"script"}