Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow triggering of multiple stickies simultaneously #63

Open
andrewpbray opened this issue Aug 4, 2024 · 2 comments
Open

Allow triggering of multiple stickies simultaneously #63

andrewpbray opened this issue Aug 4, 2024 · 2 comments

Comments

@andrewpbray
Copy link
Contributor

@jimjam-slam

Allow for the following syntax:

:::{focus-on="cr-map,cr-popup"}
Here is a map with a popup on top!
:::

:::{#cr-map}
![](mymap.png)
:::

:::{#cr-popup}
I love this map!
:::

General idea

focus-on can take multiple stickies separated by commas. They will all get cr-active added to them as well as a z-index where the first sticky is the baselayer.

This could also be extended to [@cr-map; @cr-popup], which is valid Quarto crossref syntax.

Open Questions

How to pass effects attributes? How will we know which sticky they're meant for?

Those questions suggest an alternative approach, which is to keep one-sticky per trigger, but allow them to be nested. So:

:::{focus-on="cr-popup"}
:::{focus-on="cr-map"}
Here is a map with a popup on top!
:::
:::

:::{#cr-map}
![](mymap.png)
:::

:::{#cr-popup}
I love this map!
:::

Hmm, looking at it this way... I think I prefer this approach. It's lengthier syntax but it seems easier to think about since its a simple use of the existing approach (cr-popup is also literally on top of cr-map, so it's obvious what this will look like). In fact, if this doesn't work already, it should be very easy to implement.

Thoughts?

@andrewpbray
Copy link
Contributor Author

Thinking about it a bit more: I'm not sure how scrollama will deal with nested steps. Will the one event listener pick up on both steps triggering simultaneously and run UpdateStickies simultaneously?

@jimjam-slam
Copy link
Collaborator

Mmmm, I'll not sure either - I think if you had nested levels you'd want to run them as separate Scrollama instances, otherwise you're going to have inconsistency going up/down and also problems with the scroll % counter 🤔 So then you'd want a global state manager that tracks a list of Scrollama instances...

@andrewpbray andrewpbray added this to the positconf-24 milestone Aug 5, 2024
@andrewpbray andrewpbray removed this from the positconf-24 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants