Page Turner Animation

21 views
Skip to first unread message

Tekcronic

unread,
Oct 28, 2008, 3:30:14 PM10/28/08
to MooTools Users
here is what I have it works in Fire Fox and chrome not in IE7.

<code>
window.addEvent('domready', function() {
/* things in here happen as soon the document is ready */

// set constants
var $pageheight = 189; // the single page height we're using
var $pagewidth = 146; // the single page width we're using
var $pageYpos = 0; // the current Y position of our background-image
(in both pages)
var $turnheight = 0; // The height of the page turning image.
var $turnwidth = 0; // The width of the page turning image.
var $bgposition = 0;

var leftpage = $('leftpage');
var rightpage = $('rightpage');
var flip = $('flip');
var lfx = leftpage.effects({duration: 10, transition:
Fx.Transitions.Quart.easeOut});
var rfx = rightpage.effects({duration: 10, transition:
Fx.Transitions.Quart.easeOut});
var flipfx = flip.effects({duration: 50, transition:
Fx.Transitions.Quart.easeOut});

//Start Leftpage
$('leftpage').addEvent('mousedown', function() {
$pageYpos = $pageYpos + $pageheight;
$bgposition = '0px '+$pageYpos+'px';
lfx.start({'background-position': $bgposition});
flipfx.start({'background-position': '0 0'});
});

$('leftpage').addEvent('click', function() {
$bgposition = '146px '+$pageYpos+'px';
flipfx.start({'background-position': '236px 0px'});
rfx.start({'background-position': $bgposition});
});
//End Leftpage
//Start Rightpage
$('rightpage').addEvent('mousedown', function() {
$pageYpos = $pageYpos + $pageheight;
$bgposition = '146px '+$pageYpos+'px';
rfx.start({'background-position': $bgposition});
flipfx.start({'background-position': '118px 0px'});
});

$('rightpage').addEvent('click', function() {
$bgposition = '0px '+$pageYpos+'px';
flipfx.start({'background-position': '236px 0px'});
lfx.start({'background-position': $bgposition});
});
//End Rightpage

});
</code>

keif

unread,
Oct 29, 2008, 9:49:35 AM10/29/08
to MooTools Users
PasteBins are excellent resources for dropping your code in, and I can
guess at the HTML, but do you have a demo page? HTML can you throw in?
Thanks!

-keif

Tekcronic

unread,
Oct 29, 2008, 1:56:46 PM10/29/08
to MooTools Users
Yea I have put it up at http://www.webwizardwill.com/pgturner/


I did get it to work in IE but I am reworking the code again for a
better animation. I will put up a FF3/IE7 working example on the
index page and from the code orignally posted, I will make a link on
only the index.

-tekcronic

keif

unread,
Oct 29, 2008, 3:40:33 PM10/29/08
to MooTools Users
I know it's just images, but I gotta say that's kind of cool.

On Oct 29, 1:56 pm, Tekcronic <tekcro...@gmail.com> wrote:
> Yea I have put it up athttp://www.webwizardwill.com/pgturner/
>
> I did get it to work in IE but I am reworking the code again for a
> better animation.  I will put up a FF3/IE7 working example on the
> index page and from the code orignally posted, I will make a link on
> only the index.
>
> -tekcronic
>

eeerne

unread,
Oct 30, 2008, 8:00:48 AM10/30/08
to MooTools Users
i just tested it in ie6. besides the png transparency it seems to work
pretty well. would be great to have that with mootools 1.2

eni

On Oct 29, 1:56 pm, Tekcronic <tekcro...@gmail.com> wrote:
> Yea I have put it up athttp://www.webwizardwill.com/pgturner/

Tekcronic

unread,
Oct 30, 2008, 8:56:15 AM10/30/08
to MooTools Users
Going to make 1.2 version after 1.11 version is completed. Until
Joomla updates the library to 1.2 I will build in 1.11 first.

davidck

