-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathindex.html
2298 lines (2042 loc) · 103 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 lang="ru">
<head>
<meta charset="utf-8">
<title>******</title>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="../css/reveal.css">
<link rel="stylesheet" href="../css/theme/yandex.css" id="theme">
<link rel="stylesheet" href="../lib/css/hljs.css">
<link rel="stylesheet" href="./css/user.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', { 'packages': ['corechart'] });
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Пк', 59],
['Планшеты', 17],
['Смартфоны', 23],
['TV', 0.3]
]);
var options = {
is3D: true,
// pieSliceText: 'label',
backgroundColor: 'transparent',
legend: { textStyle: { color: 'white', fontSize: 25 } },
slices: { 3: { offset: 0.2 } }
// title: 'My Daily Activities'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg-min.js"></script>
</head>
<body class="yandex nodejs">
<div class="reveal">
<div class="slides">
<section class="large">
<div class="world-map fragment">
<img src="img/map.svg">
</div>
<!--<h3>SVG<br/>-->
<!--</h3>-->
<!--<p class="author">-->
<!--<small>Кувалдин Артем,</small>-->
<!--<small>Грищенко Антон</small>-->
<!--</p>-->
</section>
<section>
<!--<h2>SVG</h2>-->
<svg viewBox="0 0 800 300">
<pattern
id="p-fire"
viewBox="30 100 186 200"
patternUnits="userSpaceOnUse"
width="216" height="200"
x="-70" y="35">
<!-- Fire -->
<image xlink:href="http://tympanus.net/codrops-playground/assets/images/posts/23145/fire.gif" width="256" height="300"/>
</pattern>
<!-- Text -->
<a href="http://tympanus.net/codrops/2015/02/16/create-animated-text-fills/"><text text-anchor="middle"
x="50%"
y="50%"
dy=".35em"
class="svg-text-show">
<!--fill="url(#p-fire)";-->
SVG
</text><a>
</svg>
<p>– это формат векторных изображений, основанный на XML.</p>
</section>
<section>
<h2>Преимущества SVG</h2>
<ul>
<li class="fragment plus">Масштабирование без потери качества</li>
<li class="fragment plus">Меньше размер чем растр</li>
<li class="fragment plus">Можно открыть в текстовом редакторе</li>
<li class="fragment plus">Может содержать логику (Javascript)</li>
<li class="fragment plus">Частями изображения можно манипулировать с помощью CSS и JS</li>
</ul>
</section>
<section>
<h2>Недостатки</h2>
<ul>
<li class="fragment minus">Больший расход CPU.
</li>
<li class="fragment minus">Слишком детализированные svg могут иметь большой размер.</li>
</ul>
</section>
<section>
<h2>Структура SVG</h2>
<pre class="xml"><code><?xml version="1.0">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg">
…
</svg>
</code></pre>
<pre class="xml fragment"><code><svg>
<!--минимально возможный при вставке в html-->
</svg>
</code></pre>
</section>
<section>
<pre class="xml"><code><?xml version=”1.0" encoding=”UTF-8" standalone=”no”?>
<svg width=”24px” height=”25px” viewBox=”0 0 24 25"
version=”1.1" xmlns=”>http://www.w3.org/2000/svg"
xmlns:xlink=”http://www.w3.org/1999/xlink"
xmlns:sketch=”http://www.bohemiancoding.com/sketch/ns">
<! — Generator: Sketch 3.3 (11970) — http://www.bohemiancoding.com/sketch →
<title>add</title>
<desc>Created with Sketch.</desc>
...
</svg></code></pre>
</section>
<section>
<h3>Встраивание svg</h3>
<pre><code><embed src="your.svg" width="199" height="200">
</code></pre>
<pre class="html"><code><object data="your.svg"
type="image/svg+xml" width="199" height="200"></object>
</code></pre>
<pre><code><iframe src="your.svg"
width="199px" height=“200px"></iframe>
</code></pre>
<ul>
<li class="fragment plus">Содержимое доступно для внешнего JavaScript</li>
<li class="fragment plus">Интерактивная стилизация через CSS работает(hover)</li>
</ul>
</section>
<section>
<pre class="html"><code><!--IMG-->
<img src=“your.svg”>
</code></pre>
<pre class="css fragment"><code>/*Css backgrounds*/
.elem {
background-image: url(your.svg);
}
</code></pre>
<ul>
<li class="fragment minus">Содержимое недоступно для JS</li>
<li class="fragment minus">Не работает интерактивная стилизация</li>
</ul>
</section>
<section>
<pre><code><!--inline-->
<svg width="200px" height="200px">
…
</svg>
</code></pre>
<ul>
<li class="fragment plus">Позволяет использовать не только внутреннюю стилизацию</li>
<li class="fragment minus">Не кэшируется браузером</li>
<li class="fragment minus">Неудобно его редактировать в графическом редакторе, оптимизировать</li>
</ul>
</section>
<section>
<h2>Фигуры</h2>
</section>
<style>
.draw-rect svg {
border: 1px solid skyblue;
}
.draw-rect svg rect {
transition: 1s;
width: 0;
height: 0;
}
.draw-rect .f1.visible ~ svg rect{
width: 220px;
height: 200px;
fill: skyblue;
}
.draw-rect .f2.visible ~ svg rect{
stroke: #ff1919;
stroke-width: 10px;
}
.draw-rect .f3.visible ~ svg rect{
transform: translate(15px, 15px);
}
</style>
<section class="draw-rect">
<h2>rect</h2>
<pre class="xml"><code data-noescape><svg width="300" height="240">
<rect <mark class="fragment switch" data-fragment-index="1">width="220" height="130" fill="skyblue"</mark>
<mark class="fragment switch" data-fragment-index="2">stroke="#ff1919" stroke-width="10"</mark> <mark class="fragment switch" data-fragment-index="3">x="15" y="15"</mark>/>
</svg>
</code></pre>
<div class="fragment f1" data-fragment-index="1"></div>
<div class="fragment f2" data-fragment-index="2"></div>
<div class="fragment f3" data-fragment-index="3"></div>
<svg width="300" height="240">
<rect class="rect"/>
</svg>
</section>
<section class="rect-radius">
<h2>rect</h2>
<pre><code data-noescape><svg width="230" height="140">
<rect x="5" y="5" width="220" height="130"
fill="yellowgreen"<mark>rx="30" ry="30"</mark>/>
<rect x="225" y="5" width="220" height="130"
fill="#ee204d" <mark class="fragment" data-fragment-index="1">rx="60" ry="30"</mark>/>
</svg>
</code></pre>
<svg width="450" height="140">
<rect x="30" y="5" width="180" height="130" rx="30" ry="30"
fill="yellowgreen" stroke="green" stroke-width="5" />
<rect class="fragment" data-fragment-index="1" x="255" y="5" width="180" height="130" rx="60" ry="30"
fill="#ee204d" stroke="#ad102f" stroke-width="5" />
</svg>
</section>
<style>
.show-circle .fragment circle,
.show-circle .fragment ellipse{
transition: 1s ease-in;
transform: scale(0);
transform-origin: 50%;
}
.show-circle .fragment.visible circle,
.show-circle .fragment.visible ellipse{
transform: scale(1);
}
</style>
<section class="show-circle">
<h3>circle/ellipse</h3>
<pre><code><circle r="65" cx="70" cy="70" fill="orangered"/>
</code></pre>
<div class="fragment" data-fragment-index="1">
<svg width="140" height="140">
<circle r="65" cx="70" cy="70"
fill="orangered" stroke="crimson" stroke-width="5" />
</svg>
</div>
<pre class="xml fragment" data-fragment-index="2"><code><ellipse rx="110" ry="60" cx="115" cy="70" fill="gold" />
</code></pre>
<div class="fragment" data-fragment-index="3">
<svg width="230" height="140">
<ellipse rx="110" ry="60" cx="115" cy="70"
fill="gold" stroke="orange" stroke-width="5" />
</svg>
</div>
</section>
<section>
<h3>line</h3>
<pre><code><line x1="220" y1="10" x2="20" y2="130"/>
</code></pre>
<div class="fragment">
<svg width="330" height="240">
<line x1="320" y1="10" x2="20" y2="230" stroke="violet" stroke-width="5" />
</svg>
</div>
</section>
<style>
.show-polyline .fragment svg {
transition: 1s ease-in-out;
width: 0;
}
.show-polyline .fragment.visible svg {
width: 260px;
}
</style>
<section class="show-polyline">
<h3>polyline</h3>
<pre><code><polyline points="5,135 30,5 55,135 80,5, 105,135 130,5, 155,135 180,5, 205,135 230,5, 255,135"
fill="none"/>
</code></pre>
<div class="fragment">
<svg width="560" height="270" viewBox="0 0 260 170">
<polyline points="5,135 30,5 55,135 80,5, 105,135 130,5, 155,135 180,5, 205,135 230,5, 255,135"
fill="none" stroke="orangered" stroke-width="5" />
<text fill="#fff" x="0" y="155" font-size="20">5,135</text>
<text fill="#fff" x="10" y="25" font-size="20">30,5</text>
<text fill="#fff" x="33" y="135" font-size="20">55,135</text>
</svg>
</div>
</section>
<section>
<h3>polygon</h3>
<pre><code> <!--x,y x2,y2 x3,y3 ....-->
<polygon points="70,5 90,41 136,48 103,80 111,126
70,105 29,126 36,80 5,48 48,41"/>
</code></pre>
<div class="fragment">
<svg width="340" height="330" viewBox="0 0 140 130">
<polygon points="70,5 90,41 136,48 103,80 111,126 70,105 29,126 36,80 5,48 48,41"
fill="turquoise" stroke="lightseagreen" stroke-width="5" />
</svg>
</div>
</section>
<section>
<h2>Трансформации</h2>
</section>
<style>
.show-transform svg g {
transition: 1s;
}
.show-transform svg {
border: 1px dashed rgba(255,255,255,.3);
}
.show-transform .f1.visible ~ svg g {
transform: translate(50px, 50px);
}
.show-transform .f2.visible ~ svg g {
transform: translate(50px, 50px) scale(1.5, 2);
}
.show-transform .f3.visible ~ svg g {
transform: translate(50px, 50px) scale(2, 2.5) skew(30deg);
}
</style>
<section class="show-transform">
<a href="https://css-tricks.com/transforms-on-svg-elements/"><h3>Трансформации</h3></a>
<pre class="xml"><code data-noescape><rect x="50" y="20" width="100" height="100"
transform="<mark class="fragment" data-fragment-index="1">translate(50, 50)</mark> <mark class="fragment" data-fragment-index="2">scale(1.5, 2)</mark> <mark class="fragment" data-fragment-index="3">skew(30)</mark>"/>
</code></pre>
<!--перемещение-->
<div class="fragment f1" data-fragment-index="1"></div>
<!--увелицение-->
<div class="fragment f2" data-fragment-index="2"></div>
<!--skew-->
<div class="fragment f3" data-fragment-index="3"></div>
<svg width="300" height="300" style="overflow: visible">
<!-- non-rotated arrow -->
<g id="arrow" style="stroke: #fff;">
<line x1="0" y1="0" x2="120" y2="0"/>
<line x1="0" y1="0" x2="0" y2="120"/>
<polygon points="120 0, 115 5, 115 -5"/>
<polygon points="0 120, 5 115, -5 115"/>
<rect x="50" y="20" width="100" height="100" fill="gold" stroke="orange" stroke-width="5"/>
<circle cx="0" cy="0" r="10" style="fill: red;" />
</g>
<!--<!– вращение вокруг произвольной –>-->
<!--<use xlink:href="#arrow" transform="rotate(90)" />-->
</svg>
</section>
<style>
.show-transform-rotate svg circle,
.show-transform-rotate svg line,
.show-transform-rotate svg polygon,
.show-transform-rotate svg g {
transition: 1s;
}
.show-transform-rotate svg {
border: 1px dashed rgba(255,255,255,.3);
}
.show-transform-rotate .f1.visible ~ svg g {
transform: rotate(45deg);
}
.show-transform-rotate .f2.visible ~ svg g {
transform: rotate(45deg);
transform-origin: 75px 60px;
}
.show-transform-rotate .f2.visible ~ svg line,
.show-transform-rotate .f2.visible ~ svg polygon,
.show-transform-rotate .f2.visible ~ svg circle {
transform: translate(100px, 70px);
}
</style>
<section class="show-transform-rotate">
<a href="https://css-tricks.com/transforms-on-svg-elements/"><h3>Rotate</h3></a>
<pre class="xml"><code data-noescape><rect x="50" y="20" width="100" height="100" fill="gold"
stroke="orange"
stroke-width="5" transform="<mark class="fragment" data-fragment-index="1">rotate(45<mark class="fragment" data-fragment-index="2"> 100 70</mark>)</mark>"/>
</code></pre>
<!--перемещение-->
<div class="fragment f1" data-fragment-index="1"></div>
<!--увелицение-->
<div class="fragment f2" data-fragment-index="2"></div>
<!--skew-->
<svg width="300" height="300" style="overflow: visible">
<!-- non-rotated arrow -->
<g id="arrow" style="stroke: #fff;">
<line x1="0" y1="0" x2="120" y2="0"/>
<line x1="0" y1="0" x2="0" y2="120"/>
<polygon points="120 0, 115 5, 115 -5"/>
<polygon points="0 120, 5 115, -5 115"/>
<rect x="50" y="20" width="100" height="100" fill="gold" stroke="orange" stroke-width="5"/>
<circle cx="0" cy="0" r="10" style="fill: red;" />
</g>
<!--<!– вращение вокруг произвольной –>-->
<!--<use xlink:href="#arrow" transform="rotate(90)" />-->
</svg>
</section>
<style>
.show-rotate-hard svg rect:not(.r1),
.show-rotate-hard svg circle {
opacity: 0;
}
.show-rotate-hard svg {
border: 1px dashed rgba(255,255,255,.3);
}
.show-rotate-hard svg rect {
fill: #1e88e5
}
.show-rotate-hard .f1.visible ~ svg .r1 {
opacity: 0;
}
.show-rotate-hard .f1.current-fragment ~ svg .c1,
.show-rotate-hard .f2.current-fragment ~ svg .c1,
.show-rotate-hard .f3.current-fragment ~ svg .c2,
.show-rotate-hard .f4.current-fragment ~ svg .c2,
.show-rotate-hard .f1.current-fragment ~ svg .r2,
.show-rotate-hard .f2.current-fragment ~ svg .r3,
.show-rotate-hard .f3.current-fragment ~ svg .r4,
.show-rotate-hard .f4.current-fragment ~ svg .r5
{
opacity: 1;
}
</style>
<section class="show-rotate-hard">
<h3>Rotate</h3>
<pre><code data-noescape><rect x="0" y="0" width="20" height="80"
transform="<mark class="fragment" data-fragment-index="1">rotate(90 20 80)</mark> <mark class="fragment" data-fragment-index="3">rotate(90 20 0)</mark>"/>
</code></pre>
<div class="fragment f1" data-fragment-index="1"></div>
<div class="fragment f2" data-fragment-index="2"></div>
<div class="fragment f3" data-fragment-index="3"></div>
<div class="fragment f4" data-fragment-index="4"></div>
<svg width="300" height="300">
<rect class="r1" x="0" y="0" width="40" height="150" />
<rect class="r2" x="0" y="0" width="40" height="150" transform="rotate(45 40 150)"/>
<rect class="r3" x="0" y="0" width="40" height="150" transform="rotate(90 40 150)"/>
<circle class="c1" cx="40" cy="150" r="8" fill="red"/>
<rect class="r4" x="0" y="0" width="40" height="150" transform="rotate(90 40 150) rotate(45 40 0)"/>
<rect class="r5" x="0" y="0" width="40" height="150" transform="rotate(90 40 150) rotate(90 40 0)"/>
<circle class="c2" cx="190" cy="150" r="8" fill="red"/>
</svg>
</section>
<section>
<h3>SVG-path</h3>
<pre><code><path d="M 10,110 L 10,10 L 40,50 L 70,10 L 100,50
L 130,10 L 130,110 z" fill="gold" stroke="orange"
stroke-width="5"/>
</code></pre>
<div class="fragment"><svg width="300" height="260">
<path transform="scale(2)" d="M 10,110 L 10,10 L 40,50 L 70,10 L 100,50 L 130,10 L 130,110 z"
fill="gold" stroke="orange" stroke-width="5"/>
</svg></div>
</section>
<section data-background-image="img/Wat_cat_whale.jpg" data-background-size="auto 100%">
</section>
<section>
<h3>Команды</h3>
<pre><code data-noescape><path stroke="orange" stroke-width="3"
d="M 20,20 L150,150
<mark class="fragment" data-fragment-index="1"><!--В нижнем — относительные-->
m -100,0 l150,100</mark>
<mark class="fragment" data-fragment-index="2"><!--Верхний регистр – абсолютные координаты-->
M 70,20 L200,150"</mark>/></code></pre>
<div class="ex">
<svg width="300" height="300">
<path stroke="orange" stroke-width="3"
d="M 20,20 L150,150"/>
<path data-fragment-index="1" class="fragment" stroke="orange" stroke-width="3"
d="M 20,20 L150,150
m -100,0 l150,100"/>
<path data-fragment-index="2" class="fragment" stroke="orange" stroke-width="3"
d="M 70,20 L200,150"/>
</svg>
</div>
</section>
<section>
<h3>Команды</h3>
<ul>
<li>M, m(moveto) – устанавливает новую текущую точку.</li>
<li>L, l(line) – рисование линии</li>
</ul>
<pre class="xml"><code data-noescape=""><path stroke="orange" stroke-width="3"
d="M 20,20 L80,20 <mark class="fragment" data-fragment-index="1">20,100</mark> <mark class="fragment" data-fragment-index="2">M150,50 L50,150</mark> <mark class="fragment" data-fragment-index="3">150,120</mark>"/></code></pre>
<svg width="300" height="200">
<!--<path stroke="orange" stroke-width="3" d="M 20,20 L80,20 20,100 M150,50 L50,150 150,120"/>-->
<path stroke="orange" stroke-width="3" d="M 20,20 L80,20"/>
<path data-fragment-index="1" class="fragment" stroke="orange" stroke-width="3" d="M 20,20 L80,20 20,100"/>
<path data-fragment-index="2" class="fragment" stroke="orange" stroke-width="3" d=" M150,50 L50,150"/>
<path data-fragment-index="3" class="fragment" stroke="orange" stroke-width="3" d=" M150,50 L50,150 150,120"/>
</svg>
</section>
<section>
<a href="https://www.w3.org/TR/SVG/paths.html#PathDataCurveCommands"><h3>Команды</h3></a>
<ul>
<li>H, h и V, v – рисование горизонтальных и вертикальных линий.</li>
<li>Z, z – команда замыкание фигуры</li>
</ul>
<pre class="xml"><code data-noescape=""><path stroke="lightseagreen" stroke-width="5"
d="<mark class="fragment switch" data-fragment-index="1">M 200,20 h 160</mark> <mark class="fragment switch" data-fragment-index="2">v 160</mark> <mark class="fragment switch" data-fragment-index="3">h -80</mark> <mark class="fragment switch" data-fragment-index="4">v -80</mark> <mark class="fragment switch" data-fragment-index="5">h -80</mark> <mark class="fragment switch" data-fragment-index="6">z</mark>"/></code></pre>
<pre><code data-noescape><path stroke="red" stroke-width="5"
d="<mark class="fragment switch" data-fragment-index="1">M 20,20 H 160</mark> <mark class="fragment switch" data-fragment-index="2">V 160</mark> <mark class="fragment switch" data-fragment-index="3">H -80</mark> <mark class="fragment switch" data-fragment-index="4">V -80</mark> <mark class="fragment switch" data-fragment-index="5">H -80</mark> <mark class="fragment switch" data-fragment-index="6">z</mark>"/>
</code></pre>
<svg width="500" height="200">
<!--<path stroke="lightseagreen" stroke-width="5" fill="turquoise" d="M 20,20 h 160 v 160 h -80 v -80 h -80 z"/>-->
<g fill-opacity=".3">
<path class="fragment" data-fragment-index="1" stroke="lightseagreen" stroke-width="5" d="M 200,20 h 160 "/>
<path class="fragment" data-fragment-index="1" stroke="red" stroke-width="5" d="M 20,20 H 160 "/>
<path class="fragment" data-fragment-index="2" stroke="lightseagreen" stroke-width="5" d="M 200,20 h 160 v 160 "/>
<path class="fragment" data-fragment-index="2" stroke="red" stroke-width="5" d="M 20,20 H 160 V 160 "/>
<path class="fragment" data-fragment-index="3" stroke="lightseagreen" stroke-width="5" d="M 200,20 h 160 v 160 h -80 "/>
<path class="fragment" data-fragment-index="3" stroke="red" stroke-width="5" d="M 20,20 H 160 V 160 H -80 "/>
<path class="fragment" data-fragment-index="4" stroke="lightseagreen" stroke-width="5" d="M 200,20 h 160 v 160 h -80 v -80"/>
<path class="fragment" data-fragment-index="4" stroke="red" stroke-width="5" d="M 20,20 H 160 V 160 H -80 V -80"/>
<path class="fragment" data-fragment-index="5" stroke="lightseagreen" stroke-width="5" d="M 200,20 h 160 v 160 h -80 v -80 h -80"/>
<path class="fragment" data-fragment-index="5" stroke="red" stroke-width="5" d="M 20,20 H 160 V 160 H -80 V -80 H -80"/>
<path class="fragment" data-fragment-index="6" stroke="lightseagreen" stroke-width="5" fill="turquoise" d="M 200,20 h 160 v 160 h -80 v -80 h -80 z"/>
<path class="fragment" data-fragment-index="6" stroke="red" stroke-width="5" fill="red" d="M 20,20 H 160 V 160 H -80 V -80 H -80 z"/>
</g>
</svg>
</section>
<section>
<a href="https://svg-art.ru/?page_id=900#comm_a"><h3>Кривые</h3></a>
<ul>
<li>C, c(cubic) и S, s(smooth) – кубическая кривая Бизье</li>
<li>Q, q(quadratic) и T, t – квадратичная кривая Бизье
</li>
<li>A, a – сегмент окружности</li>
</ul>
<div style="display: inline-block; background: #fff">
<img src="img/Quadratic_Bezier.svg" height="200">
<img src="img/cubic_Bezier_curve.svg" height="200">
</div>
</section>
<section>
<h3>Рабочая область</h3>
<pre class="xml"><code><svg width="115" height="190"></svg></code></pre>
<svg width="115" height="190" viewBox="0 0 115 190" style="border: 1px solid #fff">
<desc>Green pear to show effects of matching viewport and viewBox.</desc>
<g>
<path fill="#BBC42A" d="M4.976,126.451c-0.571,1.76-1.067,3.551-1.475,5.377c-6.62,29.681,7.465,54.363,43.244,56.718 c56.994,3.751,77.653-25.65,60.462-67.25C90.017,79.697,82.063,89.688,80.366,57.764c-0.764-14.367-11.098-27.167-26.203-24.576
c-17.378,2.982-19.794,19.916-22.192,34.44C28.36,89.508,11.623,105.957,4.976,126.451z"/>
<path fill="none" stroke="#59351C" stroke-width="7" stroke-linecap="round" d="M56.427,40.406
c0,0-7.375-15.376,8.06-35.837"/>
<path fill="#7AA20D" stroke="#7AA20D" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" d="
M54.247,35.412c0.787-3.843,3.55-7.335,8.368-9.848c10.053-5.244,18.075-4.042,28.061,0.2c0.004,0.002,12.83,5.449,20.517-4.672
c-4.778,6.291-9.415,12.478-14.878,18.237c-8.878,9.359-25.348,22.181-37.176,9.661C55.019,44.629,53.349,39.793,54.247,35.412z"/>
</g>
</svg>
</section>
<style>
.show-viewbox-1 .with-viewbox,
.show-viewbox-1 .f1.visible ~ svg {
display: none;
}
.show-viewbox-1 .f1.visible ~ .with-viewbox {
display: inline;
}
</style>
<section class="show-viewbox-1">
<h3>viewBox</h3>
<pre class="xml" data-fragment-index="2"><code data-noescape><!-- x y width height-->
<svg width="200" height="200" <mark class="fragment" data-fragment-index="2">viewBox="0 0 233 295</mark>">
...
</svg></code></pre>
<div class="fragment f1" data-fragment-index="2"></div>
<svg width="200" height="200" style="border: 1px solid #fff">
<desc>Green pear to show effects of matching viewport and viewBox.</desc>
<g>
<path fill="none" stroke="#7AA20D" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" d="
M65.989,185.785c0,0,85.638-80.731,90.675-114.314c5.038-33.583,50.941,100.189,30.228,133.493"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M186.87,211.373
c1.927-0.131,3.965-0.533,6.206-1.261c9.353-3.041,23.276-7.675,30.963,3.463c16.565,24.002,6.333,61.392-20.202,73.091
c-30.336,13.374-64.783-18.62-61.949-49.448c1.391-15.139,8.969-39.499,28.717-30.191 C176.568,209.837,181.243,211.757,186.87,211.373z"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M67.278,193.489 c1.908,0.3,3.985,0.361,6.332,0.148c9.795-0.889,24.399-2.316,29.421,10.25c10.823,27.08-7.454,61.266-35.924,66.782
c-32.548,6.306-59.032-32.537-49.426-61.967c4.718-14.452,17.514-36.523,34.703-23.062 C57.574,189.705,61.706,192.614,67.278,193.489z"/>
<path fill="#7AA20D" stroke="#7AA20D" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="
M153.81,68.308c-1.475-6.678,0.444-14.2,6.331-21.624c12.283-15.49,25.91-19.271,44.822-19.608c0.008,0,24.298-0.435,29.351-22.009
c-3.141,13.41-6.131,26.553-10.739,39.603c-7.49,21.206-24.61,53.318-52.334,41.783C161.585,82.435,155.491,75.921,153.81,68.308z"
/>
</g>
</svg>
<svg class="with-viewbox" width="200" height="200" viewBox="0 0 233 295" style="border: 1px solid #fff">
<desc>Green pear to show effects of matching viewport and viewBox.</desc>
<g>
<path fill="none" stroke="#7AA20D" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" d="
M65.989,185.785c0,0,85.638-80.731,90.675-114.314c5.038-33.583,50.941,100.189,30.228,133.493"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M186.87,211.373
c1.927-0.131,3.965-0.533,6.206-1.261c9.353-3.041,23.276-7.675,30.963,3.463c16.565,24.002,6.333,61.392-20.202,73.091
c-30.336,13.374-64.783-18.62-61.949-49.448c1.391-15.139,8.969-39.499,28.717-30.191 C176.568,209.837,181.243,211.757,186.87,211.373z"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M67.278,193.489 c1.908,0.3,3.985,0.361,6.332,0.148c9.795-0.889,24.399-2.316,29.421,10.25c10.823,27.08-7.454,61.266-35.924,66.782
c-32.548,6.306-59.032-32.537-49.426-61.967c4.718-14.452,17.514-36.523,34.703-23.062 C57.574,189.705,61.706,192.614,67.278,193.489z"/>
<path fill="#7AA20D" stroke="#7AA20D" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="
M153.81,68.308c-1.475-6.678,0.444-14.2,6.331-21.624c12.283-15.49,25.91-19.271,44.822-19.608c0.008,0,24.298-0.435,29.351-22.009
c-3.141,13.41-6.131,26.553-10.739,39.603c-7.49,21.206-24.61,53.318-52.334,41.783C161.585,82.435,155.491,75.921,153.81,68.308z"
/>
</g>
</svg>
<p class="fragment" data-fragment-index="1">Размеры рабочей области 200х200</p>
<p class="fragment" data-fragment-index="1">Размеры картинки 233х295</p>
</section>
<section>
<h3>viewBox</h3>
<pre class="xml"><code><svg width="200" height="200" viewBox="100 100 233 295">...
</svg></code></pre>
<svg class="with-viewbox" width="200" height="200" viewBox="100 100 233 295" style="border: 1px solid #fff">
<desc>Green pear to show effects of matching viewport and viewBox.</desc>
<g>
<path fill="none" stroke="#7AA20D" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" d="
M65.989,185.785c0,0,85.638-80.731,90.675-114.314c5.038-33.583,50.941,100.189,30.228,133.493"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M186.87,211.373
c1.927-0.131,3.965-0.533,6.206-1.261c9.353-3.041,23.276-7.675,30.963,3.463c16.565,24.002,6.333,61.392-20.202,73.091
c-30.336,13.374-64.783-18.62-61.949-49.448c1.391-15.139,8.969-39.499,28.717-30.191 C176.568,209.837,181.243,211.757,186.87,211.373z"/>
<path fill="#ED6E46" stroke="#ED6E46" stroke-width="13" d="M67.278,193.489 c1.908,0.3,3.985,0.361,6.332,0.148c9.795-0.889,24.399-2.316,29.421,10.25c10.823,27.08-7.454,61.266-35.924,66.782
c-32.548,6.306-59.032-32.537-49.426-61.967c4.718-14.452,17.514-36.523,34.703-23.062 C57.574,189.705,61.706,192.614,67.278,193.489z"/>
<path fill="#7AA20D" stroke="#7AA20D" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" d="
M153.81,68.308c-1.475-6.678,0.444-14.2,6.331-21.624c12.283-15.49,25.91-19.271,44.822-19.608c0.008,0,24.298-0.435,29.351-22.009
c-3.141,13.41-6.131,26.553-10.739,39.603c-7.49,21.206-24.61,53.318-52.334,41.783C161.585,82.435,155.491,75.921,153.81,68.308z"
/>
</g>
</svg>
</section>
<section>
<h3>Маркеры</h3>
<p>– служит для указания направления, начала, середины, конца линии (line, polyline, path, polygon, rect)</p>
</section>
<section>
<pre class="xml fragment"><code><marker id="circleMarker"
viewBox="0 0 50 50" refX="25" refY="25" orient="auto">
<circle r="25" fill="red" cx="25" cy="25"/>
</marker>
</code></pre>
<pre class="xml"><code><path d="M100,100 L100,300 L444,200 L100,500"
marker-mid="url(#circleMarker)"
</code></pre>
<svg class="fragment" width="400" height="400" viewBox="0 50 550 550"
xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="myMarker12" viewBox="0 0 130 130" refX="65" refY="65" orient="auto">
<circle r="65" fill="red" cx="65" cy="65"/>
</marker>
</defs>
<path d="M100,100 L100,300 L444,200 L100,500" style="stroke-width:5;stroke:#fff;fill:none" marker-mid="url(#myMarker12)"/>
</svg>
</section>
<section>
<pre class="xml fragment"><code><marker id="myMarkerMid" viewBox="0 0 50 50"
refX="25" refY="25"
orient="auto"
markerUnits="strokeWidth"
markerWidth="3" markerHeight="3">
<rect x="5" y="5" width="50" height="30" fill="yellow"/>
</marker>
</code></pre>
<pre class="xml" data-fragment-index="1"><code><path d="M100,100 L100,300 L444,200 L100,500"
marker-start="url(#circleMarker)"
marker-mid=“url(#myMarkerMid)"
marker-end="url(#circleMarker)"/>
</code></pre>
</section>
<section>
<svg width="400" height="400" viewBox="0 50 550 550"
xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="myMarker" viewBox="0 0 130 130" refX="65" refY="65" orient="auto">
<circle r="65" fill="red" cx="65" cy="65"/>
</marker>
<marker id="myMarkerMid" viewBox="0 0 50 30" refX="25" refY="25" orient="auto" markerUnits="strokeWidth" markerWidth="10" markerHeight="10">
<rect x="5" y="5" width="50" height="30" fill="yellow"/>
</marker>
</defs>
<path d="M100,100 L100,300 L444,200 L100,500"
style="stroke-width:5;stroke:#fff;fill:none"
marker-start="url(#myMarker)"
marker-end="url(#myMarker)" marker-mid="url(#myMarkerMid)"/>
</svg>
</section>
<section>
<h3>Группировка и переиспользование</h3>
<img src="img/giphy-group.gif">
</section>
<section>
<h3><defs></h3>
<p>– для хранения содержимого, которое не будет отображаться при определении.</p>
<pre class="xml fragment"><code><defs>
<marker id="Triangle"
viewBox="0 0 10 10"
refX="5" refY="5"
markerWidth="6"
markerHeight="6"
orient="auto">
<circle r="5" fill="white" cx="5" cy="5"/>
</marker>
<!--gradients-->
<!--filters-->
</defs>
</code></pre>
</section>
<section>
<h3><g></h3>
<p>– используется для логической группировки графических элементов.</p>
<pre><code><svg width="1144.12px" height="400px" viewBox="0 0 572.06 200">
<g id="bird">
<g id="head">...</g>
<g id="body">...</g>
</g>
</svg></code></pre>
</section>
<style>
.show-group .fragment.visible ~ svg #bird {
transition: transform .2s;
transform: rotate(180deg);
transform-origin: 50%;
stroke: red;
}
</style>
<section class="show-group">
<pre class="xml fragment"><code><g id="bird" transform="rotate(180 150 150)" stroke="red">
<g id="head">...</g>
<g id="body">...</g>
</g>
</code></pre>
<svg width="300" height="300" viewBox="30 40 127 99">
<style>
/*svg{background-color:white;}*/
#wing{fill:#81CCAA;}
#body{fill:#B8E4C2;}
#pupil{fill:#1F2600;}
#beak{fill:#F69C0D;}
.eye-ball{fill:#F6FDC4;}
</style>
<g id="bird">
<g id="body">
<path d="M48.42,78.11c0-17.45,14.14-31.58,31.59-31.58s31.59,14.14,31.59,31.58c0,17.44-14.14,31.59-31.59,31.59S48.42,95.56,48.42,78.11"/>
<path d="M109.19,69.88c0,0-8.5-27.33-42.51-18.53c-34.02,8.81-20.65,91.11,45.25,84.73c40.39-3.65,48.59-24.6,48.59-24.6S124.68,106.02,109.19,69.88"/>
<path id="wing" d="M105.78,75.09c4.56,0,8.84,1.13,12.62,3.11c0,0,0.01-0.01,0.01-0.01l36.23,12.38c0,0-13.78,30.81-41.96,38.09c-1.51,0.39-2.82,0.59-3.99,0.62c-0.96,0.1-1.92,0.16-2.9,0.16c-15.01,0-27.17-12.17-27.17-27.17C78.61,87.26,90.78,75.09,105.78,75.09"/>
</g>
<g id="head">
<path id="beak" d="M50.43,68.52c0,0-8.81,2.58-10.93,4.86l9.12,9.87C48.61,83.24,48.76,74.28,50.43,68.52"/>
<circle class="eye-ball" cx="72" cy="71.5" r="11"/>
<circle id="pupil" cx="72" cy="71.5" r="7"/>
<circle class="eye-ball" cx="77" cy="74" r="5"/>
</g>
</g>
</svg>
</section>
<section>
<h3><use></h3>
<p>– применяться для повторного использования как отдельных элементов, так и групп элементов.</p>
<pre class="xml"><code><use x="100" y="100" xlink:href="#bird"/>
<use xlink:href="#bird" transform="translate(250, 250)
scale(0.5)"/>
</code></pre>
</section>
<section>
<svg width="500" height="500">
<style>
/*svg{background-color:white;}*/
#wing{fill:#81CCAA;}
#body{fill:#B8E4C2;}
#pupil{fill:#1F2600;}
#beak{fill:#F69C0D;}
.eye-ball{fill:#F6FDC4;}
</style>
<g id="bird2">
<g id="body">
<path d="M48.42,78.11c0-17.45,14.14-31.58,31.59-31.58s31.59,14.14,31.59,31.58c0,17.44-14.14,31.59-31.59,31.59S48.42,95.56,48.42,78.11"/>
<path d="M109.19,69.88c0,0-8.5-27.33-42.51-18.53c-34.02,8.81-20.65,91.11,45.25,84.73c40.39-3.65,48.59-24.6,48.59-24.6S124.68,106.02,109.19,69.88"/>
<path id="wing" d="M105.78,75.09c4.56,0,8.84,1.13,12.62,3.11c0,0,0.01-0.01,0.01-0.01l36.23,12.38c0,0-13.78,30.81-41.96,38.09c-1.51,0.39-2.82,0.59-3.99,0.62c-0.96,0.1-1.92,0.16-2.9,0.16c-15.01,0-27.17-12.17-27.17-27.17C78.61,87.26,90.78,75.09,105.78,75.09"/>
</g>
<g id="head">
<path id="beak" d="M50.43,68.52c0,0-8.81,2.58-10.93,4.86l9.12,9.87C48.61,83.24,48.76,74.28,50.43,68.52"/>
<circle class="eye-ball" cx="72" cy="71.5" r="11"/>
<circle id="pupil" cx="72" cy="71.5" r="7"/>
<circle class="eye-ball" cx="77" cy="74" r="5"/>
</g>
</g>
<use x="100" y="100" xlink:href="#bird2" />
<use xlink:href="#bird2" transform="translate(100, 100)" />
<use xlink:href="#bird2" transform="translate(250, 250) scale(0.5)" />
</svg>
</section>
<section>
<h3>symbol</h3>
<p>– это группа фигур, представляющая собой единое целое. </p>
<pre class="xml fragment"><code><symbol id="s-path">
<path d="M 30 15 170 15" stroke-width="30">
</symbol>
<use y="20" stroke-linecap="butt"></use>
<use y="85" stroke-linecap="round"></use>
<use y="150" stroke-linecap="square"></use>
</code></pre>
</section>
<section>
<h3>Заливка</h3>
<p>– заливка фигур осуществляется с помощью атрибута fill.</p>
<pre><code><!--currentColor и transparent, none-->
<rect fill="red"/>
</code></pre>
</section>
<section>
<h3>Fill-rule</h3>
<p>– определяет как будут заливаться сложные фигуры, имеющие пересечения внутри себя.</p>
<div class="column _50">
<svg class="svg" width="200" height="200"><path stroke="orange" stroke-width="5" fill="gold" fill-rule="nonzero" d="M 100,20 L 50,180 180,80 20,80 150,180 z"></path></svg>
</div>
<div class="column _50">
<svg class="svg" width="200" height="200"><path stroke="orange" stroke-width="5" fill="gold" fill-rule="evenodd" d="M 100,20 L 50,180 180,80 20,80 150,180 z"></path></svg>
</div>
</section>
<section>
<pre class="xml"><code><g fill="gold" fill-rule="nonzero">
<path d="..."></path>
</g></code></pre>
<pre class="xml"><code><g fill="gold" fill-rule="evenodd">
<path d="..."></path>
</g></code></pre>
</section>
<section>
<code>fill-rule="nonzero"</code>
<div style="background: #fff; display: inline-block;">
<img src="img/nonzero.jpg">
</div>
</section>
<section>
<code>fill-rule="evenodd"</code><br>
<div style="background: #fff; display: inline-block;">
<img src="img/evenodd.jpg">
</div>
</section>
<section>
<h3>Stroke</h3>
<pre><code><rect stroke="gold" stroke-width="10"/>
<rect stroke="yellowgreen" stroke-width="10%"/>
</code></pre>
<svg width="200" height="200">
<rect width="100" height="100" x="50" y="50"
fill="none" stroke="gold"
stroke-width="10"/>
<rect width="160" height="160" x="20" y="20"
fill="none" stroke="yellowgreen"
stroke-width="10%"/>
</svg>
</section>
<section>
<h3>stroke-linecap</h3>
<pre class="xml"><code><symbol id="s-path">
<path d="M 30 15 170 15" stroke-width="30">
</symbol>
<use y="20" stroke-linecap="butt"/>
<use y="85" stroke-linecap="round"/>
<use y="150" stroke-linecap="square"/>
</code></pre>
<svg class="svg" width="200" height="205">
<symbol id="s-path-guide">
<circle r="3" cx="30" cy="15"></circle>
<circle r="3" cx="170" cy="15"></circle>
<path d="M 30 15 170 15" stroke-width="2"></path>
</symbol>
<symbol id="s-path">
<path d="M 30 15 170 15" stroke-width="30"></path>
</symbol>
<use xlink:href="#s-path" stroke="orangered" y="20" stroke-linecap="butt"></use>
<use xlink:href="#s-path" stroke="olivedrab" y="85" stroke-linecap="round"></use>
<use xlink:href="#s-path" stroke="steelblue" y="150" stroke-linecap="square"></use>
<g class="guides">
<use xlink:href="#s-path-guide" y="20" stroke="orange" fill="orange"></use>
<use xlink:href="#s-path-guide" y="85" stroke="yellowgreen" fill="yellowgreen"></use>
<use xlink:href="#s-path-guide" y="150" stroke="skyblue" fill="skyblue"></use>
</g></svg>
</section>
<section>
<h3>Stroke-linejoin</h3>
<pre class="xml"><code><use xlink:href="#s-corner" stroke-linejoin="miter"></use>
<use xlink:href="#s-corner" stroke-linejoin="round"/>
<use xlink:href="#s-corner" stroke-linejoin="bevel"/>
</code></pre>
<svg class="svg" width="215" height="300">
<symbol id="s-corner-guide">
<circle r="3" cx="50" cy="100"></circle>
<circle r="3" cx="164" cy="100"></circle>
<path d="M 30 50 h 80 v 80" stroke-width="2" fill="none" transform="rotate(-45 100 50)"></path>
</symbol>
<symbol id="s-corner">
<path d="M 30 50 h 80 v 80" stroke-width="30" fill="none" transform="rotate(-45 100 50)"></path>
</symbol>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner" stroke="orangered" y="0" stroke-linejoin="miter"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner" stroke="olivedrab" y="80" stroke-linejoin="round"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner" stroke="steelblue" y="160" stroke-linejoin="bevel"></use>
<g class="guides">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner-guide" y="0" stroke="orange" fill="orange"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner-guide" y="80" stroke="yellowgreen" fill="yellowgreen"></use>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#s-corner-guide" y="160" stroke="skyblue" fill="skyblue"></use>
</g></svg>
</section>
<section>
<h3>Stroke-dasharray</h3>
<p>– управляет видом пунктирной обводки.</p>
<div class="column"><svg width="300" height="400" viewBox="15 0 120 60" preserveAspectRatio="xMinYMin meet">
<path d="M 20 20 h 260"
stroke="purple" stroke-width="1"
stroke-dasharray="1" />
<path d="M 20 40 h 260"
stroke="mediumspringgreen" stroke-width="15"
stroke-dasharray="1 3" />
<path d="M 20 60 h 260"
stroke="orangered" stroke-width="1"
stroke-dasharray="5%" />
<path d="M 20 80 h 260"
stroke="green" stroke-width="1"
stroke-dasharray="1 5" />