Jump to content

Processwire way to run an animation once?


artaylor
 Share

Recommended Posts

Hi,

This is probably are really obvious issue and I will be doing a face-plant as soon as I see the answer. I want to run an animation on the home page that I only want to run once. A kind of landing page animation. What is the simplest and best way to handle this in PW? The animation is a combination of HTML, CSS and JS.

Current thoughts:

1. Create an index.html file and change the .htaccess and nginx files to load that first and then have it load the index.php. The problem with this is that it is out of PW control.

2. Somehow use a session variable as a flag. Can you access a PW->session var. from JS?

3. Create a hook somewhere. I have not delved into the hooking mechanism to know where to start if this is the way. So some pointers would be amazing.

4. Similar to #3, but using site/init.php (or one of the other hook files). Once again, no idea if this is where this would make the most sense.

5. Something completely different that i haven't thought of. Problem? I haven't thought of another solution yet...

I would love some suggestions about which way to go so that i don't end up spending days trying all these different ideas out.

Thanks in advance.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...