====== About the script ====== * Purpose : This script will give you a beautiful page transition animation and an optional horizontal & vertical page loop * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 3.1 * Link: https://plus.google.com/115366157037831519359/posts/EAUStJNGa5o * Video : https://plus.google.com/115366157037831519359/posts/9eUTw8cCCpi * Download avialable! (Check repository) ====== Changelog ====== * Version 1.0 (30/4/2014): initial release in wiki * Version 2.0 (18/5/2014): Reworked parsing structure, added vertical support, improved smoothness * Version 2.1 (20/6/2014): added rotation check * Version 3.1 (21/7/2014): standalone, reworked structure ====== How to use the script ====== * Set the script to the positionchanged event of your container * enable infinte scrolling if you want a page loop, disable it if you don't want to loop through pages * in this container: create a shortcut to the script * one click on the shortcut will enable the animation, clicking again will disable the animation. * BE SURE TO DISABLE THE ANIMATION BEFORE YOU EDIT, MOVE OR ADD ITEMS! ====== Issues and hints ====== * this will break any other script, which uses item or container tags, and will be broken by them * you can improve smoothness if you create on each page a panel and put all items in it. * don't use dual position, this will do weird stuff * make sure all of your items have exactly one of the following rotations: 0°,90°,180°,270° //please report all bugs in the g+ community// ====== Script ====== var e=LL.getEvent(); var d=e.getContainer(); var cont= JSON.parse(d.getTag()||"null"); var items=d.getItems(); var dwidth=d.getWidth(); var dheight=d.getHeight(); if(e.getSource()!="C_POSITION_CHANGED") { if(cont==null) cont=new Object(); var box=d.getBoundingBox(); cont.minx=box.getLeft(); cont.maxx=box.getRight(); cont.miny=box.getTop(); cont.maxy=box.getBottom(); var minpagex=Math.floor( cont.minx/dwidth); var minpagey=Math.floor( cont.miny/dheight); if(cont.setup!=true) { cont.pages=[]; for(x=0;x0.005 && percentx<99.995) ||(percenty>0.005 && percenty<99.995)) && dposx>cont.minx-dwidth && dposy>cont.miny-dheight) { var scrollLimit=d.getProperties() .getBoolean("noScrollLimit"); if(dposx>cont.maxx-dwidth&&scrollLimit){ d.setPosition(cont.minx-dwidth,dposy,1,false); } else if(dposy>cont.maxy-dheight&&scrollLimit) d.setPosition(dposx,cont.miny-dheight,1,false); if(dposx=0.5||percenty>=0.5)?1:data.rot?1-percenty*2:1-percentx*2)*data.sx, ((data.pin=="Y"||percentx>=0.5||percenty>=0.5)?1:1-(data.rot?percentx:percenty)*2)*data.sy); item.setPosition(data.pin=="X"?data.posx:dposx+((data.posx%dwidth+dwidth)%dwidth)+percentx*(dwidth- ((data.posx%dwidth+dwidth)%dwidth)*2),data.pin=="Y"?data.posy:dposy+((data.posy%dheight+dheight)%dheight)+percenty*(dheight- ((data.posy%dheight+dheight)%dheight)*2)); item.setVisibility((percentx<0.5||data.pin=="X")&&(percenty<0.5||data.pin=="Y")); } } var items=(cont.pages[currentx+1-minpagex]||[])[(cont.statey?maxpagey:currenty)-minpagey]; if(items!=null) { for(z=0;z=0.5?1:data.rot?1-percenty*2:percentx>0.005?percentx*2-1:1)*data.sx,(data.pin=="Y"||percentx<0.5||percenty>=0.5?1:data.rot?(percentx>0.005?percentx*2-1:1):1-percenty*2)*data.sy); item.setPosition(data.pin=="X"?data.posx:dposx+dwidth/2*(2-percentx*2)+ ((data.posx%dwidth+dwidth)%dwidth)*(percentx*2-1),data.pin=="Y"?data.posy:dposy+((data.posy%dheight+dheight)%dheight)+percenty*(dheight- ((data.posy%dheight+dheight)%dheight)*2)); item.setVisibility((percentx>=0.5||data.pin=="X")&&(percenty<0.5||data.pin=="Y")); } } } var items=(cont.pages[(cont.statex?maxpagex:currentx)-minpagex]||[])[currenty+1-minpagey]; if(items!=null) { for(z=0;z=0.5||percenty<0.5?1:data.rot?(percenty>0.005?percenty*2-1:1):1-percentx*2)*data.sx,(data.pin=="Y"|| percentx>=0.5||percenty<0.5?1:data.rot?1-percentx*2:percenty>0.005?percenty*2-1:1)*data.sy); item.setPosition(data.pin=="X"?data.posx:dposx+((data.posx%dwidth+dwidth)%dwidth)+percentx*(dwidth- ((data.posx%dwidth+dwidth)%dwidth)*2),data.pin=="Y"?data.posy:dposy+dheight/2*(2-percenty*2)+ ((data.posy%dheight+dheight)%dheight)*(percenty*2-1)); item.setVisibility((percentx<0.5||data.pin=="X")&&(percenty>=0.5||data.pin=="Y")); } } } } else { d.setPosition(dposx,dposy); d.setPosition(dposx