Commit 425eaa63 authored by 华国豪's avatar 华国豪 🙄

1

parent 5cc3b279
This diff is collapsed.
@font-face{
font-family:'yinxiang2020';
src:url('../fonts/yinxiang2020.woff');
}
@font-face {
font-family: "PingFangR";
src: url("../fonts/Semibold.eot"); /* IE9 */
src: url("../fonts/Semibold.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("../fonts/Semibold.woff") format("woff"), /* chrome, firefox */
url("../fonts/Semibold.ttf") format("truetype"); /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: "lingxin";
src: url("../fonts/lingxin.ttf") format("truetype"); /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
font-style: normal;
font-weight: normal;
}
.yinxiang2020{
font-family: 'yinxiang2020';
}
html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu {
margin: 0;
padding: 0
}
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details {
display: block
}
table {
border-collapse: collapse;
border-spacing: 0
}
caption,th {
text-align: left;
font-weight: normal
}
html,body,fieldset,img,iframe,abbr {
border: 0
}
i,cite,em,var,address,dfn {
font-style: normal
}[hidefocus],summary {
outline: 0
}
li {
list-style: none
}
html,body {
width: 100%;
height: 100%
}
html {
overflow: hidden;
font-size: 62.5%
}
.ce9{
color: #e9d5ab !important;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -217,16 +217,16 @@
secretKey: "",
};
$(".tanchuang").hide()
// 1 判断地址栏是否有参数
var billPage = localStorage.billPage ? JSON.parse(localStorage.billPage) : ''
var newPageIndex = localStorage.newPageIndex ? localStorage.newPageIndex : 0,
maxPageIndex = 9;
// 1 判断地址栏是否有参数
if(window.location.href.split('?')[1]){
let param = window.location.href.split('?')[1].split("&") ? window.location.href.split('?')[1].split("&") : null;
var param = window.location.href.split('?')[1].split("&") ? window.location.href.split('?')[1].split("&") : null;
userInfo.customerId = param ? param[0].split('=')[1] : 0;
userInfo.token = param ? param[2].split('=')[1] : 0;
userInfo.secretKey = param ? param[3].split('=')[1] : 0;
let userJson = JSON.stringify(userInfo);
var userJson = JSON.stringify(userInfo);
localStorage.billPage = userJson;
} else if (billPage){ // 2 获取本地缓存
userInfo.customerId = billPage.customerId
......@@ -242,18 +242,20 @@
TextContentList = [],
danmuIndex = 0;
param = param.split('&');
let customerId = param[0].split('=')[1];
var customerId = param[0].split('=')[1];
var myChart1 = echarts.init(document.getElementById('xianluEchart'));
var myChart2 = echarts.init(document.getElementById('nianlingEchart'));
var option = {
container: "#danmu",//弹幕墙的id
barrageLen: 5//弹幕的行数
}
barrageWall.init(option);//初始化弹幕墙
//初始化弹幕墙
barrageWall.init(option);
getData();
// 获取数据
function getData(){
let msg = {
customerId: 9141,
var msg = {
customerId: locationName.indexOf('oytour') !== -1 ? userInfo.customerId : 7989,
}
$.ajax({
type: "POST",
......@@ -288,6 +290,7 @@
if (newPageIndex > 0) {
$("#page9 #dahongbao").animateNumber({ number: dataObj.yearTotalPrice}, 2000)
document.getElementById('wrap2').style.transform = 'translateY(' + (-(newPageIndex-1) * 10) + '%)'; //根据手指的位置移动页面
$("#fan-down").hide()
}
// 弹幕
var danmu=document.getElementById('danmu');
......@@ -310,9 +313,9 @@
}
var ageData = {
LineName: ['老人', '成年人', '小孩'],
TotalGuest: [dataObj.OldGuest, dataObj.TotalGuest, dataObj.ChildrenGuest]
TotalGuest: [dataObj.OldGuest, dataObj.AdultGuest, dataObj.ChildrenGuest]
}
if ((dataObj.OldGuest + dataObj.TotalGuest + dataObj.ChildrenGuest) > 0) {
if ((dataObj.OldGuest + dataObj.AdultGuest + dataObj.ChildrenGuest) > 0) {
creatEchart2(ageData)
}
} else {
......@@ -324,10 +327,11 @@
}
})
};
// 创建日历
function creatRili(day, maxDay) {
$(".rili-box>div").hide()
let htmlStr = ''
for(let i = 1; i <= maxDay; i++) {
var htmlStr = ''
for(var i = 1; i <= maxDay; i++) {
if (i == day) {
htmlStr += '<div class="animated today_box"><div class="circleProgress_wrapper"><div class="wrapper right"><div class="circleProgress rightcircle"></div></div><div class="wrapper left"><div class="circleProgress leftcircle"></div></div></div><span class="today">'+ i +'</span></div>'
} else {
......@@ -338,6 +342,7 @@
riliAnimated()
}
// 日历动画
function riliAnimated(){
$("#rili div").each(function (index, ele) {
setTimeout(function (){
......@@ -347,6 +352,7 @@
})
}
$("#fan-up").hide()
// 初始化分页
var pages = function(obj) {
var box = document.getElementById(obj.wrap);
var box2 = document.getElementById(obj.wrap2);
......@@ -381,7 +387,6 @@
var touchend = function(event) {
if (n == 8) {
localStorage.newPageIndex = maxPageIndex
}
//位移小于+-50的不翻页
if(moveY < -50) n++;
......@@ -488,17 +493,19 @@
var timer2 = setInterval(function(){
createDM();
},2000);
// 创建弹幕
function createDM(){
if (!TextContentList.length) return
var randomS=Math.floor(Math.random()*TextContentList.length);
barrageWall.upWall('', TextContentList[randomS].TextContent, '');
}
// 创建图表1
function creatEchart(Datas){
var option = {
legend: {
icon: "circle",
bottom: '20%',
left:'10%',
left:'2%',
itemWidth: 7,
itemHeight: 7,
itemGap: 40,
......@@ -516,6 +523,11 @@
}
]
},
grid: {
left: '10%',
right: '0%',
top: 60,
},
xAxis: [{
type :'value',
axisTick: {
......@@ -786,12 +798,13 @@
};
myChart1.setOption(option);
}
// 创建图表2
function creatEchart2(Datas){
var option = {
legend: {
icon: "circle",
bottom: '20%',
left:'10%',
left:'2%',
itemWidth: 7,
itemHeight: 7,
itemGap: 40,
......@@ -809,6 +822,11 @@
}
]
},
grid: {
left: '10%',
right: '0%',
top: 60,
},
xAxis: [{
type :'value',
axisTick: {
......@@ -1079,6 +1097,7 @@
};
myChart2.setOption(option);
}
// 展示隐藏说明
function showTk(type){
if (type == 1 ) {
$('.tanchuang').show()
......@@ -1086,12 +1105,14 @@
$('.tanchuang').hide()
}
}
// 跳转规则页面
function goRule(){
window.location.href = 'rule.html';
}
// 跳转开红包页面
function goRed(){
let time1 = new Date(Date.parse(new Date()));
let time2 = new Date(Date.parse('2020-01-02 10:00:00'));
var time1 = new Date(Date.parse(new Date()));
var time2 = new Date(Date.parse('2020-01-02 10:00:00'));
if (time1 > time2) {
window.location.href = 'openRedPacket.html';
} else {
......
......@@ -208,21 +208,21 @@
<script type="text/javascript" src="../js/autosize.js"></script>
<script type="text/javascript" src="../js/leftTime.min.js"></script>
<script>
$.ajax({
type: "POST",
url: `${getApiUrl().urlPost}`,
contentType: "application/json",
data: getAjaxData("b2b_get_GetCustomerInfo", {}),
async: false,
success: function (res) {
if (res.resultCode === 1) {
// $.ajax({
// type: "POST",
// url: `${getApiUrl().urlPost}`,
// contentType: "application/json",
// data: getAjaxData("b2b_get_GetCustomerInfo", {}),
// async: false,
// success: function (res) {
// if (res.resultCode === 1) {
}
},
error: function (res) {
// }
// },
// error: function (res) {
}
});
// }
// });
</script>
</body>
......
var barrageWall={
container:null,//容器选择器
barrageLen:null,//弹幕的条数
lastElem:0,//弹幕出现的位置
overlapElem:-1,//如果大于0则表示每条弹幕轨道上都有弹幕未全部出现,需要重叠定位在弹幕轨道上
barrage:[],//弹幕墙
barrageOffset:[],//弹幕墙上最后一条弹幕的偏移量
init:function(option){
if(option.container===undefined){
console.error("必须指定 container 属性,container为弹幕容器的选择器");
return false;
}
if(option.barrageLen===undefined){
console.error("必须指定 barrageLen 属性,barrageLen为弹幕轨道的数");
return false;
}
this.container=option.container;
this.barrageLen=option.barrageLen;
for(var i=0;i<this.barrageLen;i++){//建立弹幕墙,此处的循环次数为当前页面运行的弹幕行数
this.barrage[i]=new Array();
}
},
upWall:function(img,user,txt){//弹幕上墙
if(!this.barrageLen&&this.container){
console.error("未检测到container和barrageLen属性,请先初始化弹幕墙并指定container和barrageLen属性");
return false;
}
this.positionWall();//从上至下找出每条弹幕轨道上最后一条弹幕移动的位置
var elem = $('<div></div>')//创建元素
.addClass('list')//添加样式
.css("top",this.lastElem*.3+"rem")//定位
.html(user)//添加内容
.appendTo(this.container);//追加在父元素后面
this.barrage[this.lastElem].push(elem);//追加在数组中
setTimeout(function(){//200ms防止元素动画不执行
elem.addClass("animate");
},200);
setTimeout(function(){//25s后动画执行完毕,从数组和页面中移除
for(var i=0;i<this.barrage.length;i++){
for(var x=0;x<this.barrage[i].length;x++){
if(this.barrage[i][x]===elem){
this.barrage[i].splice(x,1);
break;
}
}
}
elem.remove();
}.bind(this),25000);
},
positionWall: function () {
for(var i=0;i<=this.barrage.length;i++){//从上至下找出每条弹幕轨道上最后一条弹幕移动的位置
if(i===this.barrage.length){//每条弹幕轨道上都有弹幕未全部出现的情况
this.minOffset();//弹幕墙上所有的位置都有弹幕且都未出现完毕时,找出他们当中完全最先的那个
}else{//若有某个最后一条弹幕已经全部出现
if(this.afterOffset(i))break;//找到弹幕出现的位置,找到则退出循环
}
}
},
minOffset: function (){//找出所有弹幕轨道上最后一个弹幕中最先出现的那个(偏移量减去自身宽度)
var minOffset=0;
for(var x=0;x<this.barrage.length;x++){
var elem=this.barrage[x][this.barrage[x].length-1];//获取当前弹幕轨道上最后一条弹幕
var aboveWidth=elem.width();//获取它的宽度
var matrix=elem.css('transform');//获取它的矩阵值
this.barrageOffset[x]=matrix==="none"?-aboveWidth:-parseInt(matrix.split(",")[4])-aboveWidth;//matrix为none则弹幕translateX为0
minOffset=this.barrageOffset[x] > this.barrageOffset[minOffset]?x:minOffset;//找到最先出现的弹幕
}
this.lastElem=minOffset;
},
afterOffset: function (i){//找到弹幕出现的位置
if(this.barrage[i].length===0){//为true则表示当前弹幕轨道没有弹幕,则当前弹幕放在改轨道上
this.lastElem=i;
this.overlapElem=-1;
return true;
}else{//当前弹幕轨道上有弹幕
var elem=this.barrage[i][this.barrage[i].length-1];//获取当前弹幕轨道上最后一条弹幕
var aboveWidth=elem.width();//获取它的宽度
var matrix=elem.css('transform');//获取它的矩阵值
if(matrix!=="none"){
var aboveTransform=parseInt(matrix.split(",")[4]);//取出最后一条弹幕的矩阵值中X轴的偏移量,即translateX
if(-aboveTransform-aboveWidth>100){//50为间隔 为true则表示当前弹幕轨道上最后一条弹幕已经全部出现,则当前弹幕放在改轨道上
this.lastElem=i;
this.overlapElem=-1;
return true;
}
}
}
return false;
}
}
\ No newline at end of file
......@@ -2,8 +2,8 @@ let locationName = window.location.hostname;
function getApiUrl() {
let url = {
urlPost: "https://reborn.oytour.com/api/common/post",
// urlPost: locationName.indexOf('oytour') !== -1 ? "https://reborn.oytour.com/api/common/post" : "http://192.168.2.65:8025/api/common/post",
// urlPost: "https://reborn.oytour.com/api/common/post",
urlPost: locationName.indexOf('oytour') !== -1 ? "https://reborn.oytour.com/api/common/post" : "http://192.168.2.67:8025/api/common/post",
//urlJava: locationName.indexOf('oytour') !== -1 ? "https://efficient.oytour.com/" : "http://192.168.2.215:9000/"
urlJava: "https://efficient.oytour.com/"
}
......
/**
* Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
* @author mrdoob / http://mrdoob.com/
*/
THREE.CSS3DObject = function ( element ) {
THREE.Object3D.call( this );
this.element = element;
this.element.style.position = 'absolute';
this.addEventListener( 'removed', function () {
if ( this.element.parentNode !== null ) {
this.element.parentNode.removeChild( this.element );
}
} );
};
THREE.CSS3DObject.prototype = Object.create( THREE.Object3D.prototype );
THREE.CSS3DObject.prototype.constructor = THREE.CSS3DObject;
THREE.CSS3DSprite = function ( element ) {
THREE.CSS3DObject.call( this, element );
};
THREE.CSS3DSprite.prototype = Object.create( THREE.CSS3DObject.prototype );
THREE.CSS3DSprite.prototype.constructor = THREE.CSS3DSprite;
//
THREE.CSS3DRenderer = function () {
console.log( 'THREE.CSS3DRenderer', THREE.REVISION );
var _width, _height;
var _widthHalf, _heightHalf;
var matrix = new THREE.Matrix4();
var cache = {
camera: { fov: 0, style: '' },
objects: {}
};
var domElement = document.createElement( 'div' );
domElement.style.overflow = 'hidden';
this.domElement = domElement;
var cameraElement = document.createElement( 'div' );
cameraElement.style.WebkitTransformStyle = 'preserve-3d';
cameraElement.style.MozTransformStyle = 'preserve-3d';
cameraElement.style.transformStyle = 'preserve-3d';
domElement.appendChild( cameraElement );
var isIE = /Trident/i.test( navigator.userAgent );
this.setClearColor = function () {};
this.getSize = function () {
return {
width: _width,
height: _height
};
};
this.setSize = function ( width, height ) {
_width = width;
_height = height;
_widthHalf = _width / 2;
_heightHalf = _height / 2;
domElement.style.width = width + 'px';
domElement.style.height = height + 'px';
cameraElement.style.width = width + 'px';
cameraElement.style.height = height + 'px';
};
function epsilon( value ) {
return Math.abs( value ) < 1e-10 ? 0 : value;
}
function getCameraCSSMatrix( matrix ) {
var elements = matrix.elements;
return 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( - elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( elements[ 6 ] ) + ',' +
epsilon( elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( - elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( - elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
}
function getObjectCSSMatrix( matrix, cameraCSSMatrix ) {
var elements = matrix.elements;
var matrix3d = 'matrix3d(' +
epsilon( elements[ 0 ] ) + ',' +
epsilon( elements[ 1 ] ) + ',' +
epsilon( elements[ 2 ] ) + ',' +
epsilon( elements[ 3 ] ) + ',' +
epsilon( - elements[ 4 ] ) + ',' +
epsilon( - elements[ 5 ] ) + ',' +
epsilon( - elements[ 6 ] ) + ',' +
epsilon( - elements[ 7 ] ) + ',' +
epsilon( elements[ 8 ] ) + ',' +
epsilon( elements[ 9 ] ) + ',' +
epsilon( elements[ 10 ] ) + ',' +
epsilon( elements[ 11 ] ) + ',' +
epsilon( elements[ 12 ] ) + ',' +
epsilon( elements[ 13 ] ) + ',' +
epsilon( elements[ 14 ] ) + ',' +
epsilon( elements[ 15 ] ) +
')';
if ( isIE ) {
return 'translate(-50%,-50%)' +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)' +
cameraCSSMatrix +
matrix3d;
}
return 'translate(-50%,-50%)' + matrix3d;
}
function renderObject( object, camera, cameraCSSMatrix ) {
if ( object instanceof THREE.CSS3DObject ) {
var style;
if ( object instanceof THREE.CSS3DSprite ) {
// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
matrix.copy( camera.matrixWorldInverse );
matrix.transpose();
matrix.copyPosition( object.matrixWorld );
matrix.scale( object.scale );
matrix.elements[ 3 ] = 0;
matrix.elements[ 7 ] = 0;
matrix.elements[ 11 ] = 0;
matrix.elements[ 15 ] = 1;
style = getObjectCSSMatrix( matrix, cameraCSSMatrix );
} else {
style = getObjectCSSMatrix( object.matrixWorld, cameraCSSMatrix );
}
var element = object.element;
var cachedStyle = cache.objects[ object.id ] && cache.objects[ object.id ].style;
if ( cachedStyle === undefined || cachedStyle !== style ) {
element.style.WebkitTransform = style;
element.style.MozTransform = style;
element.style.transform = style;
cache.objects[ object.id ] = { style: style };
if ( isIE ) {
cache.objects[ object.id ].distanceToCameraSquared = getDistanceToSquared( camera, object );
}
}
if ( element.parentNode !== cameraElement ) {
cameraElement.appendChild( element );
}
}
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
renderObject( object.children[ i ], camera, cameraCSSMatrix );
}
}
var getDistanceToSquared = function () {
var a = new THREE.Vector3();
var b = new THREE.Vector3();
return function ( object1, object2 ) {
a.setFromMatrixPosition( object1.matrixWorld );
b.setFromMatrixPosition( object2.matrixWorld );
return a.distanceToSquared( b );
};
}();
function zOrder( scene ) {
var order = Object.keys( cache.objects ).sort( function ( a, b ) {
return cache.objects[ a ].distanceToCameraSquared - cache.objects[ b ].distanceToCameraSquared;
} );
var zMax = order.length;
scene.traverse( function ( object ) {
var index = order.indexOf( object.id + '' );
if ( index !== - 1 ) {
object.element.style.zIndex = zMax - index;
}
} );
}
this.render = function ( scene, camera ) {
var fov = camera.projectionMatrix.elements[ 5 ] * _heightHalf;
if ( cache.camera.fov !== fov ) {
domElement.style.WebkitPerspective = fov + 'px';
domElement.style.MozPerspective = fov + 'px';
domElement.style.perspective = fov + 'px';
cache.camera.fov = fov;
}
scene.updateMatrixWorld();
if ( camera.parent === null ) camera.updateMatrixWorld();
var cameraCSSMatrix = 'translateZ(' + fov + 'px)' +
getCameraCSSMatrix( camera.matrixWorldInverse );
var style = cameraCSSMatrix +
'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';
if ( cache.camera.style !== style && ! isIE ) {
cameraElement.style.WebkitTransform = style;
cameraElement.style.MozTransform = style;
cameraElement.style.transform = style;
cache.camera.style = style;
}
renderObject( scene, camera, cameraCSSMatrix );
if ( isIE ) {
// IE10 and 11 does not support 'preserve-3d'.
// Thus, z-order in 3D will not work.
// We have to calc z-order manually and set CSS z-index for IE.
// FYI: z-index can't handle object intersection
zOrder( scene );
}
};
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// tween.js - http://github.com/sole/tween.js
'use strict';var TWEEN=TWEEN||function(){var a=[];return{REVISION:"7",getAll:function(){return a},removeAll:function(){a=[]},add:function(c){a.push(c)},remove:function(c){c=a.indexOf(c);-1!==c&&a.splice(c,1)},update:function(c){if(0===a.length)return!1;for(var b=0,d=a.length,c=void 0!==c?c:Date.now();b<d;)a[b].update(c)?b++:(a.splice(b,1),d--);return!0}}}();
TWEEN.Tween=function(a){var c={},b={},d=1E3,e=0,f=null,h=TWEEN.Easing.Linear.None,r=TWEEN.Interpolation.Linear,k=[],l=null,m=!1,n=null,p=null;this.to=function(a,c){null!==c&&(d=c);b=a;return this};this.start=function(d){TWEEN.add(this);m=!1;f=void 0!==d?d:Date.now();f+=e;for(var g in b)if(null!==a[g]){if(b[g]instanceof Array){if(0===b[g].length)continue;b[g]=[a[g]].concat(b[g])}c[g]=a[g]}return this};this.stop=function(){TWEEN.remove(this);return this};this.delay=function(a){e=a;return this};this.easing=
function(a){h=a;return this};this.interpolation=function(a){r=a;return this};this.chain=function(){k=arguments;return this};this.onStart=function(a){l=a;return this};this.onUpdate=function(a){n=a;return this};this.onComplete=function(a){p=a;return this};this.update=function(e){if(e<f)return!0;!1===m&&(null!==l&&l.call(a),m=!0);var g=(e-f)/d,g=1<g?1:g,i=h(g),j;for(j in c){var s=c[j],q=b[j];a[j]=q instanceof Array?r(q,i):s+(q-s)*i}null!==n&&n.call(a,i);if(1==g){null!==p&&p.call(a);g=0;for(i=k.length;g<
i;g++)k[g].start(e);return!1}return!0}};
TWEEN.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return 1>(a*=2)?0.5*a*a:-0.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*a:0.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return 1>(a*=2)?0.5*a*a*a*a:-0.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*
a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*a*a*a:0.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return 0.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:1>(a*=2)?0.5*Math.pow(1024,a-1):0.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-
Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return 1>(a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return-(b*Math.pow(2,10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4))},Out:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return b*Math.pow(2,-10*a)*Math.sin((a-c)*
2*Math.PI/0.4)+1},InOut:function(a){var c,b=0.1;if(0===a)return 0;if(1===a)return 1;!b||1>b?(b=1,c=0.1):c=0.4*Math.asin(1/b)/(2*Math.PI);return 1>(a*=2)?-0.5*b*Math.pow(2,10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4):0.5*b*Math.pow(2,-10*(a-=1))*Math.sin((a-c)*2*Math.PI/0.4)+1}},Back:{In:function(a){return a*a*(2.70158*a-1.70158)},Out:function(a){return--a*a*(2.70158*a+1.70158)+1},InOut:function(a){return 1>(a*=2)?0.5*a*a*(3.5949095*a-2.5949095):0.5*((a-=2)*a*(3.5949095*a+2.5949095)+2)}},Bounce:{In:function(a){return 1-
TWEEN.Easing.Bounce.Out(1-a)},Out:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375},InOut:function(a){return 0.5>a?0.5*TWEEN.Easing.Bounce.In(2*a):0.5*TWEEN.Easing.Bounce.Out(2*a-1)+0.5}}};
TWEEN.Interpolation={Linear:function(a,c){var b=a.length-1,d=b*c,e=Math.floor(d),f=TWEEN.Interpolation.Utils.Linear;return 0>c?f(a[0],a[1],d):1<c?f(a[b],a[b-1],b-d):f(a[e],a[e+1>b?b:e+1],d-e)},Bezier:function(a,c){var b=0,d=a.length-1,e=Math.pow,f=TWEEN.Interpolation.Utils.Bernstein,h;for(h=0;h<=d;h++)b+=e(1-c,d-h)*e(c,h)*a[h]*f(d,h);return b},CatmullRom:function(a,c){var b=a.length-1,d=b*c,e=Math.floor(d),f=TWEEN.Interpolation.Utils.CatmullRom;return a[0]===a[b]?(0>c&&(e=Math.floor(d=b*(1+c))),f(a[(e-
1+b)%b],a[e],a[(e+1)%b],a[(e+2)%b],d-e)):0>c?a[0]-(f(a[0],a[0],a[1],a[1],-d)-a[0]):1<c?a[b]-(f(a[b],a[b],a[b-1],a[b-1],d-b)-a[b]):f(a[e?e-1:0],a[e],a[b<e+1?b:e+1],a[b<e+2?b:e+2],d-e)},Utils:{Linear:function(a,c,b){return(c-a)*b+a},Bernstein:function(a,c){var b=TWEEN.Interpolation.Utils.Factorial;return b(a)/b(c)/b(a-c)},Factorial:function(){var a=[1];return function(c){var b=1,d;if(a[c])return a[c];for(d=c;1<d;d--)b*=d;return a[c]=b}}(),CatmullRom:function(a,c,b,d,e){var a=0.5*(b-a),d=0.5*(d-c),f=
e*e;return(2*c-2*b+a+d)*e*f+(-3*c+3*b-2*a-d)*f+a*e+c}}};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment