亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? silverna-animations.js

?? 《JavaScript王者歸來》examples.rar
?? JS
字號:
//這是一個for Silverna的動畫庫,它定義了動畫類的Behaviors
//Animation繼承了Behavior的原型,但是它不需要knobs
core.web.widgets.adorners.animations ={
	Animation : null,
	MoveAnimation : null,
	SlideAnimation : null,
	FadeAnimation : null
}

with(core.web.widgets.adorners.animations)
{
	Animation = function()
	{
		core.web.widgets.adorners.behaviors.Behavior.call(this);
		this.provider = null;
		this.paused = false;
		this._frames = 0;  //_frames表示楨數(shù), 0表示未開始
		this._args = {};
	}
	Animation.prototype = new core.web.widgets.adorners.behaviors.Behavior();
	//freq表示頻率,也就是多少時間刷新一楨,默認(rèn)為100,即0.01秒刷新一楨
	Animation.prototype.freq = "100";
	//為動畫設(shè)置運算函數(shù),運算函數(shù)用來改變target的某些屬性
	Animation.prototype.setProvider = function(provider)
	{
		var $pointer = this;
		this.provider = function(args){
			var ret = $pointer._frames && !$pointer.paused;
			if(ret){
				ret = provider.call($pointer,args);
				if(!ret)
					$pointer.stop();
				else{
					$pointer._frames++;
					$pointer.dispatchEvent("frameplay", args);
				}
			}
			return ret;
		}
	}
	Animation.prototype.stop = function()
	{
		var $pointer = this;
		$pointer._frames = 0;
		$pointer.dispatchEvent("stop", this._args);
	}
	//actor是一個閉包,用來影響target的實際屬性, args是實際的控制參數(shù)
	Animation.prototype.setActor = function(actor, args)
	{	
		this.actor = actor;
		this._args = args;
	}
	//設(shè)置Animation的頻率
	Animation.prototype.setFrequency = function(freq)
	{
		this.freq = freq;
	}
	Animation.prototype.init = function(provider, actor, args, freq)
	{
		this.setProvider(provider);
		this.setActor(actor, args);
		this.setFrequency(freq);
	}
	Animation.prototype.play = function(actor, args)
	{
		if(this._frames) return;
		this.reset();
		this.paused = false;
		this._frames = 1;
		if(actor != null && args != null) 
			this.setActor(actor, args);
		var delay = Math.floor(1000 / this.freq);
		this._args.target = this.panel.el;
		this.actor.listen(this.provider, delay, this._args);
		this.dispatchEvent("play",this._args);
	}
	Animation.prototype.pause = function()
	{
		this.paused = true;
		this.dispatchEvent("pause", this._args);
	}
	Animation.prototype.resume = function()
	{
		if(!this._frames) return false;
		var delay = Math.floor(1000 / this.freq);
		if(this.paused) 
		{	
			this._args.target = this.panel.el;
			this.actor.listen(this.provider, delay, this._args);
			this.dispatchEvent("resume",this._args);
			this.paused = false;
		}
	}
	Animation.prototype.reset = function()
	{
		if(this._frames) this.stop();
		this.dispatchEvent("reset", this._args);
	}

	//這是一個和位置有關(guān)的抽象類,它包含MoveAnimation和SildeAnimation兩個子類
	PositionAnimation = function()
	{
		Animation.call(this);
		
		var $pointer = this;
		this.coordinateType = "X";  //坐標(biāo)默認(rèn)以X軸為參照,可選值X、Y、XY

		this.setProvider(function(evt){
			if($pointer.coordinateType == "X"){
				var _from = $pointer._from[0];
				var _to = $pointer._to[0];
				var _r = false;
				if(_from > _to){
					_r = true;
					_from = $pointer._to[0];
					_to = $pointer._from[0];
				}
				evt.y = Math.round($pointer.path(evt.x,evt.y));
				_r ? evt.x -- : evt.x ++;
				return evt.x >= _from && evt.x < _to;
			}
			else if ($pointer.coordinateType == "Y"){
				var _from = $pointer._from[1];
				var _to = $pointer._to[1];
				var _r = false;
				if(_from > _to){
					_r = true;
					_from = $pointer._to[1];
					_to = $pointer._from[1];
				}
				evt.x = Math.round($pointer.path(evt.y,evt.x));
				_r ? evt.y-- : evt.y++;
				return evt.y >= _from && evt.y < _to;
			}
			else{
				var _fromX = $pointer._from[0];
				var _toX = $pointer._to[0];
				var _fromY = $pointer._from[1];
				var _toY = $pointer._to[1];
				if(_fromX > _toX)
					_fromX = $pointer._to[0], _toX = $pointer._from[0];
				if(_fromY > _toY)
					_fromY = $pointer._to[1], _toY = $pointer._from[1];
				$pointer.path(evt);
				return evt.x >= _fromX && evt.x < _toX &&
					evt.y >= _fromY && evt.y < _toY; 
			}
		});
	}
	PositionAnimation.prototype = new Animation();
	//setPath用來設(shè)置PositionAnimation的軌跡
	//path是一個閉包,用來描述軌跡
	//一般情況下它是一個2D的曲線模型
	//根據(jù)不同的規(guī)則x、y或者xy作為它的參數(shù)進行調(diào)用,調(diào)用的結(jié)果影響到Privider
	PositionAnimation.prototype.setPath = function(path)
	{
		this.path = path;
	}

	//setRange用來設(shè)置PositionAnimation的坐標(biāo)范圍,例如[0,0],[100,100],表示一個左上0,0,右下[100,100]的區(qū)域
	//允許第一個參數(shù)的坐標(biāo)值大于第二個參數(shù),此時物件將反向運動
	PositionAnimation.prototype.setRange = function(_from, _to)
	{
		if(_from != null) this._from = _from;
		if(_to != null) this._to = _to;
	}
	PositionAnimation.prototype.reverse = function()
	{
		var temp = this._from;
		this._from = this._to;
		this._to = temp;
	}

	//這是一個用來實現(xiàn)移動效果的Animation類型,它能夠影響的屬性是panel的位置
	MoveAnimation = function()
	{
		this._from = [0,0];
		this._to = [clientRect().width, clientRect().height];
		this.path = function(x, y){return y};
		
		PositionAnimation.call(this);
		this.reset = function(){
			this.setActor(function(evt){
				$html(evt.target).setAbsPosition(evt.x, evt.y)
			},{x:this._from[0], y:this._from[1]});
			if(this._frames) this.stop();
			this.dispatchEvent("reset", this._args);
		}
	}
	MoveAnimation.prototype = new PositionAnimation();

	//這是一個用來實現(xiàn)Silde效果的Animation類型,它能夠影響的屬性是panel的大小
	SlideAnimation = function()
	{
		this._from = [0,0];
		this._to = [clientRect().width, clientRect().height];
		this.path = function(x, y){return y};

		PositionAnimation.call(this);
		this.reset = function(){
			this.setActor(function(evt){
				$html(evt.target).resize(evt.x, evt.y)
			},{x:this._from[0], y:this._from[1]});
			if(this._frames) this.stop();
			this.dispatchEvent("reset", this._args);
		}
		this.setPanel = function(panel)
		{
			this.panel = panel;
			var _s = panel.getSize();
			this._from = [_s.width, _s.height];
		}
	}
	SlideAnimation.prototype = new PositionAnimation();
	
	//這是一個和透明度有關(guān)的Animation類型,它能夠影響的屬性是opacity
	FadeAnimation = function()
	{
		Animation.call(this);
		var $pointer = this;
		this._from = 0;
		this._to = 100;
		this.setProvider(function(evt){
			var _from = $pointer._from;
			var _to = $pointer._to;
			var _r = 1;
			if(_from > _to){
				_r = -1;
				_from = $pointer._to;
				_to = $pointer._from;
			}
			evt.time =  _r * $pointer._frames * $pointer.speed;
			var ret = $pointer.painter(evt);
			return ret >= _from && ret < _to;
		});

		this.painter = function(evt)
		{
			evt.opacity = Math.round($pointer._from + evt.time);
			return evt.opacity;
		}

		this.reset = function(){
			this.setActor(function(evt){
				$html(evt.target).el.style.filter = "alpha(opacity="+evt.opacity+")";
				$html(evt.target).el.style.opacity = evt.opacity;
			},{opacity:$pointer._from});
			if(this._frames) this.stop();
			this.dispatchEvent("reset", this._args);
		}
	}
	FadeAnimation.prototype = new Animation();

	//同樣是設(shè)置范圍,這個類型的_from和_to是表示透明度的數(shù)值
	FadeAnimation.prototype.setRange = function(_from, _to)
	{
		if(_from != null) this._from = _from;
		if(_to != null) this._to = _to;
	}

	//Painter是一個閉包,它是一個參量關(guān)于時間的函數(shù)
	FadeAnimation.prototype.setPainter = function(painter)
	{
		this.path = painter;
	}

	FadeAnimation.prototype.speed = 1;
	FadeAnimation.prototype.fadeIn = function()
	{
	    this.setRange(0,100);
		this.play();
	}
	FadeAnimation.prototype.fadeOut = function()
	{
		this.setRange(100,0);
		this.play();
	}
	//閃動,freq,每秒的頻率
	FadeAnimation.prototype.shine = function(freq)
	{
		this.speed = this.speed || freq * 2;
		this.onstop = function(){
			this.reverse();
			this.play();
		}
		this.play();
	}
	FadeAnimation.prototype.reverse = function()
	{
		var temp = this._from;
		this._from = this._to;
		this._to = temp;
	}
	FadeAnimation.prototype.abort = function()
	{
		this.onstop = null;
		this.reset();
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一卡二卡三卡四卡| 欧美一区二区高清| 日本一区中文字幕| 国产福利不卡视频| 亚洲精品免费在线播放| 欧美白人最猛性xxxxx69交| 91麻豆免费看片| 国产一区二区三区高清播放| 夜色激情一区二区| www国产亚洲精品久久麻豆| 欧美色电影在线| 99视频热这里只有精品免费| 久久aⅴ国产欧美74aaa| 一区二区三区鲁丝不卡| 日本一区二区不卡视频| 日韩精品专区在线影院观看| 欧美性感一类影片在线播放| 成人av网址在线观看| 美女一区二区视频| 午夜不卡av在线| 亚洲美女屁股眼交| 国产精品麻豆久久久| 精品99999| 日韩欧美国产一区二区三区| 欧美三级在线看| 91在线视频18| 成人黄动漫网站免费app| 国内精品伊人久久久久av影院| 午夜精品123| 亚洲国产精品久久人人爱| 亚洲欧美自拍偷拍| 国产精品色婷婷久久58| 激情成人午夜视频| 奇米色一区二区| 三级在线观看一区二区| 亚洲电影中文字幕在线观看| 亚洲少妇中出一区| 国产精品国产精品国产专区不蜜| 国产三级精品视频| 国产亚洲一本大道中文在线| 精品国产精品一区二区夜夜嗨| 6080午夜不卡| 欧美一区二区大片| 欧美一区二区视频在线观看2022| 欧美精品自拍偷拍| 欧美妇女性影城| 日韩一区国产二区欧美三区| 欧美巨大另类极品videosbest| 精品视频123区在线观看| 欧美视频中文一区二区三区在线观看| 在线视频国内自拍亚洲视频| 欧美色图一区二区三区| 欧美美女一区二区| 日韩欧美国产午夜精品| 精品国产91洋老外米糕| 久久久久国产精品免费免费搜索| 久久久久久一级片| 国产人成亚洲第一网站在线播放| 久久精品人人做| 中文字幕一区二区三区乱码在线| 国产精品国产三级国产aⅴ入口| 亚洲女同ⅹxx女同tv| 亚洲一级二级三级| 美女国产一区二区| 大桥未久av一区二区三区中文| 成人av在线资源网| 色琪琪一区二区三区亚洲区| 欧美亚一区二区| 日韩精品一区二区三区在线观看| 久久影音资源网| 日韩毛片精品高清免费| 五月综合激情网| 激情文学综合丁香| 成人av在线影院| 欧美人伦禁忌dvd放荡欲情| 欧美成人一区二区三区片免费| 国产日韩欧美一区二区三区综合| 亚洲视频免费在线观看| 秋霞国产午夜精品免费视频| 国产精品夜夜嗨| 色婷婷国产精品综合在线观看| 91精品国产91综合久久蜜臀| 久久奇米777| 亚洲一区二区三区中文字幕在线| 奇米影视7777精品一区二区| jizz一区二区| 欧美一级二级三级乱码| 国产精品成人免费 | 国产精品视频在线看| 一区二区三区国产精品| 免费高清在线一区| 色综合网站在线| 欧美成人精品3d动漫h| 亚洲男同1069视频| 欧美日韩dvd在线观看| 精品福利一二区| 一区二区三区四区视频精品免费| 久久99精品国产| 色婷婷久久久综合中文字幕| 精品免费视频一区二区| 亚洲六月丁香色婷婷综合久久| 精品在线视频一区| 欧美在线观看视频一区二区三区| 国产日韩欧美不卡| 日本三级亚洲精品| 在线观看成人免费视频| 欧美国产精品v| 喷白浆一区二区| 日本韩国精品在线| 国产精品美女一区二区| 精品一区二区三区免费播放| 欧美日韩久久不卡| 亚洲欧美日韩电影| 成人午夜视频在线| 久久久久久久综合狠狠综合| 午夜精品免费在线观看| 色噜噜狠狠成人网p站| 国产精品美女久久久久久久久| 国产在线日韩欧美| 欧美一级夜夜爽| 石原莉奈一区二区三区在线观看| 在线免费不卡电影| 中文字幕在线不卡国产视频| 国产乱人伦精品一区二区在线观看| 在线播放中文字幕一区| 午夜精品福利一区二区三区av | 日本亚洲最大的色成网站www| 91美女在线观看| 中文字幕视频一区| 成人精品鲁一区一区二区| 久久久久久电影| 精品无人区卡一卡二卡三乱码免费卡| 欧美精品三级在线观看| 亚瑟在线精品视频| 欧美三区免费完整视频在线观看| 亚洲色大成网站www久久九九| 成人av网站大全| 国产精品美女久久久久aⅴ| 国产成人综合网| 中文一区在线播放| 岛国精品在线观看| 亚洲欧洲日本在线| 91香蕉视频mp4| 亚洲精品中文字幕乱码三区| 色噜噜久久综合| 亚洲综合免费观看高清完整版| 在线观看亚洲专区| 婷婷国产v国产偷v亚洲高清| 在线不卡一区二区| 蜜臂av日日欢夜夜爽一区| 精品久久久久久无| 国产黄色91视频| 国产精品美女久久久久久久久| 91亚洲永久精品| 亚洲综合免费观看高清完整版在线 | 天天av天天翘天天综合网| 777欧美精品| 日韩成人午夜精品| 久久综合久色欧美综合狠狠| 国产老肥熟一区二区三区| 国产精品网站在线播放| 91蜜桃网址入口| 日韩国产一二三区| 久久众筹精品私拍模特| aaa亚洲精品| 五月天亚洲婷婷| 久久精品视频一区| 91福利区一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 国产午夜精品福利| 色婷婷亚洲精品| 美腿丝袜亚洲一区| 国产精品国产自产拍在线| 色噜噜狠狠成人网p站| 日本在线不卡视频| 国产精品乱人伦| 欧美男男青年gay1069videost| 久久不见久久见中文字幕免费| 国产精品久久久久永久免费观看| 色国产综合视频| 激情久久久久久久久久久久久久久久| 亚洲国产精品精华液ab| 欧美日韩日日摸| 国产精品69久久久久水密桃| 一区二区激情小说| www国产精品av| 欧美羞羞免费网站| 成人在线视频一区二区| 午夜精品一区二区三区电影天堂| 久久色.com| 欧美视频一区二区在线观看| 国内精品免费**视频| 中文字幕在线观看不卡视频| 在线成人午夜影院| 成人aaaa免费全部观看| 麻豆国产一区二区| 一区二区免费看| 国产精品国产三级国产普通话蜜臀 | 国产欧美视频一区二区| 欧美日韩免费视频|