How to use createTween method in Cypress

Best JavaScript code snippet using cypress

quoi.js

Source:quoi.js Github

copy

Full Screen

...533      womb.kitty.enter();534      womb.kitty1.enter();535    }536    var firstHO = function(){537      var t = womb.tweener.createTween({538        object: womb.kitty.scene,539        target: new THREE.Vector3( 0 , womb.size / 4 , 0 ),540        time: .4541      });542      t.start();543      var t = womb.tweener.createTween({544        object: womb.kitty1.scene,545        target: new THREE.Vector3( 0 , -womb.size / 4 , 0 ),546        time: .4547      });548      t.start();549    };550   551    var intro1 = function(){ womb.antiSerp1.enter(); }552    var intro2 = function(){ womb.antiSerp2.enter(); }553    var intro3 = function(){ womb.antiSerp3.enter(); }554    var intro4 = function(){ womb.antiSerp4.enter(); }555    var intro5 = function(){ womb.antiSerp5.enter(); }556   557    var hihatsEnter = function(){558      var t = womb.tweener.createTween({559        object: womb.kitty.scene,560        target: new THREE.Vector3( womb.size / 4 , 0 , 0 ),561        time: 1562      });563      t.start();564      var t = womb.tweener.createTween({565        object: womb.kitty1.scene,566        target: new THREE.Vector3( -womb.size / 4 , 0 , 0 ),567        time: 1568      });569      t.start();570      var t1 = womb.tweener.createTween({571        type: 'scale',572        object: womb.antiSerp1.scene,573        target: new THREE.Vector3( .3 , .3 , .3 ),574        time: 1575      });576      t1.start();577      var t2 = womb.tweener.createTween({578        type: 'scale',579        object: womb.antiSerp2.scene,580        target: new THREE.Vector3( .3 , .3 , .3 ),581        time: 1582      });583      t2.start();584      var t3 = womb.tweener.createTween({585        type: 'scale',586        object: womb.antiSerp3.scene,587        target: new THREE.Vector3( .3 , .3 , .3 ),588        time: 1589      });590      t3.start();591      var t4 = womb.tweener.createTween({592        type: 'scale',593        object: womb.antiSerp4.scene,594        target: new THREE.Vector3( .3 , .3 , .3 ),595        time: 1596      });597      t4.start();598      var t5 = womb.tweener.createTween({599        type: 'scale',600        object: womb.antiSerp5.scene,601        target: new THREE.Vector3( .3 , .3 , .3 ),602        time: 1603      });604      t5.start();605    };606    var move1 = function(){607      var t = womb.tweener.createTween({608        type: 'scale',609        object: womb.kitty.scene,610        target: new THREE.Vector3( .5 , .5 , .5 ),611        time: 30612      });613      t.start();614      var t = womb.tweener.createTween({615        type: 'scale',616        object: womb.kitty1.scene,617        target: new THREE.Vector3( .5 , .5 , .5 ),618        time: 30619      });620      t.start();621    }622    var move2 = function(){623      var t = womb.tweener.createTween({624        object: womb.kitty.scene,625        target: new THREE.Vector3( 0 , womb.size / 4 , 0 ),626        time: 1627      });628      t.start();629      var t = womb.tweener.createTween({630        object: womb.kitty1.scene,631        target: new THREE.Vector3( 0 , -womb.size / 4 , 0 ),632        time: 1633      });634      t.start();635      var t1 = womb.tweener.createTween({636        type: 'scale',637        object: womb.antiSerp1.scene,638        target: new THREE.Vector3( .5,  .5 , .5 ),639        time: 1640      });641      t1.start();642      var t1 = womb.tweener.createTween({643        type: 'position',644        object: womb.antiSerp1.scene,645        target: new THREE.Vector3( 0 , 0 , 0 ),646        time: 1647      });648      t1.start();649      var t2 = womb.tweener.createTween({650        type: 'scale',651        object: womb.antiSerp1.scene,652        target: new THREE.Vector3( .5 ,.5 , .5 ),653        time: 1654      });655      t2.start();656      var t2 = womb.tweener.createTween({657        type: 'position',658        object: womb.antiSerp2.scene,659        target: new THREE.Vector3( 0 , 0 , 0 ),660        time: 1661      });662      t2.start();663      var t5 = womb.tweener.createTween({664        type: 'rotation',665        object: womb.antiSerp2.scene,666        target: new THREE.Vector3( Math.PI / 2  , 0 , 0 ),667        time: 2668      });669      t5.start();670      var t3 = womb.tweener.createTween({671        type: 'scale',672        object: womb.antiSerp3.scene,673        target: new THREE.Vector3(.5, .5 , .5),674        time: 1675      });676      t3.start();677      var t3 = womb.tweener.createTween({678        type: 'position',679        object: womb.antiSerp3.scene,680        target: new THREE.Vector3( 0 , 0 , 0 ),681        time: 1682      });683      t3.start();684      var t5 = womb.tweener.createTween({685        type: 'rotation',686        object: womb.antiSerp3.scene,687        target: new THREE.Vector3( Math.PI / 2  , 0 , 0 ),688        time: 3689      });690      t5.start();691      var t4 = womb.tweener.createTween({692        type: 'scale',693        object: womb.antiSerp4.scene,694        target: new THREE.Vector3( .5, .5 , .5),695        time: 1696      });697      t4.start();698      var t4 = womb.tweener.createTween({699        type: 'position',700        object: womb.antiSerp4.scene,701        target: new THREE.Vector3( 0 , 0 , 0 ),702        time: 1703      });704      t4.start();705      var t5 = womb.tweener.createTween({706        type: 'rotation',707        object: womb.antiSerp4.scene,708        target: new THREE.Vector3( Math.PI / 2  , 0 , 0 ),709        time: 4710      });711      t5.start();712      var t5 = womb.tweener.createTween({713        type: 'scale',714        object: womb.antiSerp5.scene,715        target: new THREE.Vector3( .5,.5 , .5 ),716        time: 1717      });718      t5.start();719      var t5 = womb.tweener.createTween({720        type: 'position',721        object: womb.antiSerp5.scene,722        target: new THREE.Vector3( 0 , 0 , 0 ),723        time: 1724      });725      t5.start();726      var t5 = womb.tweener.createTween({727        type: 'rotation',728        object: womb.antiSerp5.scene,729        target: new THREE.Vector3( Math.PI / 2  , 0 , 0 ),730        time: 3731      });732      t5.start();733    }734    var voiceUp = function(){735     736      womb.kitty.exit();737      womb.kitty1.exit();738      womb.randomCubes.enter();739     740    }741    /*742     *743FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP FIRST DROP   744     *745     */746    var firstDrop = function(){747      womb.treeRing.enter();748      womb.treeRing.scene.rotation.x = Math.PI / 2;749      womb.randomCubes.spinning = true;750      womb.antiSerp1.exit();751      womb.antiSerp2.exit();752      womb.antiSerp3.exit();753      womb.antiSerp4.exit();754      womb.antiSerp5.exit();755    }756    var afterFirstDrop = function(){757      womb.randomCubes.spinning = false;758      womb.treeRing.spinning  = true;759      var t = womb.tweener.createTween({760        type: 'scale',761        object: womb.randomCubes.scene,762        target: new THREE.Vector3( .8 , .8 , .8 ),763        time: 3764      });765      t.start();766      var t = womb.tweener.createTween({767        type: 'scale',768        object: womb.treeRing.scene,769        target: new THREE.Vector3( .8 , .8 , .8 ),770        time: 3771      });772      t.start();773      womb.randomCubes1.enter();774      womb.randomCubes1.spinning = true;775      womb.treeRing1.enter();776      womb.treeRing1.scene.rotation.x = Math.PI / 2;777    }778    var afterFirstDrop1 = function(){779      var t = womb.tweener.createTween({780        type: 'scale',781        object: womb.randomCubes.scene,782        target: new THREE.Vector3( .6 , .6 , .6 ),783        time: 3784      });785      t.start();786      var t = womb.tweener.createTween({787        type: 'scale',788        object: womb.randomCubes1.scene,789        target: new THREE.Vector3( .8 , .8 , .8 ),790        time: 3791      });792      t.start();793      var t = womb.tweener.createTween({794        type: 'scale',795        object: womb.treeRing.scene,796        target: new THREE.Vector3( .6 , .6 , .6 ),797        time: 3798      });799      t.start();800      var t = womb.tweener.createTween({801        type: 'scale',802        object: womb.treeRing1.scene,803        target: new THREE.Vector3( .8 , .8 , .8 ),804        time: 3805      });806      t.start();807      womb.randomCubes1.spinning = false;808      womb.randomCubes2.enter();809      womb.randomCubes2.spinning = true;810      womb.treeRing2.enter();811      womb.treeRing2.scene.rotation.x = Math.PI / 2;812      womb.treeRing1.exit();813    }814    var afterFirstDrop2 = function(){815      var t = womb.tweener.createTween({816        type: 'scale',817        object: womb.randomCubes.scene,818        target: new THREE.Vector3( .6 , .6 , .6 ),819        time: 3820      });821      t.start();822      var t = womb.tweener.createTween({823        type: 'scale',824        object: womb.randomCubes1.scene,825        target: new THREE.Vector3( .8 , .8 , .8 ),826        time: 3827      });828      t.start();829      var t = womb.tweener.createTween({830        type: 'scale',831        object: womb.treeRing.scene,832        target: new THREE.Vector3( .6 , .6 , .6 ),833        time: 3834      });835      t.start();836      var t = womb.tweener.createTween({837        type: 'scale',838        object: womb.treeRing1.scene,839        target: new THREE.Vector3( .8 , .8 , .8 ),840        time: 3841      });842      t.start();843      womb.randomCubes2.spinning = false;844      womb.randomCubes.exit();845      womb.randomCubes1.exit();846      womb.randomCubes3.enter();847      womb.randomCubes3.spinning = true;848      womb.randomCubes4.enter();849      womb.randomCubes4.spinning = true;850      womb.treeRing3.enter();851      womb.treeRing3.scene.rotation.x = Math.PI / 2;852      womb.treeRing2.spinning  = true;853      womb.treeRing.exit();854    }855/*856 * SECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROPSECOND DROP857 */858    var secondDrop = function(){859      //womb.randomCubes.exit();860      //womb.randomCubes1.exit();861      womb.randomCubes2.exit();862      womb.randomCubes3.exit();863      womb.randomCubes4.exit();864      var t = womb.tweener.createTween({865        type: 'scale',866        object: womb.treeRing.scene,867        target: new THREE.Vector3( .4 , .4 , .4 ),868        time: 3869      });870      t.start();871      var t = womb.tweener.createTween({872        type: 'scale',873        object: womb.treeRing1.scene,874        target: new THREE.Vector3( .6 , .6 , .6 ),875        time: 3876      });877      t.start();878      var t = womb.tweener.createTween({879        type: 'scale',880        object: womb.treeRing2.scene,881        target: new THREE.Vector3( .8 , .8 , .8 ),882        time: 3883      });884      t.start();885      womb.treeRing3.enter();886      womb.treeRing3.scene.rotation.x = Math.PI / 2;887      womb.treeRing3.spinning = true;888      womb.treeRing4.enter();889      womb.treeRing4.scene.rotation.x = Math.PI / 2;890    891    }892  893    var afterSecondDrop = function(){894      womb.treeRing.exit();895      var t = womb.tweener.createTween({896        type: 'scale',897        object: womb.treeRing1.scene,898        target: new THREE.Vector3( .5 , .5 , .5 ),899        time: 4900      });901      t.start();902      var t = womb.tweener.createTween({903        type: 'scale',904        object: womb.treeRing1.scene,905        target: new THREE.Vector3( .7 , .7 , .7 ),906        time: 2907      });908      t.start();909      var t = womb.tweener.createTween({910        object: womb.treeRing3.scene,911        target: new THREE.Vector3( -womb.size / 4 , 0 , 0 ),912        time: 1913      });914      t.start();915      var t = womb.tweener.createTween({916        object: womb.treeRing4.scene,917        target: new THREE.Vector3( womb.size / 4 , 0 , 0 ),918        time: 1919      });920      t.start();921      womb.mugRing.enter();922      womb.mugRing.scene.scale.multiplyScalar( .1 );923      womb.mugRing.scene.rotation.x = Math.PI / 2;924    }925    var afterSecondDrop1 = function(){926      womb.treeRing1.exit();927      var t = womb.tweener.createTween({928        type: 'scale',929        object: womb.treeRing1.scene,930        target: new THREE.Vector3( 1.5 ,1.5 ,1.5 ),931        time: 2932      });933      t.start();934      var t = womb.tweener.createTween({935        object: womb.treeRing3.scene,936        target: new THREE.Vector3( 0 , 0 , 0  ),937        time: 1938      });939      t.start();940      var t = womb.tweener.createTween({941        object: womb.treeRing4.scene,942        target: new THREE.Vector3( 0 , 0 , 0 ),943        time: 1944      });945      t.start();946      womb.mugRing.exit();947      womb.mugRing1.enter();948      womb.mugRing1.scene.scale.multiplyScalar( .4 );949      womb.mugRing1.scene.rotation.x = Math.PI / 2;950      womb.AVALON.exit();951    }952    var afterSecondDrop2 = function(){953      womb.treeRing2.exit();954      var t = womb.tweener.createTween({955        object: womb.treeRing3.scene,956        target: new THREE.Vector3( 0 ,  womb.size / 4  , 0 ),957        time: 1958      });959      t.start();960      var t = womb.tweener.createTween({961        object: womb.treeRing4.scene,962        target: new THREE.Vector3( 0 ,  -womb.size / 4  , 0 ),963        time: 1964      });965      t.start();966      womb.mugRing1.exit();967      womb.mugRing2.enter();968      womb.mugRing2.scene.scale.multiplyScalar( .5 );969      womb.mugRing2.scene.rotation.x = Math.PI / 2;970      womb.mugRing2.spinning = true;971    }972    var afterSecondDrop3 = function(){973      womb.treeRing3.exit();974      var t = womb.tweener.createTween({975        object: womb.treeRing4.scene,976        target: new THREE.Vector3(  0 , 0 , 0  ),977        time: 1978      });979      t.start();980      womb.mugRing2.exit();981      womb.mugRing3.enter();982      womb.mugRing3.scene.scale.multiplyScalar( .7 );983      womb.mugRing3.scene.rotation.x = Math.PI / 2;984    }985    var afterSecondDrop4 = function(){986    987      womb.mugRing3.exit();988      womb.mugRing4.enter();989      womb.mugRing4.scene.scale.multiplyScalar( .7 );990      womb.mugRing4.scene.rotation.x = Math.PI / 2;991    }992   993    var afterSecondDrop5 = function(){994    995      womb.mugRing4.exit();996      womb.mugRing.enter();997      womb.mugRing5.enter();998      womb.mugRing5.scene.scale.multiplyScalar( .9 );999      womb.mugRing5.scene.rotation.x = Math.PI / 2;1000    }1001    var PURE = function(){1002      womb.PURE.enter();1003    } 1004    var AVALON = function(){1005      womb.PURE.exit();1006      womb.AVALON.enter();1007    }1008    /*1009       CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT CUTOUT   1010    */1011    var cutout = function(){1012      womb.mugRing.exit();1013      womb.mugRing5.exit();1014      womb.treeRing4.exit();1015     // womb.physicsSim.enter();1016      womb.mainPulse.enter();1017    }1018    var backIn = function(){1019      1020      womb.mainPulse.exit();1021     // womb.physicsSim.exit();1022      womb.littleStars.enter();1023      womb.littleStars1.enter();1024      womb.littleStars2.enter();1025      womb.littleStars.spinning = true;1026      womb.littleStars1.spinning = true;1027      womb.littleStars2.spinning = true;1028      1029      womb.BEAUTYSQUARE.enter();1030    } 1031    afterBackIn = function(){1032      var t = womb.tweener.createTween({1033        type: 'scale',1034        object: womb.BEAUTYSQUARE.scene,1035        target: new THREE.Vector3( .8 , .8 , .8 ),1036        time: 11037      });1038      t.start();1039      var t = womb.tweener.createTween({1040        type: 'scale',1041        object: womb.littleStars.scene,1042        target: new THREE.Vector3( .5 , .5 , .5 ),1043        time: 31044      });1045      t.start();1046      var t = womb.tweener.createTween({1047        object: womb.treeRing3.scene,1048        target: new THREE.Vector3( 0 ,  0 , 0 ),1049        time: 11050      });1051      t.start();1052      womb.treeRing.enter();1053      var t = womb.tweener.createTween({1054        type: 'scale',1055        object: womb.treeRing.scene,1056        target: new THREE.Vector3( 1 , 1 , 1 ),1057        time: 11058      });1059      t.start();1060    }1061    afterBackIn1 = function(){1062      var t = womb.tweener.createTween({1063        type: 'scale',1064        object: womb.BEAUTYSQUARE.scene,1065        target: new THREE.Vector3( .7 , .7 , .7 ),1066        time: 11067      });1068      t.start();1069      var t = womb.tweener.createTween({1070        type: 'scale',1071        object: womb.littleStars1.scene,1072        target: new THREE.Vector3( .7 , .7 , .7 ),1073        time: 31074      });1075      t.start();1076      womb.treeRing1.enter();1077      var t = womb.tweener.createTween({1078        type: 'scale',1079        object: womb.treeRing.scene,1080        target: new THREE.Vector3( .6 , .6 , .6 ),1081        time: 11082      });1083      t.start();1084    }1085    afterBackIn2 = function(){1086      var t = womb.tweener.createTween({1087        type: 'scale',1088        object: womb.BEAUTYSQUARE.scene,1089        target: new THREE.Vector3( .6 , .6 , .6 ),1090        time: 11091      });1092      t.start();1093      var t = womb.tweener.createTween({1094        type: 'scale',1095        object: womb.littleStars2.scene,1096        target: new THREE.Vector3( .3 , .3 , .3 ),1097        time: 31098      });1099      t.start();1100      womb.treeRing2.enter();1101      var t = womb.tweener.createTween({1102        type: 'scale',1103        object: womb.treeRing.scene,1104        target: new THREE.Vector3( .4 , .4 , .4 ),1105        time: 11106      });1107      var t = womb.tweener.createTween({1108        type: 'scale',1109        object: womb.treeRing1.scene,1110        target: new THREE.Vector3( .6 , .6 , .6 ),1111        time: 11112      });1113      t.start();1114    }1115    afterBackIn3 = function(){1116      var t = womb.tweener.createTween({1117        type: 'scale',1118        object: womb.BEAUTYSQUARE.scene,1119        target: new THREE.Vector3( .5 , .5 , .5 ),1120        time: 11121      });1122      t.start();1123      womb.treeRing3.enter();1124      var t = womb.tweener.createTween({1125        type: 'scale',1126        object: womb.treeRing.scene,1127        target: new THREE.Vector3( .2 , .2 , .2 ),1128        time: 11129      });1130      var t = womb.tweener.createTween({1131        type: 'scale',1132        object: womb.treeRing1.scene,1133        target: new THREE.Vector3( .4 , .4 , .4 ),1134        time: 11135      });1136      womb.treeRing2.exit();1137      womb.randomCubes.enter();1138      womb.randomCubes.spinning = true;1139      womb.littleStars.exit();1140      womb.littleStars1.exit();1141      womb.littleStars2.exit();1142      womb.littleStars.spinning = true;1143      womb.littleStars1.spinning = true;1144      womb.littleStars2.spinning = true;1145      t.start();1146    }1147    afterBackIn4 = function(){1148      var t = womb.tweener.createTween({1149        type: 'scale',1150        object: womb.BEAUTYSQUARE.scene,1151        target: new THREE.Vector3( .5 , .5 , .5 ),1152        time: 11153      });1154      t.start();1155      var t = womb.tweener.createTween({1156        type: 'scale',1157        object: womb.treeRing.scene,1158        target: new THREE.Vector3( .1 , .1 , .1 ),1159        time: 11160      });1161      var t = womb.tweener.createTween({1162        type: 'scale',1163        object: womb.treeRing1.scene,1164        target: new THREE.Vector3( .3 , .3 , .3 ),1165        time: 11166      });1167       var t = womb.tweener.createTween({1168        type: 'scale',1169        object: womb.randomCubes.scene,1170        target: new THREE.Vector3( .6 , .6 , .6 ),1171        time: 11172      });1173      womb.treeRing1.exit();1174      womb.treeRing3.exit();1175      womb.treeRing2.exit();1176      womb.randomCubes1.enter();1177      womb.randomCubes1.spinning = true;1178      t.start();1179    }1180    afterBackIn5 = function(){1181      var t = womb.tweener.createTween({1182        type: 'scale',1183        object: womb.BEAUTYSQUARE.scene,1184        target: new THREE.Vector3( .5 , .5 , .5 ),1185        time: 11186      });1187      t.start();1188      var t = womb.tweener.createTween({1189        type: 'scale',1190        object: womb.randomCubes.scene,1191        target: new THREE.Vector3( .4 , .4 , .4 ),1192        time: 11193      });1194      var t = womb.tweener.createTween({1195        type: 'scale',1196        object: womb.randomCubes1.scene,1197        target: new THREE.Vector3( .6 , .6 , .6 ),1198        time: 11199      });1200      womb.treeRing2.exit();1201      womb.treeRing.exit();1202      womb.randomCubes2.enter();1203      womb.randomCubes2.spinning = true;1204      womb.treeRing1.spinning  = true;1205      t.start();1206    }1207    afterBackIn6 = function(){1208      var t = womb.tweener.createTween({1209        type: 'scale',1210        object: womb.BEAUTYSQUARE.scene,1211        target: new THREE.Vector3( .5 , .5 , .5 ),1212        time: 11213      });1214      t.start();1215      womb.treeRing3.position = new THREE.Vector3(  0 , 0 , 0 );1216      womb.treeRing3.enter();1217      womb.treeRing3.spinning  = true;1218      var t = womb.tweener.createTween({1219        type: 'scale',1220        object: womb.treeRing.scene,1221        target: new THREE.Vector3( .2 , .2 , .2 ),1222        time: 11223      });1224      var t = womb.tweener.createTween({1225        type: 'scale',1226        object: womb.treeRing1.scene,1227        target: new THREE.Vector3( .4 , .4 , .4 ),1228        time: 11229      });1230  1231      t.start();1232    }1233    afterBackIn7 = function(){1234      var t = womb.tweener.createTween({1235        type: 'scale',1236        object: womb.BEAUTYSQUARE.scene,1237        target: new THREE.Vector3( .5 , .5 , .5 ),1238        time: 11239      });1240      t.start();1241      womb.treeRing4.enter();1242      womb.treeRing.spinning = true;1243      var t = womb.tweener.createTween({1244        type: 'scale',1245        object: womb.treeRing.scene,1246        target: new THREE.Vector3( .2 , .2 , .2 ),1247        time: 11248      });1249      var t = womb.tweener.createTween({1250        type: 'scale',1251        object: womb.treeRing1.scene,1252        target: new THREE.Vector3( .4 , .4 , .4 ),1253        time: 11254      });1255      t.start();1256    }1257    1258    1259    /*1260    1261    END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END END 1262    */1263    var cutoutEnd1 = function(){1264      womb.FRACTALCOMBO.enter();1265      womb.FRACTALCOMBO.updateSeed = true;1266      womb.FRACTALCOMBO.scene.rotation.y = Math.PI / 2;1267    1268      womb.littleStars.enter();1269      womb.littleStars1.enter();1270      womb.littleStars2.enter();1271      1272      womb.BEAUTYSQUARE.exit();1273      womb.randomCubes.exit();1274      womb.randomCubes1.exit();1275      womb.randomCubes2.exit();1276      womb.randomCubes3.exit();1277      womb.treeRing.exit();1278      womb.treeRing1.exit();1279      womb.treeRing2.exit();1280      womb.treeRing3.exit();1281    }1282    var cutoutEnd2 = function(){1283      womb.treeRing4.exit();1284    } 1285    1286    var cutoutEnd3 = function(){1287    1288      var t = womb.tweener.createTween({1289        type: 'scale',1290        object: womb.littleStars.scene,1291        target: new THREE.Vector3( .01 , .01 , .01 ),1292        time: 101293      });1294      var t = womb.tweener.createTween({1295        type: 'scale',1296        object: womb.littleStars1.scene,1297        target: new THREE.Vector3( .01 , .01 , .01 ),1298        time: 151299      });1300      var t = womb.tweener.createTween({1301        type: 'scale',1302        object: womb.littleStars2.scene,1303        target: new THREE.Vector3( .01 , .01 , .01 ),1304        time: 201305      });1306    }1307       1308 1309    var end = function(){1310      womb.littleStars.exit();1311      womb.littleStars1.exit();1312      womb.littleStars2.exit();1313      womb.FRACTALCOMBO.exit();1314      // TODO:...

Full Screen

Full Screen

CameraFlightPathSpec.js

Source:CameraFlightPathSpec.js Github

copy

Full Screen

...42    }4344    it('create animation throws without a scene', function() {45        expect(function() {46            CameraFlightPath.createTween(undefined, {47                destination : new Cartesian3(1e9, 1e9, 1e9)48            });49        }).toThrowDeveloperError();50    });5152    it('create animation throws without a destination', function() {53        expect(function() {54            CameraFlightPath.createTween(scene, {});55        }).toThrowDeveloperError();56    });5758    it('creates an animation', function() {59        var destination = new Cartesian3(1e9, 1e9, 1e9);60        var duration = 5.0;61        var complete = function() {62        };63        var cancel = function() {64        };6566        var flight = CameraFlightPath.createTween(scene, {67            destination : destination,68            duration : duration,69            complete : complete,70            cancel: cancel71        });7273        expect(flight.duration).toEqual(duration);74        expect(typeof flight.complete).toEqual('function');75        expect(typeof flight.cancel).toEqual('function');76        expect(typeof flight.update).toEqual('function');77        expect(flight.startObject).toBeDefined();78        expect(flight.stopObject).toBeDefined();79        expect(flight.easingFunction).toBeDefined();80    });8182    it('creates an animation in 3d', function() {83        var camera = scene.camera;8485        var startPosition = Cartesian3.clone(camera.position);86        var startHeading = camera.heading;87        var startPitch = camera.pitch;88        var startRoll = camera.roll;8990        var endPosition = Cartesian3.negate(startPosition, new Cartesian3());91        var endHeading = CesiumMath.toRadians(20.0);92        var endPitch = CesiumMath.toRadians(-45.0);93        var endRoll = CesiumMath.TWO_PI;9495        var duration = 5.0;96        var flight = CameraFlightPath.createTween(scene, {97            destination : endPosition,98            heading : endHeading,99            pitch : endPitch,100            roll : endRoll,101            duration : duration102        });103104        flight.update({ time : 0.0 });105        expect(camera.position).toEqualEpsilon(startPosition, CesiumMath.EPSILON12);106        expect(camera.heading).toEqualEpsilon(startHeading, CesiumMath.EPSILON12);107        expect(camera.pitch).toEqualEpsilon(startPitch, CesiumMath.EPSILON12);108        expect(camera.roll).toEqualEpsilon(startRoll, CesiumMath.EPSILON12);109110        flight.update({ time : duration });111        expect(camera.position).toEqualEpsilon(endPosition, CesiumMath.EPSILON12);112        expect(camera.heading).toEqualEpsilon(endHeading, CesiumMath.EPSILON12);113        expect(camera.pitch).toEqualEpsilon(endPitch, CesiumMath.EPSILON12);114        expect(camera.roll).toEqualEpsilon(endRoll, CesiumMath.EPSILON12);115    });116117    it('creates an animation in Columbus view', function() {118        scene._mode = SceneMode.COLUMBUS_VIEW;119        var camera = scene.camera;120121        camera.position = new Cartesian3(0.0, 0.0, 1000.0);122        camera.direction = Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3());123        camera.up = Cartesian3.clone(Cartesian3.UNIT_Y);124        camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3());125126        var startPosition = Cartesian3.clone(camera.position);127128        var projection = scene.mapProjection;129        var destination = Cartesian3.add(startPosition, new Cartesian3(-6e5 * Math.PI, 6e5 * CesiumMath.PI_OVER_FOUR, 100.0), new Cartesian3());130        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(destination));131132        var duration = 5.0;133        var flight = CameraFlightPath.createTween(scene, {134            destination : endPosition,135            duration : duration136        });137138        flight.update({ time : 0.0 });139        expect(camera.position).toEqualEpsilon(startPosition, CesiumMath.EPSILON12);140141        flight.update({ time : duration });142        expect(camera.position).toEqualEpsilon(destination, CesiumMath.EPSILON4);143    });144145    it('creates an animation in 2D', function() {146        scene._mode = SceneMode.SCENE2D;147        var camera = scene.camera;148149        camera.position = new Cartesian3(0.0, 0.0, 1000.0);150        camera.direction = Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3());151        camera.up = Cartesian3.clone(Cartesian3.UNIT_Y);152        camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3());153        camera.frustum = createOrthographicFrustum();154155        var startHeight = camera.frustum.right - camera.frustum.left;156        var startPosition = Cartesian3.clone(camera.position);157158        var projection = scene.mapProjection;159        var destination = Cartesian3.add(startPosition, new Cartesian3(-6e6 * Math.PI, 6e6 * CesiumMath.PI_OVER_FOUR, 100.0), new Cartesian3());160        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(destination));161162        var duration = 5.0;163        var flight = CameraFlightPath.createTween(scene, {164            destination : endPosition,165            duration : duration166        });167168        flight.update({ time : 0.0 });169        expect(camera.position).toEqualEpsilon(startPosition, CesiumMath.EPSILON12);170        expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon(startHeight, CesiumMath.EPSILON7);171172        flight.update({ time : duration });173        expect(camera.position.x).toEqualEpsilon(destination.x, CesiumMath.EPSILON7);174        expect(camera.position.y).toEqualEpsilon(destination.y, CesiumMath.EPSILON7);175        expect(camera.position.z).toEqualEpsilon(startPosition.z, CesiumMath.EPSILON7);176        expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon(destination.z, CesiumMath.EPSILON7);177    });178179    it('creates a path where the start and end points only differ in height', function() {180        var camera = scene.camera;181        var start = Cartesian3.clone(camera.position);182        var mag = Cartesian3.magnitude(start);183        var end = Cartesian3.multiplyByScalar(Cartesian3.normalize(start, new Cartesian3()), mag - 1000000.0, new Cartesian3());184185        var duration = 3.0;186        var flight = CameraFlightPath.createTween(scene, {187            destination : end,188            duration : duration189        });190191        flight.update({ time : 0.0 });192        expect(camera.position).toEqualEpsilon(start, CesiumMath.EPSILON12);193194        flight.update({ time : duration });195        expect(camera.position).toEqualEpsilon(end, CesiumMath.EPSILON12);196    });197198    it('does not create a path to the same point', function() {199        var camera = scene.camera;200        camera.position = new Cartesian3(7000000.0, 0.0, 0.0);201202        var startPosition = Cartesian3.clone(camera.position);203        var startHeading= camera.heading;204        var startPitch = camera.pitch;205        var startRoll = camera.roll;206207        var duration = 3.0;208        var flight = CameraFlightPath.createTween(scene, {209            destination : startPosition,210            heading : startHeading,211            pitch : startPitch,212            roll: startRoll,213            duration : duration214        });215216        expect(flight.duration).toEqual(0);217        expect(camera.position).toEqual(startPosition);218        expect(camera.heading).toEqual(startHeading);219        expect(camera.pitch).toEqual(startPitch);220        expect(camera.roll).toEqual(startRoll);221    });222223    it('creates an animation with 0 duration', function() {224        var destination = new Cartesian3(1e9, 1e9, 1e9);225        var duration = 0.0;226        var complete = function() {227            return true;228        };229230        var flight = CameraFlightPath.createTween(scene, {231            destination : destination,232            duration : duration,233            complete : complete234        });235236        expect(flight.duration).toEqual(duration);237        expect(flight.complete).not.toEqual(complete);238        expect(flight.update).toBeUndefined();239        expect(scene.camera.position).not.toEqual(destination);240        flight.complete();241        expect(scene.camera.position).toEqualEpsilon(destination, CesiumMath.EPSILON14);242    });243244    it('duration is 0 when destination is the same as camera position in 2D', function() {245        scene._mode = SceneMode.SCENE2D;246        var camera = scene.camera;247248        camera.position = new Cartesian3(0.0, 0.0, 1000.0);249        camera.direction = Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3());250        camera.up = Cartesian3.clone(Cartesian3.UNIT_Y);251        camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3());252        camera.frustum = createOrthographicFrustum();253        camera.update(scene.mode);254        var frustum = camera.frustum;255        var destination = Cartesian3.clone(camera.position);256        destination.z = Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom);257258        var projection = scene.mapProjection;259        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(destination));260261        var flight = CameraFlightPath.createTween(scene, {262            destination : endPosition263        });264265        expect(flight.duration).toEqual(0.0);266    });267268    it('duration is 0 when destination is the same as camera position in 3D', function() {269        scene._mode = SceneMode.SCENE3D;270        var camera = scene.camera;271272        camera.position = new Cartesian3(0.0, 0.0, 1000.0);273        camera.setView({274            orientation: {275                heading: 0,276                pitch: -CesiumMath.PI_OVER_TWO,277                roll: 0278            }279        });280        camera.frustum = createOrthographicFrustum();281282        var flight = CameraFlightPath.createTween(scene, {283            destination : camera.position284        });285286        expect(flight.duration).toEqual(0.0);287    });288289    it('duration is 0 when destination is the same as camera position in CV', function() {290        scene._mode = SceneMode.COLUMBUS_VIEW;291        var camera = scene.camera;292293        camera.position = new Cartesian3(0.0, 0.0, 1000.0);294        camera.setView({295            orientation: {296                heading: 0,297                pitch: -CesiumMath.PI_OVER_TWO,298                roll: 0299            }300        });301302        var projection = scene.mapProjection;303        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(camera.position));304305        var flight = CameraFlightPath.createTween(scene, {306            destination : endPosition307        });308309        expect(flight.duration).toEqual(0.0);310    });311312    it('creates an animation in 2D 0 duration', function() {313        scene._mode = SceneMode.SCENE2D;314        var camera = scene.camera;315316        camera.position = new Cartesian3(0.0, 0.0, 1000.0);317        camera.direction = Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3());318        camera.up = Cartesian3.clone(Cartesian3.UNIT_Y);319        camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3());320        camera.frustum = createOrthographicFrustum();321322        camera.update(scene.mode);323324        var startPosition = Cartesian3.clone(camera.position);325326        var projection = scene.mapProjection;327        var destination = Cartesian3.add(startPosition, new Cartesian3(-6e5 * Math.PI, 6e5 * CesiumMath.PI_OVER_FOUR, 100.0), new Cartesian3());328        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(destination));329330        var flight = CameraFlightPath.createTween(scene, {331            destination : endPosition,332            duration : 0.0333        });334335        expect(typeof flight.complete).toEqual('function');336        flight.complete();337        expect(camera.position.x).toEqualEpsilon(destination.x, CesiumMath.EPSILON7);338        expect(camera.position.y).toEqualEpsilon(destination.y, CesiumMath.EPSILON7);339        expect(camera.frustum.right - camera.frustum.left).toEqualEpsilon(destination.z, CesiumMath.EPSILON7);340    });341342    it('creates an animation in Columbus view 0 duration', function() {343        scene._mode = SceneMode.COLUMBUS_VIEW;344        var camera = scene.camera;345346        camera.position = new Cartesian3(0.0, 0.0, 1000.0);347        camera.direction = Cartesian3.negate(Cartesian3.UNIT_Z, new Cartesian3());348        camera.up = Cartesian3.clone(Cartesian3.UNIT_Y);349        camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3());350351        var startPosition = Cartesian3.clone(camera.position);352353        var projection = scene.mapProjection;354        var destination = Cartesian3.add(startPosition, new Cartesian3(-6e6 * Math.PI, 6e6 * CesiumMath.PI_OVER_FOUR, 100.0), new Cartesian3());355        var endPosition = projection.ellipsoid.cartographicToCartesian(projection.unproject(destination));356357        var flight = CameraFlightPath.createTween(scene, {358            destination : endPosition,359            duration : 0.0360        });361362        expect(typeof flight.complete).toEqual('function');363        flight.complete();364        expect(camera.position).toEqualEpsilon(destination, CesiumMath.EPSILON8);365    });366367    it('creates an animation in 3d 0 duration', function() {368        var camera = scene.camera;369370        var startPosition = Cartesian3.clone(camera.position);371        var endPosition = Cartesian3.negate(startPosition, new Cartesian3());372373        var flight = CameraFlightPath.createTween(scene, {374            destination : endPosition,375            duration : 0.0376        });377378        expect(typeof flight.complete).toEqual('function');379        flight.complete();380        expect(camera.position).toEqualEpsilon(endPosition, CesiumMath.EPSILON12);381    });382383    it('creates animation to hit flyOverLongitude', function() {384        var camera = scene.camera;385        var projection = scene.mapProjection;386        var position = new Cartographic();387388        camera.position = Cartesian3.fromDegrees(10.0, 45.0, 1000.0);389390        var endPosition = Cartesian3.fromDegrees(20.0, 45.0, 1000.0);391392        var overLonFlight = CameraFlightPath.createTween(scene, {393            destination : endPosition,394            duration : 1.0,395            flyOverLongitude: CesiumMath.toRadians(0.0)396        });397398        var directFlight = CameraFlightPath.createTween(scene, {399            destination : endPosition,400            duration : 1.0401        });402403        expect(typeof overLonFlight.update).toEqual('function');404        expect(typeof directFlight.update).toEqual('function');405406        overLonFlight.update({ time : 0.3 });407        projection.ellipsoid.cartesianToCartographic(camera.position, position);408        var lon = CesiumMath.toDegrees(position.longitude);409410        expect(lon).toBeLessThan(10.0);411412        directFlight.update({ time : 0.3 });413        projection.ellipsoid.cartesianToCartographic(camera.position, position);414        lon = CesiumMath.toDegrees(position.longitude);415416        expect(lon).toBeGreaterThan(10.0);417        expect(lon).toBeLessThan(20.0);418419    });420421    it('uses flyOverLongitudeWeight', function() {422        var camera = scene.camera;423        var projection = scene.mapProjection;424        var position = new Cartographic();425426        camera.position = Cartesian3.fromDegrees(10.0, 45.0, 1000.0);427428        var endPosition = Cartesian3.fromDegrees(50.0, 45.0, 1000.0);429430        var overLonFlightSmallWeight = CameraFlightPath.createTween(scene, {431            destination : endPosition,432            duration : 1.0,433            flyOverLongitude: CesiumMath.toRadians(0.0),434            flyOverLongitudeWeight: 2435        });436437        var overLonFlightBigWeight = CameraFlightPath.createTween(scene, {438            destination : endPosition,439            duration : 1.0,440            flyOverLongitude: CesiumMath.toRadians(0.0),441            flyOverLongitudeWeight: 20442        });443444        overLonFlightBigWeight.update({ time : 0.3 });445        projection.ellipsoid.cartesianToCartographic(camera.position, position);446        var lon = CesiumMath.toDegrees(position.longitude);447448        expect(lon).toBeLessThan(10.0);449450        overLonFlightSmallWeight.update({ time : 0.3 });451        projection.ellipsoid.cartesianToCartographic(camera.position, position);452        lon = CesiumMath.toDegrees(position.longitude);453454        expect(lon).toBeGreaterThan(10.0);455        expect(lon).toBeLessThan(50.0);456457    });458459    it('adjust pitch if camera flyes higher than pitchAdjustHeight', function(){460        var camera = scene.camera;461        var duration = 5.0;462463        camera.setView({464            destination : Cartesian3.fromDegrees(-20.0, 0.0, 1000.0),465            orientation: {466                heading : CesiumMath.toRadians(0.0),467                pitch : CesiumMath.toRadians(-15.0),468                roll : 0.0469            }470        });471472        var startPitch = camera.pitch;473        var endPitch = CesiumMath.toRadians(-45.0);474475        var flight = CameraFlightPath.createTween(scene, {476            destination : Cartesian3.fromDegrees(60.0, 0.0, 2000.0),477            pitch : endPitch,478            duration : duration,479            pitchAdjustHeight: 2000480        });481482        flight.update({ time: 0.0 });483        expect(camera.pitch).toEqualEpsilon(startPitch, CesiumMath.EPSILON6);484485        flight.update({ time : duration });486        expect(camera.pitch).toEqualEpsilon(endPitch, CesiumMath.EPSILON6);487488        flight.update({ time : duration / 2.0 });489        expect(camera.pitch).toEqualEpsilon(-CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON4);490491    });492493    it('animation with flyOverLongitude is smooth over two pi', function() {494        var camera = scene.camera;495        var duration = 100.0;496        var projection = scene.mapProjection;497        var position = new Cartographic();498499        var startLonDegrees = 10.0;500        var endLonDegrees = 20.0;501502        camera.position = Cartesian3.fromDegrees(startLonDegrees, 45.0, 1000.0);503        var endPosition = Cartesian3.fromDegrees(endLonDegrees, 45.0, 1000.0);504505        var outsideTwoPiFlight = CameraFlightPath.createTween(scene, {506            destination : endPosition,507            duration : duration,508            flyOverLongitude: CesiumMath.toRadians(0.0)509        });510511        var prevLon = startLonDegrees;512        var crossedDateChangesLine = 0;513        for(var t = 1; t < duration; t++) {514            outsideTwoPiFlight.update({ time: t });515            projection.ellipsoid.cartesianToCartographic(camera.position, position);516            var lon = CesiumMath.toDegrees(position.longitude);517            var d = lon - prevLon;518            if (d > 0) {519                expect(prevLon).toBeLessThan(-90);520                crossedDateChangesLine ++;521                d -= 360;522            }523            prevLon = lon;524            expect(d).toBeLessThan(0);525        }526527        expect(crossedDateChangesLine).toEqual(1);528    });529530    it('animation with flyOverLongitude is smooth', function() {531        var camera = scene.camera;532        var duration = 100.0;533        var projection = scene.mapProjection;534        var position = new Cartographic();535536        var startLonDegrees = -100.0;537        var endLonDegrees = 100.0;538539        camera.position = Cartesian3.fromDegrees(startLonDegrees, 45.0, 1000.0);540        var endPosition = Cartesian3.fromDegrees(endLonDegrees, 45.0, 1000.0);541542        var flight = CameraFlightPath.createTween(scene, {543            destination : endPosition,544            duration : duration,545            flyOverLongitude: CesiumMath.toRadians(0.0)546        });547548        var prevLon = startLonDegrees;549        for(var t = 1; t < duration; t++) {550            flight.update({ time: t });551            projection.ellipsoid.cartesianToCartographic(camera.position, position);552            var lon = CesiumMath.toDegrees(position.longitude);553            var d = lon - prevLon;554            prevLon = lon;555            expect(d).toBeGreaterThan(0);556        }557    });558559    it('does not go above the maximum height', function() {560        var camera = scene.camera;561562        var startPosition = Cartesian3.fromDegrees(0.0, 0.0, 1000.0);563        var endPosition = Cartesian3.fromDegrees(10.0, 0.0, 1000.0);564        var duration = 5.0;565566        camera.setView({567            destination : startPosition568        });569570        var flight = CameraFlightPath.createTween(scene, {571            destination : endPosition,572            duration : duration573        });574575        var maximumHeight = Number.NEGATIVE_INFINITY;576        var i;577        for (i = 0; i <= duration; ++i) {578            flight.update({ time : i });579            maximumHeight = Math.max(maximumHeight, camera.positionCartographic.height);580        }581582        maximumHeight *= 0.5;583584        camera.setView({585            destination : startPosition586        });587588        flight = CameraFlightPath.createTween(scene, {589            destination : endPosition,590            duration : duration,591            maximumHeight : maximumHeight592        });593594        for (i = 0; i <= duration; ++i) {595            flight.update({ time : i });596            expect(camera.positionCartographic.height).toBeLessThan(maximumHeight);597        }598    });
...

