Skip to content

Instantly share code, notes, and snippets.

@sunaku
Created September 3, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunaku/e96cb55023f282eed71b to your computer and use it in GitHub Desktop.
Save sunaku/e96cb55023f282eed71b to your computer and use it in GitHub Desktop.
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<style>
body {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.sozi-frame-list {
position: absolute;
top: 0;
right: 0;
width: 33%;
height: 100%;
margin: 0;
padding: 0.5em 1em;
overflow-y: auto;
list-style: decimal inside;
font-family: "Droid Sans", Helvetica, Arial, sans-serif;
font-size: 12pt;
color: rgb(240, 255, 255);
background-color: rgba(34, 34, 34, 0.9);
}
.sozi-frame-list li {
margin: 0;
padding: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.sozi-frame-list a {
color: inherit;
text-decoration: none;
}
.sozi-frame-list a:hover {
color: rgb(0, 204, 255);
text-decoration: underline;
}
.sozi-frame-list a.current {
color: rgb(255, 170, 68);
}
.sozi-frame-number {
position: absolute;
top: 0;
left: 1em;
text-align: center;
padding: 0.3em 0.6em;
cursor: pointer;
font-family: "Droid Sans", Helvetica, Arial, sans-serif;
font-size: 12pt;
color: rgb(240, 255, 255);
background-color: rgba(34, 34, 34, 0.9);
}
</style>
</head>
<body>
<svg 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.91 r" sodipodi:docname="issue-315.svg" style="height: auto; width: auto;"><style>svg {
background: rgba(255, 255, 255, 0.0);
}</style><defs id="defs4">
<inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="100 : 526.1811 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="683.43004 : 641.92861 : 1" inkscape:persp3d-origin="472.04724 : 350.7874 : 1" id="perspective3342"></inkscape:perspective>
</defs><sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.1576923" inkscape:cx="292.50831" inkscape:cy="901.49055" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" inkscape:window-height="1026" inkscape:window-x="0" inkscape:window-y="25" inkscape:window-maximized="1"></sodipodi:namedview><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:type>
<dc:title></dc:title>
</cc:work>
</rdf:rdf>
</metadata><g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">
<path sodipodi:type="star" style="fill:#ff4141;stroke-width:0.60000002;stroke-miterlimit:4;stroke-dasharray:none" id="path3336" sodipodi:sides="5" sodipodi:cx="156.14618" sodipodi:cy="287.91037" sodipodi:r1="80.146248" sodipodi:r2="40.073124" sodipodi:arg1="1.0396187" sodipodi:arg2="1.6679372" inkscape:flatsided="false" inkscape:rounded="0" inkscape:randomized="0" d="m 196.74419,357.01336 -44.48463,-29.21879 -49.28875,20.0808 14.04221,-51.3365 -34.329035,-40.67108 53.163195,-2.50891 28.07224,-45.21691 18.81444,49.7859 51.67864,12.7255 -41.53522,33.27829 z" inkscape:transform-center-x="-2.4020636" inkscape:transform-center-y="-5.3327064"></path>
<path sodipodi:type="spiral" style="fill:#009100;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="path3338" sodipodi:cx="338.40533" sodipodi:cy="121.19942" sodipodi:expansion="1" sodipodi:revolution="3" sodipodi:radius="82.295868" sodipodi:argument="-17.643673" sodipodi:t0="0" d="m 338.40533,121.19942 c 1.47251,3.85449 -4.46929,3.88658 -6.40642,2.4474 -5.24948,-3.90009 -2.84834,-11.78411 1.51163,-15.26025 7.79896,-6.21799 19.08324,-2.30915 24.11406,5.47065 7.38294,11.41717 1.79914,26.49771 -9.42967,32.96789 -14.96624,8.62372 -33.95527,1.30427 -41.82171,-13.3887 -9.89911,-18.48959 -0.81778,-41.433874 17.34772,-50.675528 22.00085,-11.192882 48.92445,-0.336255 59.52935,21.306738 12.49751,25.50552 -0.14214,56.4225 -25.26576,68.38318 -29.00621,13.80907 -63.92554,-0.61846 -77.237,-29.22479 -15.12533,-32.50433 1.09332,-71.432072 33.18381,-86.090819 36.00068,-16.444897 78.94116,1.567132 94.94464,37.142835 17.7669,39.495774 -2.04015,86.452154 -41.10185,103.798464"></path>
<g sodipodi:type="inkscape:box3d" id="g3344" style="fill:#009100;stroke-width:0.60000002;stroke-miterlimit:4;stroke-dasharray:none" inkscape:perspectiveid="#perspective3342" inkscape:corner0="1.0316803 : 0.66123862 : 0 : 1" inkscape:corner7="0.61923393 : 0.41994371 : 0.25 : 1">
<path sodipodi:type="inkscape:box3dside" id="path3356" style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="11" d="m 326.98392,300.5659 50.08399,-49.78198 0,129.08759 -50.08399,26.44755 z" points="377.06791,250.78392 377.06791,379.87151 326.98392,406.31906 326.98392,300.5659 "></path>
<path sodipodi:type="inkscape:box3dside" id="path3346" style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="6" d="m 283.12292,287.04659 0,118.76618 43.861,0.50629 0,-105.75316 z" points="283.12292,405.81277 326.98392,406.31906 326.98392,300.5659 283.12292,287.04659 "></path>
<path sodipodi:type="inkscape:box3dside" id="path3348" style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="5" d="m 283.12292,287.04659 46.64452,-60.91163 47.30047,24.64896 -50.08399,49.78198 z" points="329.76744,226.13496 377.06791,250.78392 326.98392,300.5659 283.12292,287.04659 "></path>
<path sodipodi:type="inkscape:box3dside" id="path3354" style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="13" d="m 283.12292,405.81277 46.64452,-30.65987 47.30047,4.71861 -50.08399,26.44755 z" points="329.76744,375.1529 377.06791,379.87151 326.98392,406.31906 283.12292,405.81277 "></path>
<path sodipodi:type="inkscape:box3dside" id="path3352" style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="14" d="m 329.76744,226.13496 0,149.01794 47.30047,4.71861 0,-129.08759 z" points="329.76744,375.1529 377.06791,379.87151 377.06791,250.78392 329.76744,226.13496 "></path>
<path sodipodi:type="inkscape:box3dside" id="path3350" style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" inkscape:box3dsidetype="3" d="m 283.12292,287.04659 46.64452,-60.91163 0,149.01794 -46.64452,30.65987 z" points="329.76744,226.13496 329.76744,375.1529 283.12292,405.81277 283.12292,287.04659 "></path>
</g>
</g></svg>
<div class="sozi-frame-number" title="Click to show the frame list">1</div>
<ol class="sozi-frame-list">
<li value="1"><a data-frame-index="0" href="#frame6730" title="Star">Star</a></li>
<li value="2"><a data-frame-index="1" href="#frame9286" title="Spiral">Spiral</a></li>
<li value="3"><a data-frame-index="2" href="#frame1960" title="Cube">Cube</a></li>
</ol>
<script>var soziPresentationData = {"frames":[{"frameId":"frame6730","title":"Star","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":153.2092890636677,"cy":279.8595264261317,"width":223.168900214638,"height":167.49875880442198,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":153.2092890636677,"cy":279.8595264261317,"width":223.168900214638,"height":167.49875880442198,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}}},{"frameId":"frame9286","title":"Spiral","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":345.7554148774435,"cy":122.34720965538449,"width":234.32734522536992,"height":175.8736967446431,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":345.7554148774435,"cy":122.34720965538449,"width":234.32734522536992,"height":175.8736967446431,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}}},{"frameId":"frame1960","title":"Cube","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":366.0175036507687,"cy":316.53894668050134,"width":246.0437124866385,"height":184.6673815818753,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":366.0175036507687,"cy":316.53894668050134,"width":246.0437124866385,"height":184.6673815818753,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}}}],"elementsToHide":[]};</script>
<script>!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b,c){b.hasOwnProperty(c)&&(a[c]=b[c])}Object.defineProperty(c,"__esModule",{value:!0});var e={opacity:1,angle:0,clipped:!1,clipXOffset:0,clipYOffset:0,clipWidthFactor:1,clipHeightFactor:1,init:function(a){this.svgRoot=a;var b=a.getBBox();return this.cx=b.x+b.width/2,this.cy=b.y+b.height/2,this.width=b.width,this.height=b.height,this},initFrom:function(a){return this.svgRoot=a.svgRoot,this.cx=a.cx,this.cy=a.cy,this.width=a.width,this.height=a.height,this.opacity=a.opacity,this.angle=a.angle,this.clipped=a.clipped,this.clipXOffset=a.clipXOffset,this.clipYOffset=a.clipYOffset,this.clipWidthFactor=a.clipWidthFactor,this.clipHeightFactor=a.clipHeightFactor,this},toStorable:function(){return{cx:this.cx,cy:this.cy,width:this.width,height:this.height,opacity:this.opacity,angle:this.angle,clipped:this.clipped,clipXOffset:this.clipXOffset,clipYOffset:this.clipYOffset,clipWidthFactor:this.clipWidthFactor,clipHeightFactor:this.clipHeightFactor}},toMinimalStorable:function(){return this.toStorable()},fromStorable:function(a){return d(this,a,"cx"),d(this,a,"cy"),d(this,a,"width"),d(this,a,"height"),d(this,a,"opacity"),d(this,a,"angle"),d(this,a,"clipped"),d(this,a,"clipXOffset"),d(this,a,"clipYOffset"),d(this,a,"clipWidthFactor"),d(this,a,"clipHeightFactor"),this},setAngle:function(a){return this.angle=(a+180)%360-180,this},setAtElement:function(a,b,c,d,e,f){b=b||0,c=c||0,d=d||1,e=e||1,f=f||0;var g=a.getBBox(),h=this.svgRoot.createSVGPoint();h.x=g.x+g.width/2,h.y=g.y+g.height/2;for(var i=a;i.parentNode.parentNode!==this.svgRoot;)i=i.parentNode;var j=i.getCTM().inverse().multiply(a.getCTM());h=h.matrixTransform(j);var k=Math.sqrt(j.a*j.a+j.b*j.b);return this.cx=h.x+b,this.cy=h.y+c,this.width=g.width*k*d,this.height=g.height*k*e,this.angle=180*Math.atan2(j.b,j.a)/Math.PI+f,this},offsetFromElement:function(a){var b=Object.create(e).init(this.svgRoot).setAtElement(a);return{deltaX:this.cx-b.cx,deltaY:this.cy-b.cy,widthFactor:this.width/b.width,heightFactor:this.height/b.height,deltaAngle:this.angle-b.angle}}};c.CameraState=e},{}],2:[function(a,b,c){function d(a,b,c){b.hasOwnProperty(c)&&(a[c]=b[c])}Object.defineProperty(c,"__esModule",{value:!0});var e=a("../utils"),f=a("./CameraState"),g={link:!1,referenceElementId:"",referenceElementAuto:!0,transitionTimingFunction:"linear",transitionRelativeZoom:0,transitionPathId:"",init:function(a){return this.frame=a,this},initFrom:function(a){return this.frame=a.frame,this.link=a.link,this.referenceElementId=a.referenceElementId,this.referenceElementAuto=a.referenceElementAuto,this.transitionTimingFunction=a.transitionTimingFunction,this.transitionRelativeZoom=a.transitionRelativeZoom,this.transitionPathId=a.transitionPathId,this},toStorable:function(){return{link:this.link,referenceElementId:this.referenceElementId,referenceElementAuto:this.referenceElementAuto,transitionTimingFunction:this.transitionTimingFunction,transitionRelativeZoom:this.transitionRelativeZoom,transitionPathId:this.transitionPathId}},toMinimalStorable:function(){return{transitionTimingFunction:this.transitionTimingFunction,transitionRelativeZoom:this.transitionRelativeZoom,transitionPathId:this.transitionPathId}},fromStorable:function(a){return d(this,a,"link"),d(this,a,"referenceElementId"),d(this,a,"referenceElementAuto"),d(this,a,"transitionTimingFunction"),d(this,a,"transitionRelativeZoom"),d(this,a,"transitionPathId"),this},get index(){return this.frame.layerProperties.indexOf(this)},get referenceElement(){return this.frame.presentation.document.root.getElementById(this.referenceElementId)},get transitionPath(){return this.frame.presentation.document.root.getElementById(this.transitionPathId)},get referenceElementHide(){return this.frame.presentation.elementsToHide.indexOf(this.referenceElementId)>=0},set referenceElementHide(a){var b=this.referenceElementHide;if(a&&!b)this.frame.presentation.elementsToHide.push(this.referenceElementId);else if(!a&&b){var c=this.frame.presentation.elementsToHide.indexOf(this.referenceElementId);this.frame.presentation.elementsToHide.splice(c,1)}this.referenceElement&&(this.referenceElement.style.visibility=a?"hidden":"visible")},get transitionPathHide(){return this.frame.presentation.elementsToHide.indexOf(this.transitionPathId)>=0},set transitionPathHide(a){var b=this.transitionPathHide;if(a&&!b)this.frame.presentation.elementsToHide.push(this.transitionPathId);else if(!a&&b){var c=this.frame.presentation.elementsToHide.indexOf(this.transitionPathId);this.frame.presentation.elementsToHide.splice(c,1)}this.transitionPath&&(this.transitionPath.style.visibility=a?"hidden":"visible")}};c.LayerProperties=g;var h={title:"New frame",timeoutMs:0,timeoutEnable:!1,transitionDurationMs:1e3,showInFrameList:!0,showFrameNumber:!0,init:function(a){var b=this;return this.presentation=a,this.frameId=a.makeFrameId(),this.layerProperties=a.layers.map(function(a){return Object.create(g).init(b)}),this.cameraStates=a.layers.map(function(b){return Object.create(f.CameraState).init(a.document.root)}),this},initFrom:function(a,b){return this.presentation=a.presentation,b||(this.frameId=a.presentation.makeFrameId()),this.title=a.title,this.timeoutMs=a.timeoutMs,this.timeoutEnable=a.timeoutEnable,this.transitionDurationMs=a.transitionDurationMs,this.showInFrameList=a.showInFrameList,this.showFrameNumber=a.showFrameNumber,this.layerProperties=a.layerProperties.map(function(a){return Object.create(g).initFrom(a)}),this.cameraStates=a.cameraStates.map(function(a){return Object.create(f.CameraState).initFrom(a)}),this},toStorable:function(){var a=this,b={},c={},d={};return this.presentation.layers.forEach(function(e,f){var g=a.layerProperties[f],h=a.cameraStates[f],i=g.referenceElement,j=e.groupId;b[j]=g.toStorable(),c[j]=h.toStorable(),i&&(d[j]=a.cameraStates[f].offsetFromElement(i))}),{frameId:this.frameId,title:this.title,timeoutMs:this.timeoutMs,timeoutEnable:this.timeoutEnable,transitionDurationMs:this.transitionDurationMs,showInFrameList:this.showInFrameList,showFrameNumber:this.showFrameNumber,layerProperties:b,cameraStates:c,cameraOffsets:d}},toMinimalStorable:function(){var a=this,b={},c={};return this.presentation.layers.forEach(function(d,e){var f=a.layerProperties[e],g=a.cameraStates[e],h=d.groupId;b[h]=f.toMinimalStorable(),c[h]=g.toMinimalStorable()}),{frameId:this.frameId,title:this.title,timeoutMs:this.timeoutMs,timeoutEnable:this.timeoutEnable,transitionDurationMs:this.transitionDurationMs,showInFrameList:this.showInFrameList,showFrameNumber:this.showFrameNumber,layerProperties:b,cameraStates:c}},fromStorable:function(a){var b=this;return d(this,a,"frameId"),d(this,a,"title"),d(this,a,"timeoutMs"),d(this,a,"timeoutEnable"),d(this,a,"transitionDurationMs"),d(this,a,"showInFrameList"),d(this,a,"showFrameNumber"),this.presentation.layers.forEach(function(c,d){var e=c.groupId;if(e in a.layerProperties){var f=b.layerProperties[d];f.fromStorable(a.layerProperties[e]);var g=b.cameraStates[d].fromStorable(a.cameraStates[e]),h=f.referenceElement;if(h){var i=a.cameraOffsets[e]||{};g.setAtElement(h,i.deltaX,i.deltaY,i.widthFactor,i.heightFactor,i.deltaAngle)}}}),this},get index(){return this.presentation.frames.indexOf(this)},setAtStates:function(a){var b=this;a.forEach(function(a,c){b.cameraStates[c].initFrom(a)})}};c.Frame=h;var i={init:function(a,b,c){return this.presentation=a,this.label=b,this.auto=c,this.svgNodes=[],this},get groupId(){return this.auto?"__sozi_auto__":this.svgNodes[0].getAttribute("id")},get index(){return this.presentation.layers.indexOf(this)},get isVisible(){return this.svgNodes.some(function(a){return"none"!==window.getComputedStyle(a).display})},set isVisible(a){this.svgNodes.forEach(function(b){b.style.display=a?"inline":"none"})}};c.Layer=i;var j="http://www.w3.org/2000/svg",k={aspectWidth:4,aspectHeight:3,init:function(a){var b=this;this.document=a,this.frames=[],this.layers=[],this.elementsToHide=[];var c=Object.create(i).init(this,"auto",!0);return e.toArray(this.document.root.childNodes).forEach(function(a){if("g"===a.localName){var d=a.getAttribute("id");if(null===d)c.svgNodes.push(a);else{var e=Object.create(i).init(b,b.document.handler.getLabel(a)||"#"+d,!1);e.svgNodes.push(a),b.layers.push(e)}}}),this.layers.push(c),this},toStorable:function(){return{aspectWidth:this.aspectWidth,aspectHeight:this.aspectHeight,frames:this.frames.map(function(a){return a.toStorable()}),elementsToHide:this.elementsToHide.slice()}},toMinimalStorable:function(){return{frames:this.frames.map(function(a){return a.toMinimalStorable()}),elementsToHide:this.elementsToHide.slice()}},fromStorable:function(a){var b=this;return d(this,a,"aspectWidth"),d(this,a,"aspectHeight"),this.frames=a.frames.map(function(a){return Object.create(h).init(b).fromStorable(a)}),a.elementsToHide&&(this.elementsToHide=a.elementsToHide.slice()),this},get title(){var a=this.document.root.getElementsByTagNameNS(j,"title");return a.length?a[0].firstChild.wholeText.trim():"Untitled"},makeFrameId:function(){var a,b="frame",c=Math.floor(1e3*(1+9*Math.random()));do a=b+c,c++;while(this.frames.some(function(b){return b.frameId===a}));return a},getFrameWithId:function(a){for(var b=0;b<this.frames.length;b++)if(this.frames[b].frameId===a)return this.frames[b];return null},getLayerWithId:function(a){for(var b=0;b<this.layers.length;b++)if(this.layers[b].groupId===a)return this.layers[b];return null},updateLinkedLayers:function(){var a=this;if(this.frames.length){var b=this.frames[0].cameraStates,c=b[b.length-1];this.layers.forEach(function(b,d){var e=c;a.frames.forEach(function(a){a.layerProperties[d].link?a.cameraStates[d].initFrom(e):e=a.cameraStates[d]})})}}};c.Presentation=k},{"../utils":14,"./CameraState":1}],3:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=a("./svg/SVGDocument"),f=a("./model/Presentation"),g=a("./player/Viewport"),h=a("./player/Player"),i=a("./player/Media"),j=d(i),k=a("./player/FrameList"),l=d(k),m=a("./player/FrameNumber"),n=d(m),o=a("./player/FrameURL"),p=d(o);window.addEventListener("load",function(){e.SVGDocument.init(document.querySelector("svg")),f.Presentation.init(e.SVGDocument),g.Viewport.init(f.Presentation,!1).onLoad(),f.Presentation.fromStorable(window.soziPresentationData),h.Player.init(g.Viewport,f.Presentation),j.init(h.Player),l.init(h.Player),n.init(h.Player),p.init(h.Player),window.sozi={presentation:f.Presentation,viewport:g.Viewport,player:h.Player},h.Player.addListener("change:playing",function(a,b){b?document.title=f.Presentation.title:document.title=f.Presentation.title+"(Paused)"}),window.addEventListener("resize",g.Viewport.repaint.bind(g.Viewport)),f.Presentation.frames.length&&h.Player.playFromIndex(0),g.Viewport.repaint()})},{"./model/Presentation":2,"./player/FrameList":6,"./player/FrameNumber":7,"./player/FrameURL":8,"./player/Media":9,"./player/Player":10,"./player/Viewport":12,"./svg/SVGDocument":13}],4:[function(a,b,c){function d(){k>0?(h&&h(d),l.forEach(function(a){a.running&&a.step()})):h||window.clearInterval(f)}function e(){h?h(d):f=window.setInterval(d,j)}Object.defineProperty(c,"__esModule",{value:!0});var f,g=a("events"),h=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,i=window.performance&&window.performance.now?window.performance:Date,j=40,k=0,l=[],m=Object.create(g.EventEmitter.prototype);c.Animator=m,m.init=function(){return g.EventEmitter.call(this),this.durationMs=500,this.initialTime=0,this.running=!1,l.push(this),this},m.start=function(a){this.durationMs=a,this.initialTime=i.now(),this.emit("step",0),this.running||(this.running=!0,k++,1===k&&e())},m.stop=function(){this.running&&(this.running=!1,k--,this.emit("stop"))},m.step=function(){var a=i.now()-this.initialTime;a>=this.durationMs?(this.emit("step",1),this.running=!1,k--,this.emit("done")):this.emit("step",a/this.durationMs)}},{events:15}],5:[function(a,b,c){Object.defineProperty(c,"__esModule",{value:!0});var d=a("../model/CameraState"),e="http://www.w3.org/2000/svg",f=Object.create(d.CameraState);c.Camera=f,f.init=function(a,b){if(d.CameraState.init.call(this,a.svgRoot),this.viewport=a,this.layer=b,this.selected=!0,this.svgClipRect=document.createElementNS(e,"rect"),a.editMode){this.maskValue=0;var c=document.createElementNS(e,"mask"),f=a.makeUniqueId("sozi-mask-");c.setAttribute("id",f),a.svgRoot.appendChild(c),this.svgMaskRect=document.createElementNS(e,"rect"),c.appendChild(this.svgMaskRect),this.svgClipRect.setAttribute("fill","white"),c.appendChild(this.svgClipRect),this.svgClipOutlineRect1=document.createElementNS(e,"rect"),this.svgClipOutlineRect1.setAttribute("stroke","black"),this.svgClipOutlineRect1.setAttribute("fill","none"),a.svgRoot.appendChild(this.svgClipOutlineRect1),this.svgClipOutlineRect2=document.createElementNS(e,"rect"),this.svgClipOutlineRect2.setAttribute("stroke","white"),this.svgClipOutlineRect2.setAttribute("fill","none"),this.svgClipOutlineRect2.setAttribute("stroke-dasharray","2,2"),a.svgRoot.appendChild(this.svgClipOutlineRect2),this.concealClipping()}else{var g=document.createElementNS(e,"clipPath"),h=a.makeUniqueId("sozi-clip-path-");g.setAttribute("id",h),g.appendChild(this.svgClipRect),a.svgRoot.appendChild(g)}return this.svgTransformGroups=b.svgNodes.map(function(b){var c=document.createElementNS(e,"g");a.svgRoot.insertBefore(c,b),a.editMode?c.setAttribute("mask","url(#"+f+")"):c.setAttribute("clip-path","url(#"+h+")");var d=document.createElementNS(e,"g");return d.appendChild(b),c.appendChild(d),d}),this},f.revealClipping=function(){this.maskValue=64,this.svgClipOutlineRect1.style.display="inline",this.svgClipOutlineRect2.style.display="inline"},f.concealClipping=function(){this.maskValue=0,this.svgClipOutlineRect1.style.display="none",this.svgClipOutlineRect2.style.display="none"},Object.defineProperty(f,"scale",{get:function(){return Math.min(this.viewport.width/this.width,this.viewport.height/this.height)}}),f.rotate=function(a){return this.restoreAspectRatio(),this.setAngle(this.angle+a).update()},f.zoom=function(a,b,c){return this.width/=a,this.height/=a,this.restoreAspectRatio(),this.translate((1-a)*(b-this.viewport.width/2),(1-a)*(c-this.viewport.height/2))},f.translate=function(a,b){var c=this.scale,d=this.angle*Math.PI/180,e=Math.sin(d),f=Math.cos(d);return this.cx-=(a*f-b*e)/c,this.cy-=(a*e+b*f)/c,this.restoreAspectRatio(),this.update()},f.clip=function(a,b,c,d){this.clipped=!0;var e=this.scale,f=Math.abs(c-a)+1,g=Math.abs(d-b)+1;return this.clipXOffset=(Math.min(a,c)-(this.viewport.width-f)/2)*this.width/f,this.clipYOffset=(Math.min(b,d)-(this.viewport.height-g)/2)*this.height/g,this.clipWidthFactor=f/this.width/e,this.clipHeightFactor=g/this.height/e,this.update()},f.restoreAspectRatio=function(){var a=this.viewport.width/this.viewport.height,b=this.width/this.height,c=a/b;c>1?(this.width*=c,this.clipped&&(this.clipWidthFactor/=c)):(this.height/=c,this.clipped&&(this.clipHeightFactor*=c))},f.getCandidateReferenceElement=function(){if(!this.svgRoot.getIntersectionList)return this.svgRoot;var a=this.svgRoot.createSVGRect();a.x=0,a.y=0,a.width=this.viewport.width,a.height=this.viewport.height;for(var b,c=this.viewport.width*this.viewport.height,d=this.svgRoot.getIntersectionList(a,this.layer.svgNodes[0]),e=-1,f=0;f<d.length;f++){var g=d[f];if(g.hasAttribute("id")){var h=g.getBoundingClientRect(),i=h.width*h.height,j=Math.max(h.left,this.viewport.x),k=Math.max(h.top,this.viewport.y),l=Math.min(h.right,this.viewport.x+this.viewport.width),m=Math.min(h.bottom,this.viewport.y+this.viewport.height),n=(l-j)*(m-k),o=c+i-2*n;(0>e||e>o)&&(e=o,b=g)}}return b},Object.defineProperty(f,"clipRect",{get:function(){var a,b,c,d;if(this.clipped){var e=this.scale;a=Math.round(this.width*this.clipWidthFactor*e),b=Math.round(this.height*this.clipHeightFactor*e),c=Math.round((this.viewport.width-a)/2+this.clipXOffset*this.clipWidthFactor*e),d=Math.round((this.viewport.height-b)/2+this.clipYOffset*this.clipHeightFactor*e)}else a=this.viewport.width,b=this.viewport.height,c=0,d=0;return{width:a,height:b,x:c,y:d}}}),f.update=function(){var a=this,b=this.clipRect;this.svgClipRect.setAttribute("x",b.x),this.svgClipRect.setAttribute("y",b.y),this.svgClipRect.setAttribute("width",b.width),this.svgClipRect.setAttribute("height",b.height),this.viewport.editMode&&(this.svgMaskRect.setAttribute("fill","rgb("+this.maskValue+","+this.maskValue+","+this.maskValue+")"),this.svgMaskRect.setAttribute("x",0),this.svgMaskRect.setAttribute("y",0),this.svgMaskRect.setAttribute("width",this.viewport.width),this.svgMaskRect.setAttribute("height",this.viewport.height),this.svgClipOutlineRect1.setAttribute("x",b.x),this.svgClipOutlineRect1.setAttribute("y",b.y),this.svgClipOutlineRect1.setAttribute("width",b.width),this.svgClipOutlineRect1.setAttribute("height",b.height),this.svgClipOutlineRect2.setAttribute("x",b.x),this.svgClipOutlineRect2.setAttribute("y",b.y),this.svgClipOutlineRect2.setAttribute("width",b.width),this.svgClipOutlineRect2.setAttribute("height",b.height));var c=this.scale,d=this.viewport.width/c/2-this.cx,e=this.viewport.height/c/2-this.cy;return this.svgTransformGroups.forEach(function(b){b.setAttribute("transform","scale("+c+")translate("+d+","+e+")rotate("+-a.angle+","+a.cx+","+a.cy+")"),b.setAttribute("opacity",a.opacity)}),this},f.interpolate=function(a,b,c,d,e,f,g){function h(a,b){return b*j+a*k}function i(a,b){var d=(e>0?Math.max(a,b):Math.min(a,b))*(1+e),f=a-d,g=b-d,h=Math.sqrt(f/g),i=h/(1+h),j=f/i/i,k=c-i;return j*k*k+d}var j=d(c),k=1-j;if(e?(this.width=i(a.width,b.width),this.height=i(a.height,b.height)):(this.width=h(a.width,b.width),this.height=h(a.height,b.height)),f){var l=f.getTotalLength(),m=f.getPointAtLength(g?l:0),n=f.getPointAtLength(g?0:l),o=f.getPointAtLength(l*(g?k:j));this.cx=o.x+h(a.cx-m.x,b.cx-n.x),this.cy=o.y+h(a.cy-m.y,b.cy-n.y)}else this.cx=h(a.cx,b.cx),this.cy=h(a.cy,b.cy);this.opacity=h(a.opacity,b.opacity),b.angle-a.angle>180?this.angle=h(a.angle,b.angle-360):b.angle-a.angle<-180?this.angle=h(a.angle-360,b.angle):this.angle=h(a.angle,b.angle),this.clipped=!0;var p=this.scale,q={clipXOffset:0,clipYOffset:0,clipWidthFactor:this.viewport.width/this.width/p,clipHeightFactor:this.viewport.height/this.height/p},r=a.clipped?a:q,s=b.clipped?b:q;for(var t in q)this[t]=h(r[t],s[t])}},{"../model/CameraState":1}],6:[function(a,b,c){function d(a){w=a,u=document.querySelector(".sozi-frame-list"),v=p.toArray(u.querySelectorAll("li a")),v.forEach(function(a){a.addEventListener("click",function(b){0===b.button&&(w.previewFrame(parseInt(a.dataset.frameIndex)),b.preventDefault())})}),x=Object.create(q.Animator).init(),x.addListener("step",k),window.addEventListener("keypress",j,!1),w.viewport.addListener("mouseDown",l),u.addEventListener("mouseout",m,!1),a.addListener("frameChange",n),e(y)}function e(a){A=a,u.style.left=A*u.clientWidth+"px"}function f(a){w.pause(),y=A,z=a,x.start(Math.abs(z-y)*t)}function g(){f(0)}function h(){f(-1)}function i(){f(-1-z)}function j(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){switch(a.charCode||a.which){case 84:case 116:i();break;default:return}a.stopPropagation(),a.preventDefault()}}function k(a){var b=s.ease(a);e(z*b+y*(1-b))}function l(a){1===a&&i()}function m(a){for(var b=a.relatedTarget;b&&b!==u&&b!==document.documentElement;)b=b.parentNode;b!==u&&(h(),a.stopPropagation())}function n(){v.forEach(function(a){a.className=parseInt(a.dataset.frameIndex)===w.currentFrameIndex?"current":""})}var o=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.init=d,c.open=g,c.close=h,c.toggle=i;var p=a("../utils"),q=a("./Animator"),r=a("./Timing"),s=o(r);const t=500;var u,v,w,x,y=-1,z=-1,A=y},{"../utils":14,"./Animator":4,"./Timing":11}],7:[function(a,b,c){function d(a){var b=document.querySelector(".sozi-frame-number");a.addListener("frameChange",function(){b.innerHTML=a.currentFrameIndex+1,b.style.visibility=a.currentFrame.showFrameNumber?"visible":"hidden"}),b.addEventListener("click",g.open)}var e=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.init=d;var f=a("./FrameList"),g=e(f)},{"./FrameList":6}],8:[function(a,b,c){function d(a){h=a,window.addEventListener("hashchange",f,!1),h.addListener("frameChange",g)}function e(){if(window.location.hash){var a=window.location.hash.slice(1),b=h.presentation.getFrameWithId(a);if(b)return b.index;var c=parseInt(a);return!isNaN(c)&&c>0&&c<=h.presentation.frames.length?c-1:h.currentFrameIndex}return h.currentFrameIndex}function f(){var a=e();h.currentFrameIndex!==a&&h.moveToFrame(a)}function g(){window.location.hash="#"+h.currentFrame.frameId}Object.defineProperty(c,"__esModule",{value:!0}),c.init=d,c.getFrameIndex=e;var h},{}],9:[function(a,b,c){function d(a){a.stopPropagation()}function e(){var a=g.currentFrame.frameId;a in l&&l[a].forEach(function(a){a.play()}),a in m&&m[a].forEach(function(a){a.pause()})}function f(a){g=a,g.addListener("frameChange",e);for(var b,c=g.presentation.document.root,f=c.attributes,n=0;n<f.length;n++)if(f[n].value===j){b=f[n].name.slice(6);break}if(b){var o=c.getElementsByTagName(b+":video"),p=c.getElementsByTagName(b+":audio"),q=h.toArray(o).concat(h.toArray(p)),r=[];q.forEach(function(a){var c=a.parentNode,e=a.localName.slice(b.length+1),f=document.createElementNS(k,"source");f.setAttribute("type",a.getAttribute(b+":type")),f.setAttribute("src",a.getAttribute(b+":src"));for(var g=0;g<r.length&&r[g].rect!==c;g+=1);if(g===r.length){c.setAttribute("visibility","hidden");var h=document.createElementNS(k,e);h.setAttribute("controls","controls"),"video"===e&&(h.setAttribute("width",c.getAttribute("width")),h.setAttribute("height",c.getAttribute("height"))),h.addEventListener("click",d,!1),h.addEventListener("mousedown",d,!1),h.addEventListener("mouseup",d,!1),h.addEventListener("mousemove",d,!1),h.addEventListener("contextmenu",d,!1);var j=document.createElementNS(k,"html");j.appendChild(h);var n=document.createElementNS(i,"foreignObject");if(n.setAttribute("x",c.getAttribute("x")),n.setAttribute("y",c.getAttribute("y")),n.setAttribute("width",c.getAttribute("width")),n.setAttribute("height",c.getAttribute("height")),n.appendChild(j),c.parentNode.insertBefore(n,c.nextSibling),a.hasAttribute(b+":start-frame")){var o=a.getAttribute(b+":start-frame"),p=a.getAttribute(b+":stop-frame");o in l||(l[o]=[]),p in m||(m[p]=[]),l[o].push(h),m[p].push(h)}"true"===a.getAttribute(b+":loop")&&h.setAttribute("loop","true"),r.push({rect:a.parentNode,htmlMedia:h})}r[g].htmlMedia.appendChild(f)})}}Object.defineProperty(c,"__esModule",{value:!0}),c.init=f;var g,h=a("../utils"),i="http://www.w3.org/2000/svg",j="http://sozi.baierouge.fr",k="http://www.w3.org/1999/xhtml",l={},m={}},{"../utils":14}],10:[function(a,b,c){var d=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0});var e=a("./Animator"),f=a("./Timing"),g=d(f),h=a("../model/CameraState"),i=a("events"),j=500,k=0,l="ease",m=1.05,n=5,o=Object.create(i.EventEmitter.prototype);c.Player=o,o.init=function(a,b){return i.EventEmitter.call(this),this.viewport=a,this.presentation=b,this.animator=Object.create(e.Animator).init(),this.playing=!1,this.waitingTimeout=!1,this.currentFrameIndex=0,this.targetFrameIndex=0,this.timeoutHandle=null,this.transitions=[],this.setupEventHandlers(),this},o.setupEventHandlers=function(){this.viewport.addListener("click",this.onClick.bind(this)),this.viewport.addListener("dragStart",this.pause.bind(this)),this.viewport.addListener("userChangeState",this.pause.bind(this)),window.addEventListener("keydown",this.onKeyDown.bind(this),!1),window.addEventListener("keypress",this.onKeyPress.bind(this),!1),this.animator.addListener("step",this.onAnimatorStep.bind(this)),this.animator.addListener("stop",this.onAnimatorStop.bind(this)),this.animator.addListener("done",this.onAnimatorDone.bind(this))},o.onClick=function(a){switch(a){case 0:this.moveToNext();break;case 2:this.moveToPrevious()}},o.onKeyDown=function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){switch(a.keyCode){case 36:a.shiftKey?this.jumpToFirst():this.moveToFirst();break;case 35:a.shiftKey?this.jumpToLast():this.moveToLast();break;case 38:case 33:case 37:a.shiftKey?this.jumpToPrevious():this.moveToPrevious();break;case 40:case 34:case 39:case 13:case 32:a.shiftKey?this.jumpToNext():this.moveToNext();break;default:return}a.stopPropagation(),a.preventDefault()}},o.onKeyPress=function(a){if(!(a.altKey||a.ctrlKey||a.metaKey)){switch(a.charCode||a.which){case 43:this.viewport.zoom(m,this.viewport.width/2,this.viewport.height/2),this.pause();break;case 45:this.viewport.zoom(1/m,this.viewport.width/2,this.viewport.height/2),this.pause();break;case 82:this.viewport.rotate(-n),this.pause();break;case 114:this.viewport.rotate(n),this.pause();break;case 80:case 112:this.playing?this.pause():this.resume();break;default:return}a.stopPropagation(),a.preventDefault()}},Object.defineProperty(o,"currentFrame",{get:function(){return this.presentation.frames[this.currentFrameIndex]}}),Object.defineProperty(o,"targetFrame",{get:function(){return this.presentation.frames[this.targetFrameIndex]}}),Object.defineProperty(o,"previousFrameIndex",{get:function(){var a=this.animator.running?this.targetFrameIndex:this.currentFrameIndex;return(a+this.presentation.frames.length-1)%this.presentation.frames.length}}),Object.defineProperty(o,"nextFrameIndex",{get:function(){var a=this.animator.running?this.targetFrameIndex:this.currentFrameIndex;return(a+1)%this.presentation.frames.length}}),o.showCurrentFrame=function(){return this.viewport.setAtStates(this.currentFrame.cameraStates).update(),this.emit("frameChange"),this},o.playFromIndex=function(a){return this.playing=!0,this.waitingTimeout=!1,this.targetFrameIndex=a,this.currentFrameIndex=a,this.showCurrentFrame(),this.waitTimeout(),this},o.pause=function(){return this.animator.stop(),this.waitingTimeout&&(window.clearTimeout(this.timeoutHandle),this.waitingTimeout=!1),this.playing=!1,this.targetFrameIndex=this.currentFrameIndex,this},o.resume=function(){return this.playFromIndex(this.currentFrameIndex),this},o.waitTimeout=function(){return this.currentFrame.timeoutEnable&&(this.waitingTimeout=!0,this.timeoutHandle=window.setTimeout(this.moveToFrame.bind(this,this.nextFrameIndex),this.currentFrame.timeoutMs)),this},o.jumpToFrame=function(a){return this.pause(),this.targetFrameIndex=a,this.currentFrameIndex=a,this.showCurrentFrame(),this},o.jumpToFirst=function(){return this.jumpToFrame(0)},o.jumpToLast=function(){return this.jumpToFrame(this.presentation.frames.length-1)},o.jumpToPrevious=function(){return this.jumpToFrame(this.previousFrameIndex)},o.jumpToNext=function(){return this.jumpToFrame(this.nextFrameIndex)},o.moveToFrame=function(a){var b=this;this.waitingTimeout&&(window.clearTimeout(this.timeoutHandle),this.waitingTimeout=!1),this.targetFrameIndex=a;var c=null,d=j,e=!1,f=!1;return a===this.nextFrameIndex?(d=this.targetFrame.transitionDurationMs,c=this.targetFrame.layerProperties,e=!0):a===this.previousFrameIndex&&(d=this.currentFrame.transitionDurationMs,c=this.currentFrame.layerProperties,e=!0,f=!0),this.playing=!0,this.viewport.cameras.forEach(function(a){var d=g[l],h=k,i=null;if(c){var j=c[a.layer.index];h=j.transitionRelativeZoom,d=g[j.transitionTimingFunction],e&&(i=j.transitionPath),f&&(d=d.reverse)}b.setupTransition(a,d,h,i,f)}),this.animator.start(d),this},o.moveToFirst=function(){return this.moveToFrame(0)},o.moveToLast=function(){return this.moveToFrame(this.presentation.frames.length-1)},o.moveToPrevious=function(){for(var a=this.previousFrameIndex;a>=0;a--){var b=this.presentation.frames[a];if(!b.timeoutEnable||0!==b.timeoutMs){this.moveToFrame(a);break}}return this},o.moveToNext=function(){return this.moveToFrame(this.nextFrameIndex)},o.moveToCurrent=function(){return this.moveToFrame(this.currentFrameIndex)},o.previewFrame=function(a){var b=this;return this.targetFrameIndex=a,this.viewport.cameras.forEach(function(a){b.setupTransition(a,g[l],k)}),this.animator.start(j),this},o.setupTransition=function(a,b,c,d,e){return this.animator.running&&this.animator.stop(),this.transitions.push({camera:a,initialState:Object.create(h.CameraState).initFrom(a),finalState:this.targetFrame.cameraStates[a.layer.index],timingFunction:b,relativeZoom:c,svgPath:d,reverse:e}),this},o.onAnimatorStep=function(a){this.transitions.forEach(function(b){b.camera.interpolate(b.initialState,b.finalState,a,b.timingFunction,b.relativeZoom,b.svgPath,b.reverse),b.camera.update()})},o.onAnimatorStop=function(){this.transitions=[],this.currentFrameIndex=this.targetFrameIndex,this.emit("frameChange")},o.onAnimatorDone=function(){this.transitions=[],this.currentFrameIndex=this.targetFrameIndex,this.emit("frameChange"),this.playing&&this.waitTimeout()}},{"../model/CameraState":1,"./Animator":4,"./Timing":11,events:15}],11:[function(a,b,c){function d(a,b){return 1-3*b+3*a}function e(a,b){return 3*b-6*a}function f(a){return 3*a}function g(a,b,c,d){return((b*a+c)*a+d)*a}function h(a,b,c,d){return(3*b*a+2*c)*a+d}function i(a,b,c,i){var j=d(a,c),k=e(a,c),l=f(a),m=d(b,i),n=e(b,i),o=f(b);return a===b&&c===i?function(a){return a}:function(a){for(var b=a,c=0;4>c;c++){var d=h(b,j,k,l);if(0===d)break;var e=g(b,j,k,l)-a;b-=e/d}return g(b,m,n,o)}}function j(a,b){var c="start"===b?Math.ceil:Math.floor;return function(b){return c(a*b)/a}}function k(a){return a>=.5?1:0}Object.defineProperty(c,"__esModule",{value:!0}),c.makeBezier=i,c.makeSteps=j,c.stepMiddle=k;var l=i(0,0,1,1);c.linear=l,l.reverse=l;var m=i(.25,.1,.25,1);c.ease=m,m.reverse=m;var n=i(.42,0,1,1);c.easeIn=n;var o=i(0,0,.58,1);c.easeOut=o,n.reverse=o,o.reverse=n;var p=i(.42,0,.58,1);c.easeInOut=p,p.reverse=p;var q=j(1,"start");c.stepStart=q;var r=j(1,"end");c.stepEnd=r,q.reverse=r,r.reverse=q,k.reverse=k},{}],12:[function(a,b,c){Object.defineProperty(c,"__esModule",{value:!0});var d=a("./Camera"),e=a("events"),f=0,g=5,h=1.05,i=5,j=200,k=3,l=Object.create(e.EventEmitter.prototype);c.Viewport=l,l.init=function(a,b){return e.EventEmitter.call(this),this.presentation=a,this.editMode=!!b,this.cameras=[],this.mouseDragX=0,this.mouseDragY=0,this.dragMode="translate",this.clipMode={cameras:[],operation:"select"},this.showHiddenElements=!1,this.wheelTimeout=null,this.dragHandler=this.onDrag.bind(this),this.dragEndHandler=this.onDragEnd.bind(this),this},l.makeUniqueId=function(a){var b,c=Math.floor(1e3*(1+9*Math.random()));do b=a+c,c++;while(this.svgRoot.getElementById(b));return b},l.onLoad=function(){var a=this;this.svgRoot.addEventListener("mousedown",this.onMouseDown.bind(this),!1),this.svgRoot.addEventListener("mousemove",this.onMouseMove.bind(this),!1),this.svgRoot.addEventListener("contextmenu",this.onContextMenu.bind(this),!1);var b="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";return this.svgRoot.addEventListener(b,this.onWheel.bind(this),!1),this.cameras=this.presentation.layers.map(function(b){return Object.create(d.Camera).init(a,b)}),this},Object.defineProperty(l,"svgRoot",{get:function(){return this.presentation.document.root}}),l.getLayer=function(a){return this.layers.filter(function(b){return b.nodeId===a})[0]},l.onContextMenu=function(a){a.stopPropagation(),a.preventDefault(),this.emit("click",2,a)},l.onMouseMove=function(a){if("clip"===this.dragMode)switch(this.getClipMode(a).operation){case"select":this.svgRoot.style.cursor="crosshair";break;case"n":
case"s":this.svgRoot.style.cursor="ns-resize";break;case"w":case"e":this.svgRoot.style.cursor="ew-resize";break;case"nw":case"se":this.svgRoot.style.cursor="nwse-resize";break;case"ne":case"sw":this.svgRoot.style.cursor="nesw-resize";break;case"move":this.svgRoot.style.cursor="move";break;default:this.svgRoot.style.cursor="default"}else this.svgRoot.style.cursor="default"},l.onMouseDown=function(a){a.stopPropagation(),a.preventDefault(),a.button===f&&(this.mouseDragged=!1,this.mouseDragX=this.mouseDragStartX=a.clientX,this.mouseDragY=this.mouseDragStartY=a.clientY,document.documentElement.addEventListener("mousemove",this.dragHandler,!1),document.documentElement.addEventListener("mouseup",this.dragEndHandler,!1),"clip"===this.dragMode&&(this.clipMode=this.getClipMode(a))),this.emit("mouseDown",a.button)},l.getClipMode=function(a){var b=a.clientX-this.x,c=a.clientY-this.y,d={nw:[],sw:[],ne:[],se:[],w:[],e:[],n:[],s:[],move:[]},e=this.cameras.filter(function(a){return a.selected});e.forEach(function(a){var e=a.clipRect;if(b>=e.x-k&&b<=e.x+e.width+k&&c>=e.y-k&&c<=e.y+e.height+k){var f=b<=e.x+k,g=b>=e.x+e.width-k-1,h=c<=e.y+k,i=c>=e.y+e.height-k-1,j=f||g||h||i?(h?"n":i?"s":"")+(f?"w":g?"e":""):"move";d[j].push(a)}});for(var f in d)if(d[f].length)return{cameras:d[f],operation:f};return{cameras:e,operation:"select"}},l.onDrag=function(a){a.stopPropagation();var b=a.clientX-this.x-this.width/2,c=a.clientY-this.y-this.height/2,d=180*Math.atan2(c,b)/Math.PI,e=a.clientX,f=a.clientY,h=Math.sqrt(b*b+c*c),i=a.clientX-this.mouseDragX,j=a.clientY-this.mouseDragY;if(!this.mouseDragged&&(Math.abs(i)>g||Math.abs(j)>g)&&(this.mouseDragged=!0,this.rotateStart=this.rotatePrev=d,this.translateStartX=this.translateXPrev=e,this.translateStartY=this.translateYPrev=f,this.zoomPrev=h,this.emit("dragStart")),this.mouseDragged){var k=this.dragMode;switch("translate"==k&&(a.altKey?k="scale":a.shiftKey&&(k="rotate")),k){case"scale":0!==this.zoomPrev&&this.zoom(h/this.zoomPrev,this.width/2,this.height/2),this.zoomPrev=h;break;case"rotate":a.ctrlKey&&(d=10*Math.round((d-this.rotateStart)/10)+this.rotateStart),this.rotate(this.rotatePrev-d),this.rotatePrev=d;break;case"clip":switch(this.clipMode.operation){case"select":this.clip(this.mouseDragStartX-this.x,this.mouseDragStartY-this.y,this.mouseDragX-this.x,this.mouseDragY-this.y);break;case"move":this.clipRel(i,j,i,j);break;case"w":this.clipRel(i,0,0,0);break;case"e":this.clipRel(0,0,i,0);break;case"n":this.clipRel(0,j,0,0);break;case"s":this.clipRel(0,0,0,j);break;case"nw":this.clipRel(i,j,0,0);break;case"ne":this.clipRel(0,j,i,0);break;case"sw":this.clipRel(i,0,0,j);break;case"se":this.clipRel(0,0,i,j)}break;default:a.ctrlKey&&(Math.abs(e-this.translateStartX)>=Math.abs(f-this.translateStartY)?f=this.translateStartY:e=this.translateStartX),this.translate(e-this.translateXPrev,f-this.translateYPrev),this.translateXPrev=e,this.translateYPrev=f}this.mouseDragX=a.clientX,this.mouseDragY=a.clientY}},l.onDragEnd=function(a){a.stopPropagation(),a.preventDefault(),a.button===f?(this.mouseDragged?(this.emit("dragEnd"),this.emit("userChangeState")):this.emit("click",a.button,a),document.documentElement.removeEventListener("mousemove",this.dragHandler,!1),document.documentElement.removeEventListener("mouseup",this.dragEndHandler,!1)):this.emit("click",a.button,a)},l.onWheel=function(a){var b=this;null!==this.wheelTimeout&&window.clearTimeout(this.wheelTimeout),a.stopPropagation(),a.preventDefault();var c=0;c=a.wheelDelta?a.wheelDelta:a.detail?-a.detail:-a.deltaY,0!==c&&(a.shiftKey?this.rotate(c>0?i:-i):this.zoom(c>0?h:1/h,a.clientX-this.x,a.clientY-this.y)),this.wheelTimeout=window.setTimeout(function(){b.wheelTimeout=null,b.emit("userChangeState")},j)},Object.defineProperty(l,"x",{get:function(){return this.svgRoot.getScreenCTM().e}}),Object.defineProperty(l,"y",{get:function(){return this.svgRoot.getScreenCTM().f}}),Object.defineProperty(l,"width",{get:function(){return this.svgRoot===document.documentElement?window.innerWidth:this.svgRoot.parentNode.clientWidth}}),Object.defineProperty(l,"height",{get:function(){return this.svgRoot===document.documentElement?window.innerHeight:this.svgRoot.parentNode.clientHeight}}),l.repaint=function(){var a=this;return this.svgRoot.setAttribute("width",this.width),this.svgRoot.setAttribute("height",this.height),this.update(),this.presentation.elementsToHide.forEach(function(b){var c=document.getElementById(b);c&&(c.style.visibility=a.showHiddenElements?"visible":"hidden")}),this},l.update=function(){return this.cameras.forEach(function(a){a.update()}),this},l.setAtStates=function(a){var b=this;return a.forEach(function(a,c){b.cameras[c].initFrom(a)}),this},l.translate=function(a,b){return this.cameras.forEach(function(c){c.selected&&c.translate(a,b)}),this},l.zoom=function(a,b,c){return this.cameras.forEach(function(d){d.selected&&d.zoom(a,b,c)}),this},l.rotate=function(a){return this.cameras.forEach(function(b){b.selected&&b.rotate(a)}),this},l.clip=function(a,b,c,d){return this.clipMode.cameras.forEach(function(e){e.clip(a,b,c,d)}),this},l.clipRel=function(a,b,c,d){return this.clipMode.cameras.forEach(function(e){var f=e.clipRect;a<=f.width+c-1&&b<=f.height+d-1&&e.clip(f.x+a,f.y+b,f.x+f.width+c-1,f.y+f.height+d-1)}),this}},{"./Camera":5,events:15}],13:[function(a,b,c){function d(a,b){h[a]=b}Object.defineProperty(c,"__esModule",{value:!0}),c.registerHandler=d;var e=a("../utils"),f="http://www.w3.org/2000/svg",g=["g","image","path","rect","circle","ellipse","line","polyline","polygon","text","clippath"],h={},i={matches:function(a){return!0},transform:function(a){return this},isLayer:function(a){return!0},getLabel:function(a){return null}};c.DefaultHandler=i;var j={asText:"",root:void 0,handler:i,init:function(a){this.root=a,this.handler=i;for(var b in h)if(h[b].matches(a)){console.log("Using handler: "+b),this.handler=h[b];break}return this},get isValidSVG(){return this.root instanceof SVGSVGElement},isLayer:function(a){return a instanceof SVGGElement&&a.hasAttribute("id")&&this.handler.isLayer(a)},"import":function(a){var b=this;this.asText="",this.root=void 0;var c=document.createElement("div");for(c.innerHTML=a;c.firstChild!==c.firstElementChild;)c.removeChild(c.firstChild);if(this.init(c.firstChild),this.isValidSVG){this.handler.transform(this.root),this.root.removeAttribute("viewBox"),this.root.style.width=this.root.style.height="auto";var d=e.toArray(this.root.getElementsByTagName("script"));d.forEach(function(a){a.parentNode.removeChild(a)});var h=e.toArray(this.root.getElementsByTagName("a"));h.forEach(function(a){a.addEventListener("mousedown",function(a){return a.stopPropagation()},!1)});var i=document.createElementNS(f,"g");return e.toArray(this.root.childNodes).forEach(function(a){void 0===a.tagName?b.root.removeChild(a):g.indexOf(a.localName)>=0&&(b.isLayer(a)?i.firstChild&&(b.root.insertBefore(i,a),i=document.createElementNS(f,"g")):i.appendChild(a))}),i.firstChild&&this.root.appendChild(i),this.asText=c.innerHTML,this}}};c.SVGDocument=j},{"../utils":14}],14:[function(a,b,c){function d(a){return Array.prototype.slice.call(a)}Object.defineProperty(c,"__esModule",{value:!0}),c.toArray=d},{}],15:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];c.apply(this,f)}else if(g(c)){for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];for(j=c.slice(),d=j.length,i=0;d>i;i++)j[i].apply(this,f)}return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned){var c;c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())}return this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-->0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(0>d)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?e(a._events[b])?1:a._events[b].length:0}},{}]},{},[3]);</script>
</body>
</html>
{"aspectWidth":4,"aspectHeight":3,"frames":[{"frameId":"frame6730","title":"Star","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"link":false,"referenceElementId":"","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"link":false,"referenceElementId":"","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":153.2092890636677,"cy":279.8595264261317,"width":223.168900214638,"height":167.49875880442198,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":153.2092890636677,"cy":279.8595264261317,"width":223.168900214638,"height":167.49875880442198,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}},"cameraOffsets":{}},{"frameId":"frame9286","title":"Spiral","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"link":false,"referenceElementId":"path3338","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"link":false,"referenceElementId":"path3338","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":345.7554148774435,"cy":122.34720965538449,"width":234.32734522536992,"height":175.8736967446431,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":345.7554148774435,"cy":122.34720965538449,"width":234.32734522536992,"height":175.8736967446431,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}},"cameraOffsets":{"layer1":{"deltaX":-0.37712296435336157,"deltaY":2.9638325801891767,"widthFactor":1.4552623261612196,"heightFactor":1.1174658057644629,"deltaAngle":0},"__sozi_auto__":{"deltaX":-0.37712296435336157,"deltaY":2.9638325801891767,"widthFactor":1.4552623261612196,"heightFactor":1.1174658057644629,"deltaAngle":0}}},{"frameId":"frame1960","title":"Cube","timeoutMs":0,"timeoutEnable":false,"transitionDurationMs":1000,"showInFrameList":true,"showFrameNumber":true,"layerProperties":{"layer1":{"link":false,"referenceElementId":"path3350","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""},"__sozi_auto__":{"link":false,"referenceElementId":"path3350","referenceElementAuto":true,"transitionTimingFunction":"linear","transitionRelativeZoom":0,"transitionPathId":""}},"cameraStates":{"layer1":{"cx":366.0175036507687,"cy":316.53894668050134,"width":246.0437124866385,"height":184.6673815818753,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1},"__sozi_auto__":{"cx":366.0175036507687,"cy":316.53894668050134,"width":246.0437124866385,"height":184.6673815818753,"opacity":1,"angle":0,"clipped":false,"clipXOffset":0,"clipYOffset":0,"clipWidthFactor":1,"clipHeightFactor":1}},"cameraOffsets":{"layer1":{"deltaX":59.572313221081174,"deltaY":0.5650697273763399,"widthFactor":5.274867297259816,"heightFactor":1.0277694569620834,"deltaAngle":0},"__sozi_auto__":{"deltaX":59.572313221081174,"deltaY":0.5650697273763399,"widthFactor":5.274867297259816,"heightFactor":1.0277694569620834,"deltaAngle":0}}}],"elementsToHide":[],"selectedFrames":["frame1960"],"selectedLayers":["layer1","__sozi_auto__"],"editableLayers":[]}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment