summaryrefslogtreecommitdiff
path: root/deck.js/samples/deck-svg.html
blob: ee9877976be9e1c48d12989caeeb729af02cc887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->  <html class="no-js" lang="en"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
            
        <title>deck.svg.js test/demo</title>
            
        <meta name="description" content="deck.*.js">
        <meta name="author" content="Rémi Emonet">
        <!--meta name="viewport" content="width=1024, user-scalable=no"/-->
            
        <!-- Core and extension CSS files -->
        <link rel="stylesheet" href="../core/deck.core.css">
        <link rel="stylesheet" href="../extensions/status/deck.status.css">
        <link rel="stylesheet" href="../extensions/hash/deck.hash.css">
            
        <!-- Style theme. More available in /themes/style/ or create your own. -->
        <link rel="stylesheet" href="../themes/style/neon.css">
            
        <!-- Transition theme. More available in /themes/transition/ or create your own. -->
        <!--link rel="stylesheet" href="../themes/transition/horizontal-slide.css"-->
            
        <script src="../modernizr.custom.js"></script>
            
        <!-- Grab CDN jQuery, with a protocol relative URL; fall back to local if offline -->
        <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
        <script>window.jQuery || document.write('<script src="../jquery-1.7.2.min.js"><\/script>')</script>
            
        <!-- Deck Core and extensions -->
        <script src="../core/deck.core.js"></script>
        <script src="../extensions/hash/deck.hash.js"></script>
        <!--script src="../extensions/status/deck.status.js"></script--->
        <script src="../extensions/fit/deck.fit.js"></script>
        <link rel="stylesheet" href="../extensions/fit/deck.fit-fs.css">

        <script src="../extensions/step/deck.step.js"></script>
        <script src="../extensions/events/deck.events.js"></script>
        <script src="../extensions/anim/deck.anim.js"></script>
        <script src="../libs/jquerysvg/jquery.svg.min.js"></script>
        <script src="../libs/jquerysvg/jquery.svganim.min.js"></script>
        <script src="../extensions/svg/deck.svg.js"></script>

            
        <style type="text/css">
            .deck-container>.slide {border: 1px dashed #333;} /* for the demo */
            .slide ul ul {margin-bottom: 0.25em;} /* remove some big spacing with neon nested lists */
            .slide h1 {font-size: 3em;}
            .slide h1 b {color: #0F0;}
            .slide h1 em {color: #445; text-shadow: none; font-size: .3em;}
            .slide h1 em {color: #445; text-shadow: none; font-size: .3em; display: inline-block;}
            .slide span.highlight {border: 1px solid red;}
            .deck-container > .slide .deck-before, .deck-container > .slide .deck-previous {opacity: 0.6;} /* <-- override darkish neon theme --> */
            div.floatright {float:right;}
            div.svgitem {display: inline-block; vertical-align: middle;}

            .svgitem #circleRedCircle {fill: #D00; stroke-width: 20px; stroke: white;}
            .style1 #circleRedCircle {fill: #D00; stroke-width: 20px; stroke: white;}
            .style2 #circleRedCircle {fill: #999; stroke-width: 5px; stroke: green;}
            .style3 #circleRedCircle {fill: yellow; stroke-width: 5px; stroke: red;}
            .style3 #circleRedCircle:hover {stroke-width: 25px; filter: blur(10px)}
            .style3 #circleBlue:hover {fill: #F00;}

            /* playing with blur: http://css-plus.com/2012/03/gaussian-blur/ */
            .style3 #circleRedCircle:hover, .style3 #circleGreen:hover {
              -webkit-transition: all 0.5s ease-out; 
                 -moz-transition: all 0.5s ease-out; 
                  -ms-transition: all 0.5s ease-out; 
                   -o-transition: all 0.5s ease-out; 
                      transition: all 0.5s ease-out;
            }
            .style3 #circleRedCircle:hover, .style3 #circleGreen:hover { -webkit-filter: blur(5px); filter: url(#blur-effect-1); }
        </style>
    </head>

<!-- for the demo, the body is not the container so it can be resized by the user -->
<body>
<svg id="svg-image-blur">
    <filter id="blur-effect-1">
        <feGaussianBlur stdDeviation="5" />
    </filter>
</svg>

This page surely has a purpose.<br/>
Use left/right arrow keys to browse the presentation.<br/>

<!-- for the demo, a resizeable wrapper around the container -->
<div class="deck-container">

<!-- Begin slides -->
<section class="slide" id="title-slide">
	<h1 title="use arrow keys to navigate">Getting started with deck.js:<br/><b>svg</b> extension
            <br/><em>use right arrow to move on</em>
            <br/><em class="ffox">(Firefox may ask for a plugin: just close the message and click on the page to give the focus back)</em>
        </h1>
</section>

<section class="slide">
    <h2>SVG Introduction</h2>
    <ul>
        <li>Scalable Vector Graphics (SVG)
            <ul>
                <li>Standard format for the web (and more)</li>
                <li>Vector graphics: arbitrary stretching, no pixels</li>
                <li>Cool editors (e.g., <a href="http://inkscape.org/">Inkscape</a>)</li>
                <li>Lot of existing SVG (smiley by <a href="http://openclipart.org/detail/77641/smiley-face-by-inky2010">inky2010</a>)</li>
            </ul>
        </li>
        <a href="http://openclipart.org/detail/77641/smiley-face-by-inky2010">
        <object type="deckjs/svg" class="svgitem floatright">
            <param name="src" value="smiley.svg" />
            <param name="width" value="200px" />
            <param name="height" value="200px" />
        </object>
        </a>
    </ul>
</section>
<section class="slide">
    <h2>The “svg” extension</h2>
    <ul>
        <li><a href="http://tavmjong.free.fr/SVG/SVG_IN_HTML/svg_in_html.html">Existing ways</a> of integrating SVG in HTML
            <ul>
                <li>Inline: the SVG content must be in the HTML file</li>
                <li><tt>img</tt> tag: no interactivity support</li>
                <li><tt>iframe/object/embed</tt> tags: separate DOM tree (styling and manipulation made harder)</li>
            </ul>
        </li>
        <li>Deck.svg.js extension
            <ul>
                <li>does “inline” inclusion of external SVG files</li>
                <li>uses a custom "object" tag and <a href="http://keith-wood.name/svg.html">jquery-svg</a></li>
            </ul>
        </li>
    </ul>
</section>
<section class="slide">
    <h2>Deck.svg.js: size</h2>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="10px" />
        <param name="height" value="10px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="21px" />
        <param name="height" value="21px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="42px" />
        <param name="height" value="42px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="85px" />
        <param name="height" value="85px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="175px" />
        <param name="height" value="175px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="350px" />
        <param name="height" value="350px" />
    </object>
</section>
<section class="slide">
    <h2>Deck.svg.js: autosize</h2>
    <ul><li>Does not work in chrome?<br/>(should see two smileys below)</li></ul>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="350px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="height" value="350px" />
    </object>
</section>
<section class="slide">
    <h2>Deck.svg.js: stretching</h2>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="150px" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="150px" />
        <param name="stretch" value="true" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="200px" />
        <param name="stretch" value="true" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="250px" />
        <param name="stretch" value="true" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="300px" />
        <param name="stretch" value="true" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="350px" />
        <param name="stretch" value="true" />
    </object>
    <object type="deckjs/svg" class="svgitem">
        <param name="src" value="smiley.svg" />
        <param name="width" value="100px" />
        <param name="height" value="450px" />
        <param name="stretch" value="true" />
    </object>
</section>
<section class="slide">
    <h2>Deck.svg.js: CSS styling</h2>
    <object type="deckjs/svg" class="svgitem style1">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem style2">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem style3">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <ul>
        <li>The same file is included three times using different styles (move your mouse on the yellow circle)</li>
        <li>Needs for the SVG file to not contain the css attribute of interest<br/>(removed manually for the example)</li>
    </ul>
</section>
<section class="slide">
    <h2>svg+anim: show/hide</h2>
    <object type="deckjs/svg" class="svgitem svg1">
        <param name="src" value="smiley.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem svg2">
        <param name="src" value="smiley.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem svg3">
        <param name="src" value="smiley.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <ul>
        <li>Use normal “anim” extension</li>
        <li>Smooth operation thanks to <a href="http://keith-wood.name/svg.html">jquery-svg</a></li>
        <li>Make stuff appear/disappear, …</li>
    </ul>
    <div class="anim-show slide" data-what=".svg2 svg"></div>
    <div class="anim-show slide" data-what=".svg2 #left"></div>
    <div class="anim-show slide" data-what=".svg2 #bottom"></div>
    <div class="anim-show slide" data-what=".svg2 #right"></div>
    <div class="anim-show slide" data-what=".svg2 #reflect"></div>
    <div class="anim-hide slide" data-what="#left, #right, .svg2 #bottom"></div>
    <div class="anim-show slide anim-continue" data-what="#left, #right, .svg2 #bottom"></div>
    <div class="anim-hide slide" data-what=".svg3"></div>
</section>
<section class="slide">
    <h2>svg+anim: svg attributes</h2>
    <object type="deckjs/svg" class="svgitem svg1">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem svg2">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <object type="deckjs/svg" class="svgitem svg3">
        <param name="src" value="circle.svg" />
        <param name="width" value="200px" />
        <param name="height" value="200px" />
    </object>
    <div class="anim-hide slide" data-what=".svg1 #circleRed, .svg1 #circleBlue"></div>
    <div class="anim-hide slide anim-continue" data-what=".svg2 #circleBlue, .svg1 #circleGreen"></div>
    <div class="anim-show slide" data-what=".svg1 #circleRed, .svg2 #circleRed"></div>
    <ul class="slide"><li>The "view box" can be animate, and that's awesome</li></ul>
    <!--div class="anim-attribute slide" data-what=".svg1 svg, .svg2 svg" data-attr="svgViewBox:110 120.5 17 17"></div not fully working (jquerysvg pb?) -->
    <div class="anim-viewboxas slide" data-what=".svg1 svg, .svg2 svg" data-as="#zoomBox1"></div>
    <!--div class="anim-attribute slide" data-what=".svg1 #coolText" data-attr="svg-transform: rotate(90)"></div-->
</section>
<!--section class="slide">
    <h2>Add/Remove Classes</h2>
    <ul>
        <li class="slide">We can also <span class="demo1">add</span>/remove classes: like the “highlight”</li>
        <li class="slide"><span class="demo2 highlight">This is highlight by default</span> (styled with css)</li>
        <li class="slide">We can add a class</li>
        <div class="anim-addclass slide" data-what=".demo1" data-class="highlight"></div>
        <li class="slide">And remove it</li>
        <div class="anim-removeclass slide" data-what=".demo1,.demo2" data-class="highlight"></div>
    </ul>
</section-->
<!--section class="slide">
    <h2>The “svg” extension</h2>
    <ul>
        <li>Works in conjunction with</li>
        <ul>
            <li>“events”: extension that triggers events<br/>   (notify the slide when it becomes current)</li>
            <li>“step”: extension that also trigger init events<br/>   (knowing about toplevel vs nested slides)</li>
        </ul>
        <li>Uses open attributes "data-*" (see source)</li>
        <li>Adds animation classes</li>
        <ul>
            <li>anim-show/hide, anim-addclass/removeclass,</li>
            <li>anim-attribute, anim-play, anim-pause, …</li>
        </ul>
    </ul>
</section-->
<section class="slide">
    <h2>Browser support</h2>
    <ul>
        <li>Should be ok with a decent browser</li>
        <li>Chrome problem when only width or height is specified</li>
    </ul>
</section>

<!-- DEMO: svg -->

<!-- deck.navigation snippet -->
<!--a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a-->

<!-- deck.status snippet -->
<!--p class="deck-status">
	<span class="deck-status-current"></span>
	/
	<span class="deck-status-total"></span>
</p-->

<!-- deck.hash snippet -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>

<!-- Initialize the deck -->
<script>
$(function() {
	$.deck('.slide', {
            // fitMarginX:100, fitMarginY:100,
            // fitMode: "stretched" //"center middle" //"bottom right" //"top left"
        });
});
</script>
</div>
</body>
</html>