-
Notifications
You must be signed in to change notification settings - Fork 164
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
Show hidden objects only when a viewing a specific slide/frame #57
Comments
One naïve way to handle this might be to add a "show when in frame" sub-option to the "hide" option in the dialog; making the object in question hidden until it is the active frame (and then hide it again when moving away from that frame). |
It's an interesting idea. But other users are expecting a more general solution. In this example, an object will be visible in frame 42 only (note that the first frame index is 0). var objectToShow = document.getElementById("idOfObjectToShow");
sozi.events.listen("framechange", function (index) {
if (index === 42) {
objectToShow.style.visibility = "visible";
}
else {
objectToShow.style.visibility = "hidden";
}
}); |
Here is a sample document with 3 frames and 3 objects. The objects to show/hide are paths with XML ids "path3095", "path3097" and "path3099" (see lines 109 to 126). |
Hi! I just stumbled across the same problem while trying to create a presentation with sozi. Do I get it right: the solution you proposed is to create the presentation and thereafter hack the .svg file? I don't mind coding a little bit by myself, but that doesn't really convince me... Just imagine, I want to make a change shortly before a presentation - maybe I have 40 slides... Quite frightening prospects! What about working with layers? Could that be an approach to implement it? |
Not exactly. It is still not clear how this feature should be designed: there are concerns about the document structure and the UI. Working with layers is a possibility, but AFAIK, there is no standard definition of layers in the SVG standard. Inkscape uses SVG groups with custom XML attributes. |
Oh, are you already working/planing the feature? Thats great news! I was browsing the code today. Really nicely commented and organized. Great work! I am just thinking loud: the layers as defined in inkscape are transferred to the svg file, aren't they? So one could retrieve the information from the svg, couldn't it?
|
I am already implementing a new feature related to layers. See a demo here: |
Oh wow! I can't wait to try the new features! Thank you very much! I love sozi! btw: I've read on sozi's website, that the target browser is firefox. I usually also use firefox for browsing. However, the presentation, which I made with sozi, was running really slow (even stumbling) on firefox. Then I tried rekonq, which uses qtwebkit, and there the svg runs smoothly. Obviously, it is known, that firefox performs poorly with svg and javascript ( http://blogs.msdn.com/b/ie/archive/2011/03/08/comparing-hardware-accelerated-svg-across-browsers-with-santa-s-workshop.aspx ). Maybe, this information would be helpful on the sozi website. Something like: if you have performance issues (running to slow) try to use another browser. |
Yes. Animations can be really smoother in webkit. Maybe the website is misleading: it was not my intention to promote Firefox as the "target" browser for Sozi. |
I have written a small Python script one can run on a Sozi presentation after creating or modifying it for basically automating the proposed hack. It uses a hide file, a line-by-line specification of which objects should be visible at only certain frames, and it support numbering or naming the frames. The code is on this repo: https://bitbucket.org/jsrn/sozi_hiding |
~~It seems that ~~
nvm, it seems that using the |
@maronin There is an up-to-date example here: https://github.com/senshu/Sozi/blob/master/samples/show-hide-objects.svg sozi.events.listen("sozi.player.framechange", function (index) {...}); |
Thank you that works! |
In Sozi 15, layer opacity allows to achieve a similar effect as showing/hiding objects. |
Hi! Thanks for making a very useful piece of software!
Is there a way to hide objects that aren't related to the "current view"? Here's my use case:
I have a presentation with text in it, and I would like to take a closer look at different parts of the text throughout the presentation. When I focus at one part (e.g. a paragraph, or a specific quote somewhere) I would like that some supporting objects are revealed, e.g. some arrows and comments, or a rectangle placed behind the text to attract attention to it. I would also like that these supporting objects are otherwise hidden when I view at another part of the text even if the other view location overlaps the first view.
Is this something that can be emulated? (e.g. adding an event handler that changes visibility of some objects when the presentation starts, and then subsequently shows and then hides different objects as the presentation proceeds from one frame to the next...)
If this can be done with adding an event handler, I'd be happy with that, but my Javascript skills are quite limited, so an example would be very much appreciated. :)
The text was updated successfully, but these errors were encountered: