-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathindex.html
1384 lines (1168 loc) · 42 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
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>CSS Gradients </title>
<!--
Author: Estelle Weyl
Contact: firstName @ lastName dot ORG
Twitter: @estellevw
-->
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="screen.css" media="projection, screen"/>
<link rel="stylesheet" href="religion.css" media="all"/>
<style>
.ex_rgba_stripes{
background:
linear-gradient(135deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100% ) 40px 40px rebeccapurple repeat;
background-size: 40px 40px;
}
.whatisborderimage {
margin: auto;
height: 200px;
width: 200px;
background-image:
linear-gradient(gold 5px, transparent 5px, transparent 145px, palegoldenrod 145px),
linear-gradient(left, palegoldenrod 5px, transparent 5px, transparent 145px, palegoldenrod 145px),
linear-gradient(rebeccapurple, palegoldenrod, rebeccapurple);
background-size: 200px 150px, 150px 200px, 150px 150px;
background-position: center;
background-position: no-repeat;
}
.medexampleshell {width: 600px; margin:auto;}
.medexample { height: 200px; width: 200px; margin: 0 30px 30px; float: left; text-align: center;
padding: 60px 0; box-sizing:border-box; text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;}
.multiplebg {
background-image: linear-gradient(gold, palegoldenrod), linear-gradient(rebeccapurple,rebeccapurple);
background-size: 180px 180px;
background-repeat: no-repeat;
background-position: 0 0, 20px 20px;
}
.bgimage {
background-image: radial-gradient(50% 50%, circle closest-side, transparent 70%, palegoldenrod 70%,gold 85%,transparent 85% );
background-size: 190px 190px;
background-repeat: no-repeat;
background-position: 0 0;
}
.linear {
background-image:
linear-gradient(to left,
rgba(0,0,0,0.5) 8%,
rgba(0,0,0,0.1) 24%);
}
.linrepeat {
background-image:
repeating-linear-gradient(to left,
rgba(0,0,0,0.5) 8%,
rgba(0,0,0,0.1) 24%);
}
.radial {
background-image:
radial-gradient(circle 200px at 20% 20%,
rgba(0,0,0,0.9),
rgba(0,0,0,0.1) 8%,
rgba(0,0,0,0.5) 16%);
}
.radrepeat {
background-image:
repeating-radial-gradient(circle at 40px 40px,
rgba(0,0,0,0.9),
rgba(0,0,0,0.1) 8%,
rgba(0,0,0,0.5) 16%);
}
.grad {
width: 250px;
height: 180px;
margin: 0 20px 20px 0px;
float: left;
border-radius: 150px;
background-repeat: repeat;
}
.grad1 {
background-repeat: repeat;
}
.grad1 header {background-color: rgba(255,255,255,0.8);}
.basiclinear {
background: linear-gradient(rebeccapurple, palegoldenrod);
}
.linear45 {
background: linear-gradient(rebeccapurple 45%, palegoldenrod 55%);
}
.linear50 {
background: linear-gradient(rebeccapurple 50%, palegoldenrod 50%);
}
.basiclinearnoprefix {
background: linear-gradient(to bottom, rebeccapurple, palegoldenrod);
}
.dark header{
background-color: rgba(255,255,255,0.5);
}
.angle {
position: absolute;
padding: 50px 50px 30px 50px;
color: rgba(255,255,255,0.01);
text-shadow: 1px 1px 1px rgba(0,0,0,0.01);
text-align: center;
}
.angle:hover {
text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
color: white;
}
#basiclinear:after,
#slide_basiclinearangles:after,
#slide_anglevkeyterm:after {
content: "";
background-color: black;
top: 49%;
left: 49%;
bottom: 49%;
right: 49%;
position:absolute;
border-radius: 50%;
}
.comparegrad {
height: 300px;
display: inline-block;
width: 300px;
border: 5px solid rebeccapurple;
margin-right: 10px;
position:relative;
}
.comparegradkeyterm {
background: linear-gradient(to top right,palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod);
}
.comparegradkeyterm div{
background: linear-gradient(to top right, transparent 49.95%, black 49.95%, black 50%, transparent 50%);
transform: rotate(90deg) scale(3);
}
.comparegradangle {
background: linear-gradient(45deg, palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod, rebeccapurple, palegoldenrod);
}
.comparegradangle div{
background: linear-gradient(45deg, transparent 49.5%, black 49.5%, black 50%, transparent 50%);
}
.rainbow {
background: linear-gradient(to bottom, red, orange, yellow, green, blue, purple);
}
.rainbow2 {
background-image:
linear-gradient(to bottom,
red 20%,
orange 20%,
orange 40%,
yellow 40%,
yellow 60%,
green 60%,
green 80%,
blue 80%
);
}
#rainbow5, #lg2{
background-image:
repeating-linear-gradient(145deg,
red 0,
red 20px,
orange 20px,
orange 40px,
yellow 40px,
yellow 60px,
green 60px,
green 80px,
blue 80px,
blue 100px,
purple 100px,
purple 120px);
}
#rainbow5b {
background-image: linear-gradient(90deg,
palegoldenrod 40%,
rebeccapurple 60%);
}
#angledStripes {
background-color: rebeccapurple;
background-image:
linear-gradient(135deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
);
background-size: 100px 100px;
background-repeat: repeat;
}
#tablecloth, #ancientgrad {
background-color: rebeccapurple;
background-image:
linear-gradient(
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0) 50%),
linear-gradient(to right,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0) 50%);
background-size: 100px 100px;
background-repeat: repeat;
}
#radial01 {
background-image:
radial-gradient(
palegoldenrod,
rebeccapurple);
}
#radial02 {
background-image:
radial-gradient(at 25% 35%,
palegoldenrod,
rebeccapurple);
}
#radial03 {
background-image:
radial-gradient(at 25% 35%,
palegoldenrod 20%,
rebeccapurple 20%);
}
#radial04 {
background-image:
radial-gradient(circle at 75% 75%,
palegoldenrod 20%,
rebeccapurple 20%);
}
#radial05 {
background-image: radial-gradient(farthest-corner at 40px 50px, palegoldenrod 298px,
rebeccapurple 300px);
}
#radial06 {
background-image:radial-gradient(
circle,
rebeccapurple 50%,
palegoldenrod 50%);
background-size: 50px 50px;
background-repeat:repeat;
background-color: red;
}
#radial07 {
background-image:
radial-gradient(ellipse at center,
palegoldenrod 0%,
rebeccapurple 100%);
}
input[type=range] {width: 360px;}
.gradientpoop {position: absolute; top:0; right:0; left:0; bottom:0; pointer-events: none;
transform:rotate(90deg);
}
/* color: rebeccapurple;
BDD9D5*/
</style>
</head>
<body> <header>
<nav>
<ul>
<li class="button cancel" id="back">Back</li>
<li class="button done" id="next">Next</li>
</ul>
</nav>
</header>
<div id="presentation">
<div id="presentation-counter"></div>
<div id="slides">
<!-- library examples -->
<div class="slide intro">
<header><h1>CSS Gradients </h1></header>
<section class="content">
</section>
</div>
<!-- library examples -->
<div class="slide normal greenbean grad1" id="slide1">
<header><h1>Plaid</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide1').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal metal grad1" id="slide2">
<header><h1>Metal Grid</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide2').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal classic grad1" id="slide3">
<header><h1>Classic</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide3').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal inverse1 grad1" id="slide4">
<header><h1>Disco Ball</h1></header>
<section class="content">
<input type="range" min="5" max="50" onChange="document.getElementById('slide4').style.backgroundSize = this.value + 'px,' + this.value + 'px,100%';">
</section>
</div>
<!-- library examples -->
<div class="slide normal tiltdavid grad1" id="slide5">
<header><h1>Star of David</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide5').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal retro67 grad1" id="slide6">
<header><h1>Retro 1967</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide6').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal blurry grad1" id="slide7">
<header><h1>Seat Cushion</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide7').style.backgroundColor = this.value;">
</section>
</div>
<!-- library examples -->
<div class="slide normal bradybunch grad1" id="slide9">
<header><h1>Brady Brunch</h1></header>
<section class="content">
<input type="color" pattern="#[a-fA-F0-9]{6}" onChange="document.getElementById('slide9').style.backgroundColor = this.value;">
<input type="range" min="10" max="210" step="10" onChange="alter(this.value)">
<script>
function alter(sz) {
sz2 = sz +"px "
document.getElementById('slide9').style.backgroundSize = sz2 + sz2;
document.getElementById('slide9').style.backgroundPosition = "0 0, " + sz/2 + 'px ' + sz/2 + 'px';
}
</script>
</section>
</div>
<!-- 4 kind of radients -->
<div class="slide">
<header><h1>Gradients</h1></header>
<section class="content">
<ul>
<li>Anywhere an image can be used (theoretically)
<ul><li>background-image, list-style-type, border-image, content, cursor</li></ul>
</li>
<li>4 Gradient Types
<ul class="medexampleshell" id="lgresize">
<li class="medexample linear">linear-gradient();</li>
<li class="medexample radial">radial-gradient();</li>
<li class="medexample linrepeat">repeating-linear-gradient()</li>
<li class="medexample radrepeat">repeating-radial-gradient()</li>
</ul>
</li>
</ul>
</section>
</div>
<!-- -->
<div class="slide">
<header><h1>conical gradient</h1></header>
<section class="content">
<ul class="medexampleshell" id="lgresize">
<li class="medexample" style="background: conic-gradient(from 45deg, white, black, white);">conic-gradient()</li>
<li class="medexample" style="background: conic-gradient(red, magenta, blue, aqua, lime, yellow, red); border-radius: 50%;">conic-gradient()</li>
<li class="medexample" style="
background: repeating-conic-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.1));">repeating-conic-gradient()</li>
<li class="medexample" style="
background: repeating-conic-gradient(rgba(0,0,0,0.5) 0deg 25%, rgba(0,0,0,0.1) 0deg 50%);">repeating-conic-gradient()</li>
<li class="medexample" style="
background: repeating-conic-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.1) 20deg );">repeating-conic-gradient()</li>
</ul>
</section>
</div>
<div class="slide figure">
<figure><object data="https://caniuse.com/#search=gradient"></object></figure>
<a href="https://caniuse.com/#search=gradient" target="play" title="open resource in new window">➹</a>
</div>
<!-- W3C syntax -->
<div class="slide">
<header><h1>Linear Gradient Syntax</h1></header>
<section class="content">
<pre contenteditable>linear-gradient([<em><angle></em>| to <em><side-or-corner></em>,]?
[<em><color-stop></em>[, <em><color-hint></em>]?, ]# <em><color-stop></em>)</pre>
<p>Things to remember:</p>
<ol>
<li>Use 'to' with keyterms</li>
<li>0deg is to top </li>
<li>Angles go clockwise</li>
</ol>
</section>
</div>
<!-- -->
<div class="slide object">
<header><h1>Basic Gradient</h1></header>
<object data="files/base.html"></object>
<a href="files/base.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- W3C syntax -->
<div class="slide">
<header><h1>Radial Gradient Syntax</h1></header>
<section class="content">
<pre contenteditable>radial-gradient([<em><shape></em>|| <em><size></em> at <em><position></em>]?
[<em><color-stop></em>[, <em><color-hint></em>]?, ]# <em><color-stop></em>)</pre>
<p>Things to remember:</p>
<ol>
<li>Use 'at' with position</li>
<li>position is center of gradient</li>
<li>If shape is specified as circle or omitted, the size can be a length/percent</li>
</ol>
</section>
</div>
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>Color Stops</h1></header>
<section class="content">
</section>
</div>
<!-- color-stop details -->
<div class="slide">
<header><h1>color-stop</h1></header>
<section class="content">
<pre contenteditable><color> [<length> || <percentage>]?</pre>
<ul>
<li>Color? See <a href="../colors/index.html#slide14">Colors</a></li>
<li>Length? Any length unit</li>
<li>Percent? relative to gradient line which is relative to image size</li>
<li>Omitted? 0%, 100%, or evenly distibuted in between</li>
<li>Duplicate? Hard color stop</li>
<li>Out of Order? previous declared value</ul>
</section>
</div>
<!-- Length Units -->
<div class="slide object">
<header><h1>Length Units</h1></header>
<object data="files/colorstop1.html"></object>
<a href="files/colorstop1.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- Percentages-->
<div class="slide object">
<header><h1>Percentages</h1></header>
<object data="files/colorstop2.html"></object>
<a href="files/colorstop2.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- No 0% of 100% -->
<div class="slide object">
<header><h1>End points: No 0% of 100%</h1></header>
<object data="files/colorstop3.html"></object>
<a href="files/colorstop3.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- Overlapping -->
<div class="slide object">
<header><h1>Duplicate / Hard stops</h1></header>
<object data="files/colorstop4.html"></object>
<a href="files/colorstop4.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- Duplicate values -->
<div class="slide object">
<header><h1>Duplicate / Hard stops</h1></header>
<object data="files/colorstop5.html"></object>
<a href="files/colorstop5.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- Color stops that overlap -->
<div class="slide object">
<header><h1>Should be Sequential</h1></header>
<object data="files/colorstop6.html"></object>
<a href="files/colorstop6.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- Negative value for color stops -->
<div class="slide object">
<header><h1>Negative Values</h1></header>
<object data="files/colorstop8.html"></object>
<a href="files/colorstop8.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>Color Hints</h1></header>
<section class="content">
</section>
</div>
<!-- Color Hints Explained -->
<div class="slide">
<header><h1>color-hint</h1></header>
<section class="content">
<ul> <li>Midpoint of transition between 2 stops</li>
<li>Length? Any length unit</li>
<li>Percent? relative to gradient line which is relative to image size</li>
<li>Hard Stop? Use 0%</li>
<li>Point is relative to the 0 (zero) mark, not from the previous color stop</li>
</ul>
</section>
</div>
<!-- -->
<div class="slide">
<header><h1>color-hint</h1></header>
<section class="content">
<pre style="background: linear-gradient(to right, rebeccapurple, palegoldenrod); line-height: 3;">linear-gradient(rebeccapurple, palegoldenrod);</pre>
<pre style="background: linear-gradient(to right, rebeccapurple, 50%, palegoldenrod);line-height: 3">linear-gradient(rebeccapurple, 50%, palegoldenrod);</pre>
<pre style="background: linear-gradient(to right, rebeccapurple, 20%, palegoldenrod);line-height: 3">linear-gradient(rebeccapurple, 20%, palegoldenrod);</pre>
<pre style="background: linear-gradient(to right, rebeccapurple, 80%, palegoldenrod);line-height: 3">linear-gradient(rebeccapurple, 80%, palegoldenrod);</pre>
</section>
</div>
<!-- Overlapping -->
<div class="slide object">
<header><h1>Color Hint</h1></header>
<object data="files/colorhint1.html"></object>
<a href="files/colorhint1.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>Direction</h1></header>
<section class="content">
</section>
</div>
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>to <side-or-corner></h1></header>
<section class="content">
</section>
</div>
<!-- Corners and sides -->
<div class="slide">
<header><h1>Keyterm Directions</h1></header>
<section class="content">
<pre contenteditable>linear-gradient([<angle>| to <em><side-or-corner></em>,]?
[<color-stop>[, <color-hint>]?, ]# <color-stop>)</pre>
<p>Gradient progresses toward the declared side or corner.</code></p>
<pre>to [left | right] || [top | bottom]</pre>
<pre style="float: left" contenteditable> to top
<em>to bottom</em>
to left
to right
to top left
to top right
to bottom left
to bottom right</pre>
</section>
</div>
<!-- keyterm values -->
<div class="slide dark object linear45" id="basiclinear">
<header><h1>Linear Gradient: Gradient Directions</h1></header>
<section class="content" style="margin-top:100px;">
<select style="font-size: 1em; border-radius: 0; background-color: palegoldenrod" onChange="basicGradientChange();" id="slct_basicgradient">
<option value=""></option>
<option value="to top">to top</option>
<option value="to bottom">to bottom</option>
<option valut="to left">to left</option>
<option value="to right">to right</option>
<option value="to top left">to top left</option>
<option value="to top right">to top right</option>
<option value="to bottom left">to bottom left</option>
<option value="to bottom right">to bottom right</option>
</select>
<pre contenteditable>
background: linear-gradient(<span id="basicgradient"></span> rebeccapurple 47%, palegoldenrod 53%);
</pre>
<pre style="float: left" contenteditable><side-or-corner>
to top
<em>to bottom</em>
to left
to right
to top left
to top right
to bottom left
to bottom right</pre>
<script defer="">
function basicGradientChange(event) {
var value = document.getElementById('slct_basicgradient').value, invertvalue;
console.log(value);
switch (value) {
case "top":
case "bottom":
invertvalue = 'to left';
break;
case "left":
case "right":
invertvalue = 'to top';
break;
case "top left":
case "bottom right":
invertvalue = 'to bottom left';
break;
case "bottom left":
case "top right":
invertvalue = 'to bottom right';
break;
default: invertvalue = '';
}
document.getElementsByClassName('basiclinearslide')[0].style.background =
'linear-gradient(' + value + ', transparent 49.95%, black 49.95%, black 50%, transparent 50%)';
document.getElementById('basiclinear').style.background =
'linear-gradient(' + value + ', rebeccapurple 47%, palegoldenrod 53%)';
if(value) {
document.getElementById('basicgradient').innerHTML = value + ", ";
} else {
document.getElementById('basicgradient').innerHTML = "";
}
}
</script>
</section>
<div class="basiclinearslide gradientpoop"></div>
</div>
<!-- -->
<div class="slide">
<header><h1>Magic Corners</h1></header>
<section class="content">
<svg style="width: 600px; height: 600px"><defs>
<linearGradient id="Gradient1" x1="0%" y1="0%" x2="100%" y2="100%" gradientTransform="rotate(0)">
<stop offset="48%" stop-color="palegoldenrod"/>
<stop offset="52%" stop-color="rebeccapurple"/>
</linearGradient>
</defs>
<rect
stroke="black"
fill="url(#Gradient1)"
width="450"
height="250"
x="100"
y="100" />
<circle
cx="325"
cy="225"
r="3" />
<g transform="matrix(0.22561138,-0.97421738,0.97421738,0.22561138,39.550239,495.54834)">
<line
x1="521"
y1="101"
x2="387"
y2="-45"
style="stroke:#000000;stroke-width:2" />
<line
x1="297"
y1="514"
x2="119"
y2="316"
style="stroke:#000000;stroke-width:2" />
<line
x1="164"
y1="370"
x2="490"
y2="65"
style="stroke:#000000;stroke-width:4" />
</g>
</svg>
</section>
</div>
<div class="slide object">
<object data="files/sidecorner1.html"></object>
<a href="files/sidecorner1.html" class="objectlink" target="_new">Try it out</a>
</div>
<!-- angle values
<div class="slide dark object basiclinear" id="slide_basiclinearangles">
<header><h1>Linear Gradient Angles</h1></header>
<section class="content" style="margin-top:100px;">
<pre contenteditable>
background: linear-gradient(<span id="basiclinearangles"></span>rebeccapurple, palegoldenrod);
</pre>
<input type="range" min="0" max="360" onChange="angleGradientChange();" id="slct_basiclinearangles" />
<a href="../html5mobile/files/91_basic.html" class="objectlink" target="play">Try it</a>
<script defer="">
function angleGradientChange(event) {
var value = document.getElementById('slct_basiclinearangles').value || 270;
var degvalue = value + "deg";
var invertvalue = value - 90;
document.getElementsByClassName('slide_basiclinearangles')[0].style.background =
window.cssPrefix + 'linear-gradient(' + value + 'deg, transparent 49.75%, black 49.75%, black 50%, transparent 50%)'
document.getElementById('slide_basiclinearangles').style.background =
window.cssPrefix + 'linear-gradient(' + degvalue + ', rebeccapurple 45%, palegoldenrod 55%)';
if(value) {
document.getElementById('basiclinearangles').innerHTML = "<b>" + degvalue + "</b>, ";
} else {
document.getElementById('basiclinearangles').innerHTML = "";
}
}
</script>
</section>
<div class="slide_basiclinearangles gradientpoop"></div>
</div>
-->
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>Angles</h1></header>
<section class="content">
</section>
</div>
<!-- Corners and sides -->
<div class="slide">
<header><h1>Keyterm Directions</h1></header>
<section class="content">
<pre contenteditable>linear-gradient([<em><angle></em>| to <side-or-corner>,]?
[<color-stop>[, <color-hint>]?, ]# <color-stop>)</pre>
<ul>
<li>Gradient progresses the declared angle.</li>
<li>Degrees go clockwise, starting at 12:00
<ul>
<li>top: 0%;</li>
<li>right: 90%;</li>
<li>bottom: 180%;</li>
<li>left: 270%;</li>
</ul>
</li>
<li>0deg is the same as <code>to top</code></li>
<li><code>45%</code> is NOT the same as <code>to top right</code>
<li><code>deg</code> is required</li>
</ul>
</section>
</div>
<!-- angle values -->
<div class="slide dark object linear50" id="slide_basiclinearangles2">
<header><h1>W3C Linear Gradient Angles</h1></header>
<section class="content" style="margin-top:100px;">
<pre contenteditable>
background: linear-gradient(<span id="basiclinearangles2"></span>
rebeccapurple 50%, palegoldenrod 50%);
</pre>
<input type="range" min="0" max="360" onChange="angleGradientChange2();" id="slct_basiclinearangles2" />
<script defer="">
function angleGradientChange2(event) {
var value = document.getElementById('slct_basiclinearangles2').value || 270;
var degvalue = value + "deg";
var invertvalue = value - 90;
document.getElementsByClassName('slide_basiclinearangles2')[0].style.background =
'linear-gradient(' + value + 'deg, transparent 49.85%, black 49.85%, black 50%, transparent 50%)'
document.getElementById('slide_basiclinearangles2').style.background =
'linear-gradient(' + degvalue + ', rebeccapurple 50%, palegoldenrod 50%)';
if(value) {
document.getElementById('basiclinearangles2').innerHTML = "<b>" + degvalue + "</b>, ";
} else {
document.getElementById('basiclinearangles2').innerHTML = "";
}
}
</script>
</section>
<div class="slide_basiclinearangles2 gradientpoop"></div>
</div>
<!-- angels != keyterms -->
<div class="slide dark object linear45" id="slide_anglevkeyterm">
<header><h1>Angles ≠ Keyterms</h1></header>
<section class="content" style="margin-top:100px;">
<pre contenteditable>
background: linear-gradient(<span id="anglevkeyterm"></span>rebeccapurple 45%, palegoldenrod 55%);
</pre>
<button onClick="angleNotEqual('45deg')">45deg</button> <button onClick="angleNotEqual('to top right')"> to top right</button>
<script defer="">
function angleNotEqual(angle) {
document.getElementsByClassName('slide_anglevkeyterm')[0].style.background =
'linear-gradient(' + angle + ', transparent 49.75%, black 49.75%, black 50%, transparent 50%)';
document.getElementById('slide_anglevkeyterm').style.background =
'linear-gradient(' + angle + ', rebeccapurple 45%, palegoldenrod 55%)';
document.getElementById('anglevkeyterm').innerHTML = "<b>" + angle + "</b>, ";
}
</script>
</section>
<div class="slide_anglevkeyterm gradientpoop"></div></div>
<!-- angels != keyterms 2 -->
<div class="slide">
<header><h1>Angles ≠ Keyterms</h1></header>
<section class="content">
<div class="comparegrad comparegradkeyterm" id="comparegrad1"><span class="button">to top right</span>
<div class="comparegrad1 gradientpoop"></div>
</div>
<div class="comparegrad comparegradangle" id="comparegrad2"><span class="button">45deg</span>
<div class="comparegrad2 gradientpoop"></div>
</div>
<input type="range" onChange="heightChange(this);" min="100" max="450" style="transform: rotate(90deg); position:absolute; right:10px; top: 200px;">
</section>
<script defer>
function heightChange(val){
var height = val.value + 'px';
var divs = document.querySelectorAll('.comparegrad');
for(var i=0, count = divs.length; count > i; i++){
divs[i].style.height = height;
}
}
</script>
</div>
<!-- DIVIDER -->
<div class="slide divider">
<header><h1>Examples</h1></header>
<section class="content">
</section>
</div>
<!-- table cloth -->
<div class="slide object angledStripes" id="tablecloth">
<header><h1>Multiple with background-size</h1></header>
<section class="content"> <br/>
<pre style="background-color: rgba(255,255,255,0.7)">background-color: <span id="feature04" style="color: white; background: rebeccapurple; padding: 0 5px" onKeyUp="changeFeature('backgroundColor', 'feature04', 'tablecloth')" contenteditable>rebeccapurple</span>;
background-image:
linear-gradient(
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0) 50%),
linear-gradient(to right,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0) 50%);
background-size: <span id="feature05" onKeyUp="changeFeature('backgroundSize', 'feature05', 'tablecloth')" contenteditable>100px 100px, 100px 100px</span>;
</pre>
<small>Change the color above</small>
</section>
</div>
<!-- color me instructions -->
<div class="slide">
<header><h1>Edit the backgrounds</h1></header>
<section class="content">
<p style="text-align:center">In the next slide edit the code to<br>
make really ugly rainbows</p>
<ul>
<li>don't vendor-prefix (unless you want poor mobile performance)</li>
<li>create effects with color stops at same location</li>
<li>create effects by adding multiple gradients, playing with position and size</li>
<li>learn from others: <a href="http://leaverou.me/css3patterns/">Lea Verou's Gradients</a>, <a href="http://www.standardista.com/cssgradients">Estelle Weyl's Gradients</a>, and <a href="http://www.standardista.com/CSS3gradients/flags.html">Estelle's Flags</a></li>
<li>Use tools: <a href="http://westciv.com/tools/gradientsnustyle/">John Allsopp's tool</a>, <a href="http://gradients.glrzad.com/">Damian Galarza's tool</a>, <a href="http://www.colorzilla.com/gradient-editor/">Colorzilla</a></li>
</ul>
</section>
</div>
<!-- play time -->
<div class="slide object">
<header><h1>Play Time</h1></header>
<object data="files/play1.html"></object>
<a href="files/play1.html" class="objectlink" target="play">Try it out</a>
</div>
<!-- angled stripes -->
<div class="slide object angledStripes" id="angledStripes">
<header><h1>Stripes with background-size</h1></header>
<section class="content">
<pre style="background-color: rgba(255,255,255,0.7)">background-color: <span id="feature01" onKeyUp="changeFeature('backgroundColor', 'feature01', 'angledStripes')" contenteditable style="color: white; background: rebeccapurple; padding: 0 5px">rebeccapurple</span>;
background-image:
<span contenteditable id="colorme6" onKeyUp="changeBackgroundGradient('angledStripes','#colorme6')">linear-gradient(135deg,
rgba(255, 255, 255, 0.2) 25%,
rgba(255, 255, 255, 0) 25%,
rgba(255, 255, 255, 0) 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
rgba(255, 255, 255, 0) 75%,
rgba(255, 255, 255, 0) 100%
)</span>;
background-size: <span id="feature02" onKeyUp="changeFeature('backgroundSize', 'feature02', 'angledStripes')" contenteditable>100px 100px</span>;
background-repeat: <span id="feature03" onKeyUp="changeFeature('backgroundRepeat', 'feature03', 'angledStripes')" contenteditable>repeat</span>;