unread,
Oct 31, 2008, 10:45:28 AM10/31/08
to MooTools Users
Tekcronic. This is actually a quite interesting approach and does
give an illusion of page flipping.
Good job


On Oct 28, 3:30 pm, Tekcronic <tekcro...@gmail.com> wrote:

Tekcronic

unread,
Nov 13, 2008, 3:58:32 AM11/13/08
to MooTools Users
I am changing the way the page moves in fact I am not "Moving the
page" anymore rather morphing using an img tag at 100% size of
containing div. It maintains correct angles an example will be post
for the new mootools page turner animation soon at the same location
that the original was posted.

VirtuosiMedia

unread,
Nov 13, 2008, 11:40:49 AM11/13/08
to MooTools Users
Just as an idea, what if you added some sort of drag event in addition
to the click so that it feels like you're actually dragging the page
to turn? It looks great, good job with the animation.

Tekcronic

unread,
Nov 14, 2008, 4:50:58 PM11/14/08
to MooTools Users
I was thinking about that and need to figure out how to rotate and
invert an image using JavaScript, heck I guess first I need to figure
out how to do it with just css, then adapt that to JavaScript/
mootools.

Tekcronic

unread,
Jul 24, 2009, 2:18:25 PM7/24/09
to mootool...@googlegroups.com

I have been moving things around so the project got moved around a bit. Will
repost its new location once it is back up.
--
View this message in context: http://n2.nabble.com/Page-Turner-Animation-tp1390148p3321800.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Chris Drackett

unread,
Jul 29, 2009, 12:41:45 PM7/29/09
to MooTools Users
Any chance a demo of this is up somewhere? I'd really like to check it
out :)

Thierry bela nanga

unread,
Jul 29, 2009, 1:42:18 PM7/29/09
to mootool...@googlegroups.com

Web Wizard Will

unread,
Aug 13, 2009, 4:46:58 PM8/13/09
to MooTools Users
I am sorry to all those who tried to view the demo and was
unsuccessful, I have undergone some major changes with my services
never the less I am still trying to get off the ground. Time is
valueable and I have none. Though I made this project for a client
and she has gone out of business and I would like to see her company
come back. So I am hoping to build this project back up and get it
distributed with links back to my site. You might ask why my site and
not hers, well hers is no longer available, which is to bad. Anyhow
more details will follow on what I am doing with this project and why.

I am asking for any and all help that people may offer. I do have a
Google project up and going with an older copy, which is not what I
intended on distributing but I have yet to find the finalized version
I created. Anyhow the old links work and redirect to the demo page on
my domain at http://www.webwizardwill.com/pgturner/ redirects to
http://www.webwizardwill.com/scrapbook/

please join the Google project which is located at:
http://code.google.com/p/scrapbook

Web Wizard Will

unread,
Aug 13, 2009, 10:15:27 PM8/13/09
to MooTools Users
created new thread that is closer to what is being done see:
http://groups.google.com/group/mootools-users/browse_thread/thread/64888252cb08a627

On Aug 13, 4:46 pm, Web Wizard Will <wwwresel...@gmail.com> wrote:
> I am sorry to all those who tried to view the demo and was
> unsuccessful,  I have undergone some major changes with my services
> never the less I am still trying to get off the ground.  Time is
> valueable and I have none.  Though I made this project for a client
> and she has gone out of business and I would like to see her company
> come back.  So I am hoping to build this project back up and get it
> distributed with links back to my site.  You might ask why my site and
> not hers, well hers is no longer available, which is to bad. Anyhow
> more details will follow on what I am doing with this project and why.
>
> I am asking for any and all help that people may offer.  I do have a
> Google project up and going with an older copy, which is not what I
> intended on distributing but I have yet to find the finalized version
> I created.  Anyhow the old links work and redirect to the demo page on
> my domain athttp://www.webwizardwill.com/pgturner/redirects tohttp://www.webwizardwill.com/scrapbook/
Reply all
Reply to author
Forward
0 new messages