Full Screen

Full Screen

Params.js

Source:Params.js Github

copy

Full Screen

...133				return order[counter++]*LILYPAD.Params.delay;134			};135		};136		var getItemDelay = delayer(2);137		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.colorSpeed,  param:LILYPAD.Params.colorSpeed}));138		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.colorRange, param:LILYPAD.Params.colorRange}));139		tween = {140			time:0,141			duration:LILYPAD.Params.speed,142			effect:'easeInOut',143			start:0,144			stop:1,145			onStop:function(){146				// scope.waiter();147			},148		}149		tweens.push(tween);150		$('#proxy').clear();151		$('#proxy').tween(tweens).play();152		return this;153	};	154	this.randomizeAllValues = function() {155		// trace("randomizeAllValues");156		var tweens = [];157		var tween;158		function delayer (total){159			var order = shuffleArray(total);160			var counter = 0;161			return function(e){162				return order[counter++]*LILYPAD.Params.delay;163			};164		};165		var getItemDelay = delayer(14);166		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.noiseSpeed,  param:LILYPAD.Params.noiseSpeed}));167		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.noiseAmount,  param:LILYPAD.Params.noiseAmount}));168		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.noiseIntensity,  param:LILYPAD.Params.noiseIntensity}));169		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.radiusRange,  param:LILYPAD.Params.radiusRange}));170		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.radius,  param:LILYPAD.Params.radius}));171		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.centerRadius,  param:LILYPAD.Params.centerRadius}));172		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.centerSpeed,  param:LILYPAD.Params.centerSpeed}));173		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.centerOffset,  param:LILYPAD.Params.centerOffset}));174		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.multiplier,  param:LILYPAD.Params.multiplier}));175		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.maxHeightRange,  param:LILYPAD.Params.maxHeightRange}));176		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.heightOffset,  param:LILYPAD.Params.heightOffset}));177		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.waterHeight,  param:LILYPAD.Params.waterHeight}));178		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.colorSpeed,  param:LILYPAD.Params.colorSpeed}));179		tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.colorRange, param:LILYPAD.Params.colorRange}));180		// tweens.push(this.createTween({ delay:getItemDelay(),  slider:LILYPAD.Sliders.wrapAmount,  param:LILYPAD.Params.wrapAmount}));181		tween = {182			time:0,183			duration:LILYPAD.Params.speed,184			effect: 'easeInOut',185			start:0,186			stop:1,187			onStop:function(){188				// scope.waiter();189			},190		}191		tweens.push(tween);192		$('#proxy').clear();193		$('#proxy').tween(tweens).play();194		return this;...

Full Screen

Full Screen

GTween.js

Source:GTween.js Github

copy

Full Screen

1import { TweenManager } from "./TweenManager";2export class GTween {3    static to(start, end, duration) {4        return TweenManager.createTween()._to(start, end, duration);5    }6    static to2(start, start2, end, end2, duration) {7        return TweenManager.createTween()._to2(start, start2, end, end2, duration);8    }9    static to3(start, start2, start3, end, end2, end3, duration) {10        return TweenManager.createTween()._to3(start, start2, start3, end, end2, end3, duration);11    }12    static to4(start, start2, start3, start4, end, end2, end3, end4, duration) {13        return TweenManager.createTween()._to4(start, start2, start3, start4, end, end2, end3, end4, duration);14    }15    static toColor(start, end, duration) {16        return TweenManager.createTween()._toColor(start, end, duration);17    }18    static delayedCall(delay) {19        return TweenManager.createTween().setDelay(delay);20    }21    static shake(startX, startY, amplitude, duration) {22        return TweenManager.createTween()._shake(startX, startY, amplitude, duration);23    }24    static isTweening(target, propType) {25        return TweenManager.isTweening(target, propType);26    }27    static kill(target, complete, propType) {28        TweenManager.killTweens(target, complete, propType);29    }30    static getTween(target, propType) {31        return TweenManager.getTween(target, propType);32    }33}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1cy.get('button').click()2cy.get('div').should('have.css', 'opacity', '0')3cy.get('div').createTween('opacity', 1, 1000).play()4cy.get('div').should('have.css', 'opacity', '1')5cy.get('button').click()6cy.get('div').should('have.css', 'opacity', '0')7cy.get('div').invoke('createTween', 'opacity', 1, 1000).play()8cy.get('div').should('have.css', 'opacity', '1')9cy.get('button').click()10cy.get('div').should('have.css', 'opacity', '0')11cy.get('div').invoke('animate', {opacity: 1}, 1000)12cy.get('div').should('have.css', 'opacity', '1')13cy.get('button').click()14cy.get('div').should('have.css', 'opacity', '0')15cy.get('div').invoke('animate', {opacity: 1}, 1000)16cy.get('div').should('have.css', 'opacity', '1')17cy.get('button').click()18cy.get('div').should('have.css', 'opacity', '0')19cy.get('div').invoke('animate', {opacity: 1}, 1000)20cy.get('div').should('have.css', 'opacity', '1')21cy.get('button').click()22cy.get('div').should('have.css', 'opacity', '0')23cy.get('div').invoke('animate', {opacity: 1}, 1000)24cy.get('div').should('have.css', 'opacity', '1')25cy.get('button').click()26cy.get('div').should('have.css', 'opacity', '0')27cy.get('div').invoke('animate', {opacity: 1}, 1000)28cy.get('div').should('have.css', 'opacity', '1')

Full Screen

Using AI Code Generation

copy

Full Screen

1cy.get('#element').createTween({2  from: { opacity: 0 },3  to: { opacity: 1 },4  onUpdate: (tween) => {5    const { opacity } = tween;6  },7  onComplete: () => {8  },9});10### createTween(options)11| `from` | `object` | `{}` | The starting values for the tween. |12| `to` | `object` | `{}` | The ending values for the tween. |

Full Screen

Using AI Code Generation

copy

Full Screen

1cy.get('button').then($btn => {2  const tween = Cypress.Tween.get($btn)3  tween.to({ width: 500 }, 1000)4  tween.wait(1000)5  tween.to({ width: 300 }, 1000)6  tween.wait(1000)7  tween.to({ width: 500 }, 1000)8  tween.wait(1000)9  tween.to({ width: 300 }, 1000)10  tween.wait(1000)11  tween.to({ width: 500 }, 1000)12  tween.wait(1000)13  tween.to({ width: 300 }, 1000)14  tween.wait(1000)15  tween.to({ width: 500 }, 1000)16  tween.wait(1000)17  tween.to({ width: 300 }, 1000)18  tween.wait(1000)19  tween.to({ width: 500 }, 1000)20  tween.wait(1000)21  tween.to({ width: 300 }, 1000)22  tween.wait(1000)23  tween.to({ width: 500 }, 1000)24  tween.wait(1000)25  tween.to({ width: 300 }, 1000)26  tween.wait(1000)27  tween.to({ width: 500 }, 1000)28  tween.wait(1000)29  tween.to({ width: 300 }, 1000)30  tween.wait(1000)31  tween.to({ width: 500 }, 1000)32  tween.wait(1000)33  tween.to({ width: 300 }, 1000)34  tween.wait(1000)35  tween.to({ width: 500 }, 1000)36  tween.wait(1000)37  tween.to({ width: 300 }, 1000)38  tween.wait(1000)39  tween.to({ width: 500 }, 1000)40  tween.wait(1000)41  tween.to({ width: 300 }, 1000)42  tween.wait(1000)43  tween.to({ width: 500 }, 1000)44  tween.wait(1000)45  tween.to({ width: 300 }, 1000)46  tween.wait(1000)47  tween.to({ width: 500 }, 1000)48  tween.wait(1000)49  tween.to({ width: 300 }, 1000)50  tween.wait(1000

Full Screen

Using AI Code Generation

copy

Full Screen

1cy.get('#myButton').click().createTween(1000, {x: 200, y: 300}).play()2cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()3cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()4cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()5cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()6cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()7cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()8cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()9cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()10cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()11cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()12cy.get('#myButton').click().invoke('createTween', 1000, {x: 200, y: 300}).play()13cy.get('#myButton').click().invoke('createTween', 1000, {x: 200

Full Screen

Using AI Code Generation

copy

Full Screen

1cy.createTween('myTween', {duration: 1000, from: 0, to: 100});2cy.myTween(0);3cy.myTween(100);4Cypress.Commands.add('createTween', (name, options) => {5  cy.window().then((win) => {6    win.TweenMax[name] = (value) => {7      win.TweenMax.to(win, options.duration / 1000, {8      });9    };10  });11});12import './commands';13Cypress.Commands.add('createTween', (name, options) => {14  cy.window().then((win) => {15    win.TweenMax[name] = (value) => {16      win.TweenMax.to(win, options.duration / 1000, {17      });18    };19  });20});21describe('My Test Suite', () => {22  it('My Test Case', () => {23    cy.visit('/');24    cy.createTween('myTween', {duration: 1000, from: 0, to: 100});25    cy.myTween(0);26    cy.myTween(100);27  });28});29describe('My Test Suite', () => {30  it('My Test Case', () => {31    cy.visit('/');32    cy.createTween('myTween', {duration: 1000, from: 0, to: 100});33    cy.myTween(0);34    cy.myTween(100);35  });36});37import './commands';38Cypress.Commands.add('createTween', (name, options) => {39  cy.window().then((win) => {40    win.TweenMax[name] = (value) => {41      win.TweenMax.to(win, options.duration / 1000, {42      });43    };44  });45});46Cypress.Commands.add('createTween', (name, options) => {47  cy.window().then((win) => {48    win.TweenMax[name] = (value) => {49      win.TweenMax.to(win, options.duration /

Full Screen

Cypress Tutorial

Cypress is a renowned Javascript-based open-source, easy-to-use end-to-end testing framework primarily used for testing web applications. Cypress is a relatively new player in the automation testing space and has been gaining much traction lately, as evidenced by the number of Forks (2.7K) and Stars (42.1K) for the project. LambdaTest’s Cypress Tutorial covers step-by-step guides that will help you learn from the basics till you run automation tests on LambdaTest.

Chapters:

  1. What is Cypress? -
  2. Why Cypress? - Learn why Cypress might be a good choice for testing your web applications.
  3. Features of Cypress Testing - Learn about features that make Cypress a powerful and flexible tool for testing web applications.
  4. Cypress Drawbacks - Although Cypress has many strengths, it has a few limitations that you should be aware of.
  5. Cypress Architecture - Learn more about Cypress architecture and how it is designed to be run directly in the browser, i.e., it does not have any additional servers.
  6. Browsers Supported by Cypress - Cypress is built on top of the Electron browser, supporting all modern web browsers. Learn browsers that support Cypress.
  7. Selenium vs Cypress: A Detailed Comparison - Compare and explore some key differences in terms of their design and features.
  8. Cypress Learning: Best Practices - Take a deep dive into some of the best practices you should use to avoid anti-patterns in your automation tests.
  9. How To Run Cypress Tests on LambdaTest? - Set up a LambdaTest account, and now you are all set to learn how to run Cypress tests.

Certification

You can elevate your expertise with end-to-end testing using the Cypress automation framework and stay one step ahead in your career by earning a Cypress certification. Check out our Cypress 101 Certification.

YouTube

Watch this 3 hours of complete tutorial to learn the basics of Cypress and various Cypress commands with the Cypress testing at LambdaTest.

Run Cypress automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful