Add desktop summit page
[marble] / www / scripts / jd.gallery.transitions.js
1 /*
2     This file is part of JonDesign's SmoothGallery v2.1beta1.
3
4     JonDesign's SmoothGallery is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 3 of the License, or
7     (at your option) any later version.
8
9     JonDesign's SmoothGallery is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with JonDesign's SmoothGallery; if not, write to the Free Software
16     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18     Main Developer: Jonathan Schemoul (JonDesign: http://www.jondesign.net/)
19 */
20
21 gallery.Transitions.extend({
22         fadeslideleft: function(oldFx, newFx, oldPos, newPos){
23                 oldFx.options.transition = newFx.options.transition = Fx.Transitions.Cubic.easeOut;
24                 oldFx.options.duration = newFx.options.duration = 1500;
25                 if (newPos > oldPos)
26                 {
27                         newFx.start({
28                                 left: [this.galleryElement.offsetWidth, 0],
29                                 opacity: 1
30                         });
31                         oldFx.start({opacity: [1,0]});
32                 } else {
33                         newFx.start({opacity: [0,1]});
34                         oldFx.start({
35                                 left: [0, this.galleryElement.offsetWidth],
36                                 opacity: 0
37                         }).chain(function(fx){fx.set({left: 0});}.pass(oldFx));
38                 }
39         },
40         continuoushorizontal: function(oldFx, newFx, oldPos, newPos){
41                 oldFx.options.transition = newFx.options.transition = Fx.Transitions.linear;
42                 if (
43                         ((newPos > oldPos) || ((newPos==0) && (oldPos == (this.maxIter-1) ))) &&
44                         (!((newPos == (this.maxIter-1 )) && (oldPos == 0)))
45                 ) {
46                         oldFx.set({opacity: 1});
47                         oldFx.start({
48                                 left: [0, this.galleryElement.offsetWidth * -1]
49                         });
50                         newFx.set({opacity: 1, left: this.galleryElement.offsetWidth});
51                         newFx.start({
52                                 left: [this.galleryElement.offsetWidth, 0]
53                         });
54                 } else  {
55                         oldFx.set({opacity: 1});
56                         oldFx.start({
57                                 left: [0, this.galleryElement.offsetWidth]
58                         });
59                         newFx.set({opacity: 1, left: this.galleryElement.offsetWidth * -1});
60                         newFx.start({
61                                 left: [this.galleryElement.offsetWidth * -1, 0]
62                         });
63                 }
64         },
65         continuousvertical: function(oldFx, newFx, oldPos, newPos){
66                 oldFx.options.transition = newFx.options.transition = Fx.Transitions.linear;
67                 if (
68                         ((newPos > oldPos) || ((newPos==0) && (oldPos == (this.maxIter-1) ))) &&
69                         (!((newPos == (this.maxIter-1 )) && (oldPos == 0)))
70                 ) {
71                         oldFx.set({opacity: 1});
72                         oldFx.start({
73                                 top: [0, this.galleryElement.offsetHeight * -1]
74                         });
75                         newFx.set({opacity: 1, top: this.galleryElement.offsetHeight});
76                         newFx.start({
77                                 top: [this.galleryElement.offsetHeight, 0]
78                         });
79                 } else  {
80                         oldFx.set({opacity: 1});
81                         oldFx.start({
82                                 top: [0, this.galleryElement.offsetHeight]
83                         });
84                         newFx.set({opacity: 1, top: this.galleryElement.offsetHeight * -1});
85                         newFx.start({
86                                 top: [this.galleryElement.offsetHeight * -1, 0]
87                         });
88                 }
89         }
90 });