|
| 1 | +<!---RevealJS---> |
| 2 | +<script src="dependencies/revealjs/lib/js/head.min.js"></script> |
| 3 | +<script src="dependencies/revealjs/js/reveal.js"></script> |
| 4 | +<script> |
| 5 | + // Full list of configuration options available here: |
| 6 | + // https://github.com/hakimel/reveal.js#configuration |
| 7 | + Reveal.initialize({ |
| 8 | + controls: false, |
| 9 | + progress: true, |
| 10 | + history: true, |
| 11 | + center: true, |
| 12 | + |
| 13 | + theme: Reveal.getQueryHash().theme, // available themes are in /css/theme |
| 14 | + transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none |
| 15 | + |
| 16 | + // Optional libraries used to extend on reveal.js |
| 17 | + dependencies: [ |
| 18 | + { src: 'dependencies/revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } }, |
| 19 | + { src: 'dependencies/revealjs/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } |
| 20 | + ] |
| 21 | + }); |
| 22 | + |
| 23 | + // SnapSVG |
| 24 | + // Run once at startup to inject all SVGs |
| 25 | + loadAllSvg(); |
| 26 | + |
| 27 | + function loadAllSvg(){ |
| 28 | + var els = document.getElementsByTagName("svg"); |
| 29 | + |
| 30 | + for(var elCount = 0; elCount < els.length; elCount++){ |
| 31 | + injectSvg(els[elCount]); |
| 32 | + } |
| 33 | + } |
| 34 | + |
| 35 | + function injectSvg(canvasTarget){ |
| 36 | + if(canvasTarget){ |
| 37 | + Snap.load( |
| 38 | + canvasTarget.getAttribute("data-path"), |
| 39 | + function (frag) { |
| 40 | + sCanvas = Snap("#" + canvasTarget.getAttribute("id")); |
| 41 | + fCanvas = Snap(); |
| 42 | + sCanvas.clear(); |
| 43 | + |
| 44 | + //Determine if grouped build-steps present |
| 45 | + var buildStepBase = frag.select("#base"); |
| 46 | + buildStepGroups = frag.selectAll("[id^=step-]"), |
| 47 | + buildStepCount = buildStepGroups.length, |
| 48 | + buildStep = 0; |
| 49 | + |
| 50 | + //Setup the container canvas boundary sizing |
| 51 | + setCanvasBBox(frag, canvasTarget); |
| 52 | + |
| 53 | + // Show the first build step when available |
| 54 | + // Otherwise just show entire graphic |
| 55 | + if(buildStepCount > 0){ |
| 56 | + // Include the non-fragment base layout/visuals |
| 57 | + fCanvas.append(buildStepBase); |
| 58 | + // fCanvas.append(buildStepGroups[buildStep]); |
| 59 | + |
| 60 | + for(; buildStep < buildStepCount; buildStep++){ |
| 61 | + |
| 62 | + // Supports fragment in-out transitions by |
| 63 | + // wrapping in a group and applying a second |
| 64 | + // fragment class |
| 65 | + if(buildStepGroups[buildStep].node.id.match(/in-out/)){ |
| 66 | + var tG = fCanvas.g(buildStepGroups[buildStep]); |
| 67 | + buildStepGroups[buildStep].attr("class", "fragment fade-out"); |
| 68 | + tG.attr("class", "fragment"); |
| 69 | + fCanvas.append(tG); |
| 70 | + } |
| 71 | + else{ |
| 72 | + buildStepGroups[buildStep].attr("class", "fragment"); |
| 73 | + fCanvas.append(buildStepGroups[buildStep]); |
| 74 | + } |
| 75 | + } |
| 76 | + } else{ |
| 77 | + //No "steps" to build out, ensure boundary guide |
| 78 | + //is not rendered |
| 79 | + frag.select("#boundary").remove(); |
| 80 | + fCanvas.append(frag); |
| 81 | + } |
| 82 | + |
| 83 | + sCanvas.append(fCanvas); |
| 84 | + } |
| 85 | + ); |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | + function setCanvasBBox(canvas, target){ |
| 90 | + var boundary, |
| 91 | + maxWidth, |
| 92 | + maxHeight; |
| 93 | + |
| 94 | + boundary = canvas.select("#boundary").select(":first-child").getBBox(); |
| 95 | + maxWidth = Math.ceil(boundary.width); |
| 96 | + maxHeight = Math.ceil(boundary.height); |
| 97 | + |
| 98 | + target.setAttribute("height", (((maxHeight/maxWidth)*100)+"%")); |
| 99 | + target.setAttribute("viewBox", "0 0 " + maxWidth + " " + maxHeight); |
| 100 | + return canvas; |
| 101 | + } |
| 102 | +</script> |
| 103 | + |
| 104 | +<script src="dependencies/plugins/launcher/launcher.js"></script> |
| 105 | +<script src="dependencies/plugins/help/help.js"></script> |
0 commit comments