Skip to content

Instantly share code, notes, and snippets.

@aumouvantsillage
Last active September 26, 2015 17:18
Show Gist options
  • Save aumouvantsillage/1132368 to your computer and use it in GitHub Desktop.
Save aumouvantsillage/1132368 to your computer and use it in GitHub Desktop.
Sample Sozi document that shows/hides objects during the presentation
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:ns1="http://sozi.baierouge.fr"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg2"
version="1.1"
inkscape:version="0.48.2 r9819"
sodipodi:docname="Nouveau document 1">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="488.03357"
inkscape:cy="599.25875"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="974"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:window-maximized="1" />
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Calque 1">
<text
sodipodi:linespacing="125%"
id="text2985"
y="317.36218"
x="262.14285"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="317.36218"
x="262.14285"
id="tspan2987"
sodipodi:role="line">First</tspan></text>
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="406.42856"
y="417.36221"
id="text2989"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan2991"
x="406.42856"
y="417.36221">Second</tspan></text>
<text
sodipodi:linespacing="125%"
id="text2993"
y="490.93362"
x="287.85715"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="490.93362"
x="287.85715"
id="tspan2995"
sodipodi:role="line">Third</tspan></text>
<rect
y="275.21933"
x="251.42857"
height="160"
width="214.28572"
id="rect2997"
style="opacity:0.50000000000000000;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#008080;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
style="opacity:0.5;fill:none;stroke:#008080;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
id="rect2999"
width="214.28572"
height="160"
x="360.71429"
y="374.50504" />
<rect
y="280.40616"
x="243.75827"
height="241.05493"
width="200.34065"
id="rect3001"
style="opacity:0.5;fill:none;stroke:#008080;stroke-width:2.37364578;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
style="fill:#ff0000;stroke:none"
d="m 360,356.64789 -5.71429,-35.71428 35,15.71429 -21.13677,1.47319 z"
id="path3095"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="path3097"
d="m 365.79831,386.57843 32.16748,16.5353 -33.38346,18.90724 11.32445,-17.90783 z"
style="fill:#55d400;stroke:none" />
<path
style="fill:#5599ff;stroke:none"
d="m 435.66394,473.38416 -36.12913,1.68796 19.52663,-33.02499 -0.89776,21.16903 z"
id="path3099"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
</g>
<script
ns1:version="11.07-27221841"
id="sozi-script">var sozi=sozi||{};(function(){var a=sozi.events=sozi.events||{},b={};a.listen=function(d,e){var c=b[d];if(!c){c=b[d]=[]}c.push(e)};a.fire=function(g){var d=b[g],c,f,e=Array.prototype.slice.call(arguments,1);if(d){c=d.length;for(f=0;f&lt;c;f+=1){d[f].apply(null,e)}}}}());var sozi=sozi||{};(function(){var x=sozi.framelist=sozi.framelist||{},l=this,s=l.document,r,n,c,k=0,d=5,i,v,b,z,A,w,f=300,j=30,g=&quot;decelerate&quot;,a=&quot;http://www.w3.org/2000/svg&quot;;function h(B){return function(C){sozi.player.previewFrame(B);C.stopPropagation()}}function m(B){B.stopPropagation()}function q(C){var B=C.relatedTarget;while(B!==n&amp;&amp;B!==r){B=B.parentNode}if(B===r){x.hide();sozi.player.restart();C.stopPropagation()}}function u(C){var B=c.getCTM().f;if(B&lt;=-l.innerHeight/2){B+=l.innerHeight/2}else{if(B&lt;0){B=0}}c.setAttribute(&quot;transform&quot;,&quot;translate(0,&quot;+B+&quot;)&quot;);C.stopPropagation()}function e(C){var B=c.getCTM().f;if(B+k&gt;=l.innerHeight*3/2){B-=l.innerHeight/2}else{if(B+k&gt;l.innerHeight+2*d){B=l.innerHeight-k-4*d}}c.setAttribute(&quot;transform&quot;,&quot;translate(0,&quot;+B+&quot;)&quot;);C.stopPropagation()}function t(B){var D=sozi.animation.profiles[g](B),C=1-D;A=z*D+b*C;n.setAttribute(&quot;transform&quot;,&quot;translate(&quot;+A+&quot;,0)&quot;)}function y(){}function p(){var H=s.createElementNS(a,&quot;rect&quot;),B=s.createElementNS(a,&quot;path&quot;),F=s.createElementNS(a,&quot;path&quot;),I=0,G,D=sozi.document.frames.length,C=sozi.location.getFrameIndex(),E,J;r=s.documentElement;n=s.createElementNS(a,&quot;g&quot;);n.setAttribute(&quot;id&quot;,&quot;sozi-toc&quot;);r.appendChild(n);c=s.createElementNS(a,&quot;g&quot;);n.appendChild(c);H.setAttribute(&quot;id&quot;,&quot;sozi-toc-background&quot;);H.setAttribute(&quot;x&quot;,d);H.setAttribute(&quot;y&quot;,d);H.setAttribute(&quot;rx&quot;,d);H.setAttribute(&quot;ry&quot;,d);H.addEventListener(&quot;click&quot;,m,false);H.addEventListener(&quot;mousedown&quot;,m,false);H.addEventListener(&quot;mouseout&quot;,q,false);c.appendChild(H);for(E=0;E&lt;D;E+=1){J=s.createElementNS(a,&quot;text&quot;);J.appendChild(s.createTextNode(sozi.document.frames[E].title));c.appendChild(J);if(E===C){J.setAttribute(&quot;class&quot;,&quot;sozi-toc-current&quot;)}G=J.getBBox().width;k+=J.getBBox().height;if(G&gt;I){I=G}J.setAttribute(&quot;x&quot;,2*d);J.setAttribute(&quot;y&quot;,k+d);J.addEventListener(&quot;click&quot;,h(E),false);J.addEventListener(&quot;mousedown&quot;,m,false)}B.setAttribute(&quot;class&quot;,&quot;sozi-toc-arrow&quot;);B.setAttribute(&quot;d&quot;,&quot;M&quot;+(I+3*d)+&quot;,&quot;+(5*d)+&quot; l&quot;+(4*d)+&quot;,0 l-&quot;+(2*d)+&quot;,-&quot;+(3*d)+&quot; z&quot;);B.addEventListener(&quot;click&quot;,u,false);B.addEventListener(&quot;mousedown&quot;,m,false);n.appendChild(B);F.setAttribute(&quot;class&quot;,&quot;sozi-toc-arrow&quot;);F.setAttribute(&quot;d&quot;,&quot;M&quot;+(I+3*d)+&quot;,&quot;+(7*d)+&quot; l&quot;+(4*d)+&quot;,0 l-&quot;+(2*d)+&quot;,&quot;+(3*d)+&quot; z&quot;);F.addEventListener(&quot;click&quot;,e,false);F.addEventListener(&quot;mousedown&quot;,m,false);n.appendChild(F);H.setAttribute(&quot;width&quot;,I+7*d);H.setAttribute(&quot;height&quot;,k+2*d);i=-I-9*d;v=0;A=z=i;n.setAttribute(&quot;transform&quot;,&quot;translate(&quot;+i+&quot;,0)&quot;);w=new sozi.animation.Animator(j,t,y)}function o(B){var E=c.getElementsByClassName(&quot;sozi-toc-current&quot;),D=c.getElementsByTagName(&quot;text&quot;),C;for(C=0;C&lt;E.length;C+=1){E[C].removeAttribute(&quot;class&quot;)}D[B].setAttribute(&quot;class&quot;,&quot;sozi-toc-current&quot;)}x.show=function(){b=A;z=v;w.start(f)};x.hide=function(){b=A;z=i;w.start(f)};x.isVisible=function(){return z===v};sozi.events.listen(&quot;displayready&quot;,p);sozi.events.listen(&quot;cleanup&quot;,x.hide);sozi.events.listen(&quot;framechange&quot;,o)}());var sozi=sozi||{};(function(){var s=sozi.player=sozi.player||{},t=sozi.display=sozi.display||{},j=this,o=j.document,p=0,u=1,r=1.05,w=5,c=false,l=false,g=0,e=0;function a(A,z,B){s.stop();t.zoom(A&gt;0?r:1/r,z,B)}function v(x){s.stop();t.rotate(x&gt;0?w:-w)}function q(){if(sozi.framelist.isVisible()){sozi.framelist.hide();s.restart()}else{s.stop();sozi.framelist.show()}}function i(x){if(x.button===p){c=true;l=false;g=x.clientX;e=x.clientY}else{if(x.button===u){q()}}x.stopPropagation()}function m(x){if(c){s.stop();l=true;sozi.events.fire(&quot;cleanup&quot;);t.drag(x.clientX-g,x.clientY-e);g=x.clientX;e=x.clientY}x.stopPropagation()}function f(x){if(x.button===p){c=false}x.stopPropagation()}function h(x){if(!l&amp;&amp;x.button!==u){s.moveToNext()}x.stopPropagation()}function k(x){var y=0;if(!x){x=j.event}if(x.wheelDelta){y=x.wheelDelta;if(j.opera){y=-y}}else{if(x.detail){y=-x.detail}}if(y!==0){if(x.shiftKey){v(y)}else{a(y,x.clientX,x.clientY)}}x.stopPropagation();x.preventDefault()}function n(x){switch(x.charCode){case 43:a(1,j.innerWidth/2,j.innerHeight/2);break;case 45:a(-1,j.innerWidth/2,j.innerHeight/2);break;case 61:s.moveToCurrent();break;case 70:case 102:s.showAll();break;case 84:case 116:q();break;case 82:v(-1);break;case 114:v(1);break}x.stopPropagation()}function d(x){switch(x.keyCode){case 36:s.moveToFirst();break;case 35:s.moveToLast();break;case 38:s.jumpToPrevious();break;case 33:case 37:s.moveToPrevious();break;case 40:s.jumpToNext();break;case 34:case 39:case 13:case 32:s.moveToNext();break}x.stopPropagation()}function b(){var x=o.documentElement;x.addEventListener(&quot;click&quot;,h,false);x.addEventListener(&quot;mousedown&quot;,i,false);x.addEventListener(&quot;mouseup&quot;,f,false);x.addEventListener(&quot;mousemove&quot;,m,false);x.addEventListener(&quot;keypress&quot;,n,false);x.addEventListener(&quot;keydown&quot;,d,false);x.addEventListener(&quot;DOMMouseScroll&quot;,k,false);j.onmousewheel=k}j.addEventListener(&quot;load&quot;,b,false)}());var sozi=sozi||{};(function(){var a=sozi.animation=sozi.animation||{},b=this;a.Animator=function(d,c,e){this.timeStepMs=d||40;this.onStep=c;this.onDone=e;this.durationMs=0;this.data={};this.initialTime=0;this.started=false;this.timer=0};a.Animator.prototype.start=function(c,e){var d=this;this.durationMs=c;this.data=e;this.initialTime=Date.now();this.onStep(0,this.data);if(!this.started){this.started=true;this.timer=b.setInterval(function(){d.step()},this.timeStepMs)}};a.Animator.prototype.stop=function(){if(this.started){b.clearInterval(this.timer);this.started=false}};a.Animator.prototype.step=function(){var c=Date.now()-this.initialTime;if(c&gt;=this.durationMs){this.stop();this.onStep(1,this.data);this.onDone()}else{this.onStep(c/this.durationMs,this.data)}};a.profiles={linear:function(c){return c},accelerate:function(c){return Math.pow(c,3)},&quot;strong-accelerate&quot;:function(c){return Math.pow(c,5)},decelerate:function(c){return 1-Math.pow(1-c,3)},&quot;strong-decelerate&quot;:function(c){return 1-Math.pow(1-c,5)},&quot;accelerate-decelerate&quot;:function(c){var d=c&lt;=0.5?c:1-c,e=Math.pow(2*d,3)/2;return c&lt;=0.5?e:1-e},&quot;strong-accelerate-decelerate&quot;:function(c){var d=c&lt;=0.5?c:1-c,e=Math.pow(2*d,5)/2;return c&lt;=0.5?e:1-e},&quot;decelerate-accelerate&quot;:function(c){var d=c&lt;=0.5?c:1-c,e=(1-Math.pow(1-2*d,2))/2;return c&lt;=0.5?e:1-e},&quot;strong-decelerate-accelerate&quot;:function(c){var d=c&lt;=0.5?c:1-c,e=(1-Math.pow(1-2*d,3))/2;return c&lt;=0.5?e:1-e}}}());var sozi=sozi||{};(function(){var d=sozi.player=sozi.player||{},j=sozi.display=sozi.display||{},h=this,c,k,e=500,q=-10,l=&quot;linear&quot;,g=0,n=0,o=false,p=false;function f(t,w){var v=1-t,u=w.profile(t),s=1-u,r,x;for(r in w.initialState){if(w.initialState.hasOwnProperty(r)){if(typeof w.initialState[r]===&quot;number&quot;&amp;&amp;typeof w.finalState[r]===&quot;number&quot;){j.geometry[r]=w.finalState[r]*u+w.initialState[r]*s}}}if(w.zoomWidth&amp;&amp;w.zoomWidth.k!==0){x=t-w.zoomWidth.ts;j.geometry.width=w.zoomWidth.k*x*x+w.zoomWidth.ss}if(w.zoomHeight&amp;&amp;w.zoomHeight.k!==0){x=t-w.zoomHeight.ts;j.geometry.height=w.zoomHeight.k*x*x+w.zoomHeight.ss}j.clip=w.finalState.clip;j.update()}function i(){var r;if(sozi.document.frames[n].timeoutEnable){p=true;r=(n+1)%sozi.document.frames.length;k=h.setTimeout(function(){d.moveToFrame(r)},sozi.document.frames[n].timeoutMs)}}function m(){g=n;if(o){i()}}d.startFromIndex=function(r){o=true;p=false;g=r;n=r;j.showFrame(sozi.document.frames[r]);i()};d.restart=function(){d.startFromIndex(n)};d.stop=function(){c.stop();if(p){h.clearTimeout(k);p=false}o=false;g=n};function b(r,B,z){var C={ss:((r&lt;0)?Math.max(B,z):Math.min(B,z))*(100-r)/100,ts:0.5,k:0},x,w,t,s,A,y;if(r!==0){x=B-z;w=B-C.ss;t=z-C.ss;if(x!==0){s=Math.sqrt(w*t);A=(w-s)/x;y=(w+s)/x;C.ts=(A&gt;0&amp;&amp;A&lt;=1)?A:y}C.k=w/C.ts/C.ts}return C}d.jumpToFrame=function(r){d.stop();sozi.events.fire(&quot;cleanup&quot;);g=r;n=r;j.showFrame(sozi.document.frames[r]);sozi.events.fire(&quot;framechange&quot;,r)};d.previewFrame=function(s){var u=sozi.document.frames[s].geometry,r,t;if(q!==0){r=b(q,j.geometry.width,u.width);t=b(q,j.geometry.height,u.height)}n=s;c.start(e,{initialState:j.getCurrentGeometry(),finalState:u,profile:sozi.animation.profiles[l],zoomWidth:r,zoomHeight:t});sozi.events.fire(&quot;framechange&quot;,s)};d.moveToFrame=function(t){var s=e,w=q,u=sozi.animation.profiles[l],r,v;if(p){h.clearTimeout(k);p=false}if(t===(n+1)%sozi.document.frames.length){s=sozi.document.frames[t].transitionDurationMs;w=sozi.document.frames[t].transitionZoomPercent;u=sozi.document.frames[t].transitionProfile}sozi.events.fire(&quot;cleanup&quot;);if(w!==0){r=b(w,j.geometry.width,sozi.document.frames[t].geometry.width);v=b(w,j.geometry.height,sozi.document.frames[t].geometry.height)}o=true;n=t;c.start(s,{initialState:j.getCurrentGeometry(),finalState:sozi.document.frames[n].geometry,profile:u,zoomWidth:r,zoomHeight:v});sozi.events.fire(&quot;framechange&quot;,t)};d.moveToFirst=function(){d.moveToFrame(0)};d.jumpToPrevious=function(){var r=n;if(!c.started||g&lt;=n){r-=1}if(r&gt;=0){d.jumpToFrame(r)}};d.moveToPrevious=function(){var r=n,s;for(r-=1;r&gt;=0;r-=1){s=sozi.document.frames[r];if(!s.timeoutEnable||s.timeoutMs!==0){d.moveToFrame(r);break}}};d.jumpToNext=function(){var r=n;if(!c.started||g&gt;=n){r+=1}if(r&lt;sozi.document.frames.length){d.jumpToFrame(r)}};d.moveToNext=function(){if(n&lt;sozi.document.frames.length-1||sozi.document.frames[n].timeoutEnable){d.moveToFrame((n+1)%sozi.document.frames.length)}};d.moveToLast=function(){d.moveToFrame(sozi.document.frames.length-1)};d.moveToCurrent=function(){d.moveToFrame(n)};d.showAll=function(){d.stop();sozi.events.fire(&quot;cleanup&quot;);c.start(e,{initialState:j.getCurrentGeometry(),finalState:j.getDocumentGeometry(),profile:sozi.animation.profiles[l]})};function a(){d.startFromIndex(sozi.location.getFrameIndex())}c=new sozi.animation.Animator(40,f,m);sozi.events.listen(&quot;displayready&quot;,a)}());var sozi=sozi||{};(function(){var d=sozi.display=sozi.display||{},h=this,i=h.document,j,c,k,a,g=&quot;http://www.w3.org/2000/svg&quot;;d.geometry={cx:0,cy:0,width:1,height:1,rotate:0};d.clip=true;function f(){var o,l=i.createElementNS(g,&quot;g&quot;),m=i.createElementNS(g,&quot;clipPath&quot;);j=i.documentElement;j.removeAttribute(&quot;viewBox&quot;);k=j.getBBox();a=i.createElementNS(g,&quot;g&quot;);while(true){o=j.firstChild;if(!o){break}j.removeChild(o);a.appendChild(o)}c=i.createElementNS(g,&quot;rect&quot;);c.setAttribute(&quot;id&quot;,&quot;sozi-clip-rect&quot;);m.setAttribute(&quot;id&quot;,&quot;sozi-clip-path&quot;);m.appendChild(c);j.appendChild(m);l.setAttribute(&quot;clip-path&quot;,&quot;url(#sozi-clip-path)&quot;);l.appendChild(a);j.appendChild(l);j.setAttribute(&quot;width&quot;,h.innerWidth);j.setAttribute(&quot;height&quot;,h.innerHeight);sozi.events.fire(&quot;displayready&quot;)}function b(){j.setAttribute(&quot;width&quot;,h.innerWidth);j.setAttribute(&quot;height&quot;,h.innerHeight);d.update()}function e(){var l={};l.scale=Math.min(h.innerWidth/d.geometry.width,h.innerHeight/d.geometry.height);l.width=d.geometry.width*l.scale;l.height=d.geometry.height*l.scale;l.x=(h.innerWidth-l.width)/2;l.y=(h.innerHeight-l.height)/2;return l}d.getElementGeometry=function(l){var s,p,t,n,q,o,r=l.getCTM(),m=Math.sqrt(r.a*r.a+r.b*r.b);if(l.nodeName===&quot;rect&quot;){s=l.x.baseVal.value;p=l.y.baseVal.value;t=l.width.baseVal.value;n=l.height.baseVal.value}else{q=l.getBBox();s=q.x;p=q.y;t=q.width;n=q.height}o=i.documentElement.createSVGPoint();o.x=s+t/2;o.y=p+n/2;o=o.matrixTransform(r);return{cx:o.x,cy:o.y,width:t*m,height:n*m,rotate:Math.atan2(r.b,r.a)*180/Math.PI}};d.getDocumentGeometry=function(){return{cx:k.x+k.width/2,cy:k.y+k.height/2,width:k.width,height:k.height,rotate:0,clip:false}};d.getCurrentGeometry=function(){return{cx:d.geometry.cx,cy:d.geometry.cy,width:d.geometry.width,height:d.geometry.height,rotate:d.geometry.rotate,clip:d.clip}};d.update=function(){var l=e(),n=-d.geometry.cx+d.geometry.width/2+l.x/l.scale,m=-d.geometry.cy+d.geometry.height/2+l.y/l.scale;a.setAttribute(&quot;transform&quot;,&quot;scale(&quot;+l.scale+&quot;)translate(&quot;+n+&quot;,&quot;+m+&quot;)rotate(&quot;+(-d.geometry.rotate)+&quot;,&quot;+d.geometry.cx+&quot;,&quot;+d.geometry.cy+&quot;)&quot;);c.setAttribute(&quot;x&quot;,d.clip?l.x:0);c.setAttribute(&quot;y&quot;,d.clip?l.y:0);c.setAttribute(&quot;width&quot;,d.clip?l.width:h.innerWidth);c.setAttribute(&quot;height&quot;,d.clip?l.height:h.innerHeight)};d.showFrame=function(m){var l;for(l in m.geometry){if(m.geometry.hasOwnProperty(l)){d.geometry[l]=m.geometry[l]}}d.update()};d.drag=function(m,l){var n=e(),o=d.geometry.rotate*Math.PI/180;d.geometry.cx-=(m*Math.cos(o)-l*Math.sin(o))/n.scale;d.geometry.cy-=(m*Math.sin(o)+l*Math.cos(o))/n.scale;d.clip=false;d.update()};d.zoom=function(o,m,p){var n=(1-o)*(m-h.innerWidth/2),l=(1-o)*(p-h.innerHeight/2);d.geometry.width/=o;d.geometry.height/=o;d.drag(n,l)};d.rotate=function(l){d.geometry.rotate+=l;d.geometry.rotate%=360;d.update()};sozi.events.listen(&quot;documentready&quot;,f);h.addEventListener(&quot;resize&quot;,b,false)}());var sozi=sozi||{};(function(){var c=sozi.document=sozi.document||{},g=this,a=g.document,f=&quot;http://sozi.baierouge.fr&quot;,d={title:&quot;Untitled&quot;,sequence:&quot;0&quot;,hide:&quot;true&quot;,clip:&quot;true&quot;,&quot;timeout-enable&quot;:&quot;false&quot;,&quot;timeout-ms&quot;:&quot;5000&quot;,&quot;transition-duration-ms&quot;:&quot;1000&quot;,&quot;transition-zoom-percent&quot;:&quot;0&quot;,&quot;transition-profile&quot;:&quot;linear&quot;};c.frames=[];function h(j,i){var k=j.getAttributeNS(f,i);return k===&quot;&quot;?d[i]:k}function b(){var j=a.getElementsByTagNameNS(f,&quot;frame&quot;),k=j.length,m,l,n;for(l=0;l&lt;k;l+=1){m=a.getElementById(j[l].getAttributeNS(f,&quot;refid&quot;));if(m){n={geometry:sozi.display.getElementGeometry(m),title:h(j[l],&quot;title&quot;),sequence:parseInt(h(j[l],&quot;sequence&quot;),10),hide:h(j[l],&quot;hide&quot;)===&quot;true&quot;,timeoutEnable:h(j[l],&quot;timeout-enable&quot;)===&quot;true&quot;,timeoutMs:parseInt(h(j[l],&quot;timeout-ms&quot;),10),transitionDurationMs:parseInt(h(j[l],&quot;transition-duration-ms&quot;),10),transitionZoomPercent:parseInt(h(j[l],&quot;transition-zoom-percent&quot;),10),transitionProfile:sozi.animation.profiles[h(j[l],&quot;transition-profile&quot;)||&quot;linear&quot;]};if(n.hide){m.setAttribute(&quot;visibility&quot;,&quot;hidden&quot;)}n.geometry.clip=h(j[l],&quot;clip&quot;)===&quot;true&quot;;c.frames.push(n)}}c.frames.sort(function(o,i){return o.sequence-i.sequence})}function e(){b();sozi.events.fire(&quot;documentready&quot;)}g.addEventListener(&quot;load&quot;,e,false)}());var sozi=sozi||{};(function(){var a=sozi.location=sozi.location||{},e=this,c=false;a.getFrameIndex=function(){var g=e.location.hash?parseInt(e.location.hash.slice(1),10)-1:0;if(isNaN(g)||g&lt;0){return 0}else{if(g&gt;=sozi.document.frames.length){return sozi.document.frames.length-1}else{return g}}};function f(){var g=a.getFrameIndex();if(!c){sozi.player.moveToFrame(g)}c=false}function d(g){c=true;e.location.hash=&quot;#&quot;+(g+1)}function b(){sozi.events.listen(&quot;framechange&quot;,d)}e.addEventListener(&quot;hashchange&quot;,f,false);e.addEventListener(&quot;load&quot;,b,false)}());</script>
<script><![CDATA[
var objList = [
{id: "path3095", frame: 0},
{id: "path3097", frame: 1},
{id: "path3099", frame: 2}
];
sozi.events.listen("sozi.player.framechange", function (index) {
for (var i = 0; i < objList.length; i ++) {
document.getElementById(objList[i].id).style.visibility =
objList[i].frame === index ? "visible" : "hidden";
}
});
]]></script>
<style
ns1:version="11.07-27221841"
id="sozi-style">#sozi-toc text{fill:#eff;font-family:Verdana,sans-serif;font-size:12pt}#sozi-toc text:hover{fill:#0cf;cursor:pointer}#sozi-toc text.sozi-toc-current{fill:#fa4}#sozi-toc-background{stroke:#222;stroke-opacity:.1;stroke-width:10;fill:#222;fill-opacity:.9}.sozi-toc-arrow{fill:#eff;fill-opacity:.75;stroke:none}.sozi-toc-arrow:hover{fill:#0cf}</style>
<ns1:frame
ns1:transition-profile="linear"
ns1:timeout-enable="false"
ns1:timeout-ms="5000"
ns1:transition-zoom-percent="0"
ns1:title="First"
ns1:clip="true"
ns1:hide="true"
ns1:transition-duration-ms="1000"
ns1:sequence="1"
ns1:refid="rect2997" />
<ns1:frame
ns1:refid="rect2999"
ns1:sequence="2"
ns1:transition-duration-ms="1000"
ns1:hide="true"
ns1:clip="true"
ns1:title="Second"
ns1:transition-zoom-percent="0"
ns1:timeout-ms="5000"
ns1:timeout-enable="false"
ns1:transition-profile="linear" />
<ns1:frame
ns1:transition-profile="linear"
ns1:timeout-enable="false"
ns1:timeout-ms="5000"
ns1:transition-zoom-percent="0"
ns1:title="Third"
ns1:clip="true"
ns1:hide="true"
ns1:transition-duration-ms="1000"
ns1:sequence="3"
ns1:refid="rect3001" />
</svg>
@johschmitz
Copy link

Hello,
I discovered your extension today. It is totally awesome!
Then I thought how can I show and hide objects during the presentation and found this code on Google.
Could you tell me how I can actually use it? I was planning to create something for Valentine's day tomorrow..

Regards
Johannes

@calve
Copy link

calve commented Dec 2, 2014

Hi,
with my version, I have to use "sozi.player.framechange" instead of "framechange", line 137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment