-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
722 lines (588 loc) · 20.2 KB
/
index.html
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cutting-edge CSS features for Graphics - CSS Blend Modes, CSS Masking and CSS Shapes</title>
<meta name="description" content="CSS Blend Modes, CSS Masking and CSS Shapes">
<meta name="author" content="Razvan Caliman">
<meta name="deck" content="reveal.js by Hakim el Hattab (@hakimel)">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/adobe-theme.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<script src="//use.edgefonts.net/bangers.js"></script>
<link href='http://fonts.googleapis.com/css?family=Passion+One' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="reveal">
<a href="http://html.adobe.com" id="logo"><img src="resources/adobelogo.svg" alt="" /></a>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<div class="support-warning intro">
This slide deck is meant to be used in a controlled environment. It demonstrates some cutting-edge CSS features which this browser does not fully support.
<a href="https://github.com/oslego/fowd-london-2014">Read the instructions</a> on how to setup that environment and get the full experience.
</div>
<h1>Cutting-edge <span class="no-break">CSS Features</span></h1>
<h2><span class="no-break">CSS Blend Modes</span>, <span class="no-break"> Masking and Shapes</span></h2>
<p>
<a href="http://razvancaliman.com">Razvan Caliman</a> / <a href="http://twitter.com/razvancaliman">@razvancaliman</a>
</p>
</section>
<section data-state='intro'>
<p class="desc">Adobe <span class="no-break">Web Platform</span> Team</p>
<div class="side-by-side">
<div class="side fix-w3c">
<img src="resources/w3c-logo.svg" alt="">
</div>
<div class="side">
<img src="resources/browser-logos/chromium.png" alt="">
</div>
<div class="side">
<img src="resources/browser-logos/webkit.png" alt="">
</div>
<div class="side">
<img src="resources/browser-logos/firefox.png" alt="">
</div>
</div>
</section>
<section>
<h2>Overview</h2>
<ul class="toc">
<li>
CSS Blend Modes
</li>
<li>
CSS Masking
</li>
<li>
CSS Shapes
</li>
</ul>
</section>
<section data-state='blendingbg'>
<h1>CSS Blend Modes</h1>
<img src="resources/slide_csscompositing.png" alt="" />
</section>
<section data-state='blendingbg'>
<div class="support-warning blending">
This slide uses the <code>background-blend-mode</code> property. It is not supported in this browser. <a href="http://html.adobe.com/webplatform/enable/#section-chrome">Learn how to get a capable browser</a>.
</div>
<div id="blending-comparison" class="side-by-side">
<div class="side">
<p>simple alpha compositing</p>
<figure class="solid">
<div class="mock-overlay fragment"></div>
</figure>
</div>
<div class="side fragment">
<p>blend-mode: overlay</p>
<figure class="solid blended">
<input type="color" id="blending-solid" value="#D67917" class="fragment"/>
</figure>
</div>
</div>
</section>
<section data-state='blendingbg'>
<div class="support-warning blending">
This slide uses the <code>background-blend-mode</code> property. It is not supported in this browser. <a href="http://html.adobe.com/webplatform/enable/#section-chrome">Learn how to get a capable browser</a>.
</div>
<div id="blending-comparison" class="side-by-side">
<div class="side">
<p>simple alpha compositing</p>
<figure class="gradient"></figure>
</div>
<div class="side fragment">
<p>blend-mode: overlay</p>
<figure class="gradient blended"></figure>
</div>
</div>
</section>
<section data-state='blendingbg'>
<div id="blending-illustration">
<div class="layer source">
<p>source</p>
<figure></figure>
</div>
<div class="layer destination">
<p>backdrop</p>
<figure></figure>
</div>
<div class="layer result">
<p>blended result</p>
<figure></figure>
</div>
</div>
</section>
<section data-state="blendingbg">
<h2>Background Blending</h2>
<pre><code>
/* blend background images of the same element */
.element {
background: url(image1.jpg), url(image2.jpg);
background-color: rgba(215, 120, 25, 0.7);
background-blend-mode: overlay;
}
</code></pre>
</section>
<section data-state="blendingbg">
<h2>Blend modes</h2>
<div class="side-by-side">
<div class="side">
<ul>
<li>
normal
</li>
<li>
screen
</li>
<li>
multiply
</li>
<li>
overlay
</li>
<li>
darken
</li>
<li>
lighten
</li>
<li>
color-dodge
</li>
<li>
color-burn
</li>
</ul>
</div>
<div class="side">
<ul>
<li>
hard-light
</li>
<li>
soft-light
</li>
<li>
difference
</li>
<li>
exclusion
</li>
<li>
hue
</li>
<li>
saturation
</li>
<li>
color
</li>
<li>
luminosity
</li>
</ul>
</div>
</div>
<p>
<br />
<a href="http://www.w3.org/TR/compositing-1/#blending">http://www.w3.org/TR/compositing-1/#blending</a>
</p>
</section>
<section data-state="blendingbg">
<a href="http://razvancaliman.com/cssblending/" target="_blank">
<img src="resources/screenshots/octoshirt.png" alt="" />
</a>
</section>
<section data-state="blendingbg">
<h2>Element Blending</h2>
<pre><code>
/* blend heading with container */
h2 {
mix-blend-mode: difference;
}
.container {
background-image: url(texture.png);
}
</code></pre>
</section>
<section data-state="blendingbg">
<div class="surface scratch">
<h2 contenteditable>Scratch</h2>
</div>
</section>
<section data-state="blendingbg">
<img src="resources/hola.jpg" alt="" />
</section>
<section data-state="blendingbg">
<div class="surface hola">
<h2>
<span>H</span><span>O</span><span>L</span><span>A</span><span>!</span>
</h2>
</div>
</section>
<section data-state="blendingbg">
<a href="http://www.theverge.com/" target="_blank">
<img src="resources/screenshots/theverge.png" alt="The Verge website homepage" />
</a>
</section>
<section data-state="blendingbg">
<img src="resources/demo-verge1.gif" alt="The Verge progressive enhancement demo" />
</section>
<section data-state="blendingbg">
<a href="https://medium.com/web-design-technique/6b51bf53743a" target="_blank">
<img src="resources/screenshots/medium-bennett.png" alt="Bennett Feely about CSS Blend Modes in web design" />
</a>
</section>
<section data-state="blendingbg">
<h2>CSS Blend Modes Status</h2>
<p><a href="http://www.w3.org/TR/compositing-1/">W3C Candidate Recommendation</a> - Adobe, Canon</p>
<div class="side-by-side">
<div class="side">
<img src="resources/browser-logos/firefox.png" class="partial" alt="Firefox browser logo" />
</div>
<div class="side">
<img src="resources/browser-logos/chrome.png" class="partial" alt="Chrome browser logo" />
</div>
<div class="side">
<img src="resources/browser-logos/opera.png" class="partial" alt="Opera browser logo" />
</div>
<div class="side">
<img src="resources/browser-logos/webkit.png" class="partial" alt="Webkit browser logo" />
</div>
</div>
</section>
<!-- CSS MASKING -->
<section data-state="maskingbg">
<h1>CSS Masking</h1>
<img src="resources/css-masking.png" alt="" />
</section>
<section data-state="maskingbg">
<h2>clipping <em>vs</em> masking</h2>
</section>
<!-- circle clipping -->
<section data-state="maskingbg">
<p>
clip-path: <span id="clip-output-circle">circle(25% at 50% 50%)</span>;
</p>
<div class="support-warning clipping">
This slide uses the <code>-webkit-clip-path</code> property. It is not supported in this browser. <a href="http://html.adobe.com/webplatform/enable/#section-chrome">Learn how to get a capable browser</a>.
</div>
<div class="clip-surface" data-js-clip-trigger="circle" data-js-clip-output='#clip-output-circle' id="clip-target-circle"></div>
</section>
<!-- ellipse clipping -->
<section data-state="maskingbg">
<p>
clip-path: <span id="clip-output-ellipse">ellipse(50% 40% at 50% 50%)</span>;
</p>
<div class="support-warning clipping">
This slide uses the <code>-webkit-clip-path</code> property. It is not supported in this browser. <a href="http://html.adobe.com/webplatform/enable/#section-chrome">Learn how to get a capable browser</a>.
</div>
<div class="clip-surface" data-js-clip-trigger="ellipse" data-js-clip-output='#clip-output-ellipse' id="clip-target-ellipse"></div>
</section>
<!-- polygon clipping -->
<section data-state="maskingbg">
<p>
clip-path: <span id="clip-output-polygon">polygon(nonzero, 955px 405px, 483px 212px, 1px 400px, 0px 500px, 956px 500px)</span>;
</p>
<div class="support-warning clipping">
This slide uses the <code>-webkit-clip-path</code> property. It is not supported in this browser. <a href="http://html.adobe.com/webplatform/enable/#section-chrome">Learn how to get a capable browser</a>.
</div>
<div class="clip-surface" data-js-clip-trigger="ellipse" data-js-clip-output='#clip-output-polygon' id="clip-target-polygon"></div>
</section>
<section data-state="maskingbg">
<h2>Clipping with SVG</h2>
<pre><code>
.element {
-webkit-clip-path: url(#clipping);
}
</code></pre>
<pre><code>
<svg>
<clipPath id="clipping">
<circle cx="50" cy="50" r="10"/>
</clipPath>
</svg>
</code></pre>
</section>
<section data-state="maskingbg">
<a href="https://medium.com/editors-picks/ac3bd0d025f5" target="_blank">
<img src="resources/screenshots/medium-mercenary-1.png" alt="" />
</a>
</section>
<section data-state="maskingbg">
<a href="https://medium.com/editors-picks/ac3bd0d025f5" target="_blank">
<img src="resources/screenshots/medium-mercenary-2.png" alt="" />
</a>
</section>
<section data-state="maskingbg">
<h2>Masking</h2>
<pre><code>
.element {
/* use an image as a mask */
mask-image: url(mask.png);
}
</code></pre>
</section>
<section data-state="maskingbg">
<img src="resources/mask-type-illustration.png" alt="" />
</section>
<section data-state="maskingbg">
<a href="http://razvancaliman.com/responsive-mask-image/" target="_blank">
<img src="resources/screenshots/responsive-mask.png" alt="" />
</a>
</section>
<section data-state="maskingbg">
<h2>Masking with SVG</h2>
<pre><code>
.element {
/* use a <mask> element as mask */
mask-image: url(#mask);
}
</code></pre>
<pre><code>
<svg>
<mask id="mask">
<circle cx="50" cy="50" r="10"></circle>
</mask>
</svg>
</code></pre>
</section>
<section data-state="blendingbg">
<div class="surface hola">
<h2 class="texture">
<span>H</span><span>O</span><span>L</span><span>A</span><span>!</span>
</h2>
</div>
</section>
<section data-state="maskingbg">
<h2>CSS Masking Status</h2>
<p><a href="http://www.w3.org/TR/css-masking-1/">W3C Working Draft</a> - Adobe, Mozilla, Google</p>
<div class="side-by-side">
<div class="side">
<img src="resources/browser-logos/chrome.png" alt="Chrome browser logo" class="partial" />
</div>
<div class="side">
<img src="resources/browser-logos/opera.png" alt="Chrome browser logo" class="partial" />
</div>
<div class="side">
<img src="resources/browser-logos/webkit.png" alt="Webkit browser logo" class="partial" />
</div>
<div class="side">
<img src="resources/browser-logos/firefox.png" alt="Firefox browser logo" class="partial" />
</div>
</div>
</section>
<section data-state="maskingbg">
<a href="http://www.html5rocks.com/en/tutorials/masking/adobe/" target="_blank">
<img src="resources/screenshots/html5rocks-masking.png" alt="" />
</a>
</section>
<section data-state="maskingbg">
<a href="http://tympanus.net/codrops/2013/12/02/techniques-for-creating-textured-text/" target="_blank">
<img src="resources/screenshots/sara-masking.png" alt="" />
</a>
</section>
<!-- CSS SHAPES -->
<section>
<h2>Shapes in CSS</h2>
<div id="shapes-illustration">
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
<div class="fragment"></div>
</div>
</section>
<section>
<a href="http://css-tricks.com/examples/ShapesOfCSS/" target="_blank">
<img src="resources/screenshots/csstricks-shapes.png" alt="" />
</a>
</section>
<section>
<h1>CSS Shapes</h1>
<img src="resources/grid_cssexclusions.png" alt="" />
</section>
<section>
<h2>Shape Inside</h2>
<pre><code>
/* wrap the content inside a circle */
#content {
shape-inside: circle(10em at 50% 50%)
}
</code></pre>
<img src="resources/shape-inside.png" alt="" height='35%'/>
</section>
<section>
<h2>Shape Outside</h2>
<pre><code>
#coffee {
float: left;
shape-outside: circle(10em at 50% 50%);
}
</code></pre>
<img src="resources/shape-outside.png" alt="" height='35%'/>
</section>
<section>
<h2>Complex shapes</h2>
<pre><code>
.content{
/* shape defined by points of a polygon */
shape-inside: polygon(x1, y1 x2, y2 ... );
}
.content{
/* shape defined by the transparency of an image */
shape-inside: url(image.png);
shape-image-threshold: 0.5;
}
</code></pre>
</section>
<section>
<a href="http://adobe-webplatform.github.io/Demo-for-Alice-s-Adventures-in-Wonderland/" target="_blank"><img src="resources/screenshots/alice-shapes.png" alt="" /></a>
</section>
<section>
<a href="http://sarasoueidan.com/blog/css-shapes/" target="_blank">
<img src="resources/screenshots/sara-shapes.png" alt="" />
</a>
</section>
<section>
<h2>CSS Shapes status</h2>
<p><a href="http://www.w3.org/TR/css-shapes-1/">W3C Candidate Recommendation</a> - Adobe, Microsoft</p>
<div class="side-by-side">
<div class="side">
<img src="resources/browser-logos/chrome.png" class="partial" alt="Chrome browser logo" />
</div>
<div class="side">
<img src="resources/browser-logos/webkit.png" class="partial" alt="Webkit browser logo" />
</div>
<div class="side">
<img src="resources/browser-logos/opera.png" class="partial" alt="Opera browser logo" />
</div>
</div>
</section>
<section>
<a href="http://adobe-webplatform.github.io/Demo-for-Alice-s-Adventures-in-Wonderland/" target="_blank"><img src="resources/screenshots/alice-shapes-workaround.png" alt="" /></a>
</section>
<section id="recap">
<div class="side-by-side">
<div class="side">
<p>CSS Blending</p>
<img src="resources/slide_csscompositing.png" alt="" />
</div>
<div class="side">
<p>CSS Masking</p>
<img src="resources/css-masking.png" alt="" />
</div>
<div class="side">
<p>CSS Shapes</p>
<img src="resources/grid_cssexclusions.png" alt="" />
</div>
</div>
</section>
<section>
<h1>end</h1>
<h2>
<a href="http://twitter.com/razvancaliman">@razvancaliman</a>
</h2>
</section>
<section>
<h2>Credits</h2>
<ul>
<li>
<a href="http://lab.hakim.se/reveal-js/">Reveal.js</a> created by <a href="http://hakim.se">Hakim el Hattab</a>
</li>
<li>
<a href="http://chandang.deviantart.com/art/Scratch-Texture-54915337">Scratch Texture</a>
</li>
<li>
<a href="http://shadowhousecreations.blogspot.co.uk/2010/06/grunge-texture-set.html">Background Wall Texture</a>
</li>
</ul>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script src="js/CSSShapesEditor.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: false,
progress: true,
history: true,
center: true,
rollingLinks: false,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
<script>
(function(){
var colorBlendingSolid = document.querySelector('#blending-solid');
var mockOverlay = document.querySelector('#blending-comparison .mock-overlay');
var blendedSolid = document.querySelector('#blending-comparison figure.solid.blended');
colorBlendingSolid.addEventListener('change', function(e){
var color = e.target.value;
blendedSolid.style.backgroundColor = color;
mockOverlay.style.backgroundColor = color;
mockOverlay.style.opacity = '0.7';
})
})();
(function(){
var clipEditor;
document.addEventListener('click', function(e){
if (e.target.dataset && e.target.dataset.jsClipTrigger){
var target = e.target;
var value = window.getComputedStyle(target).webkitClipPath;
var output = document.querySelector(e.target.dataset.jsClipOutput);
clipEditor = new CSSShapesEditor(target, value);
// force editor container to zoom in tune with the slides
clipEditor.on('ready', function(){
var slides = document.querySelector('div.slides');
var slidesStyle = window.getComputedStyle(slides);
var editorContainer = document.querySelector('[data-role="shape-editor"]');
editorContainer.style.zoom = slidesStyle.zoom;
});
clipEditor.on('shapechange', function(){
var outVal = clipEditor.getCSSValue();
target.style.webkitClipPath = outVal;
output.textContent = outVal;
})
}
});
document.addEventListener('keydown', function(e){
// pressing X will close the editor
if (e.keyCode == 88 && clipEditor){
clipEditor.off('shapechange');
clipEditor.remove();
clipEditor = null;
}
})
})()
</script>
</body>
</html>