-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.htm
775 lines (671 loc) · 40.8 KB
/
index.htm
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
<!DOCTYPE HTML>
<html>
<head> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>SVG sidekick - Simply Create Elegant SVG Drawings </title>
<script type="text/javascript" src="highlight.pack.js"></script>
<script type="text/javascript" src="highlightCode.js"></script>
<link href='highlight.css' rel='stylesheet' />
<link rel="shortcut icon" href="Images/favicon.ico" type="image/x-icon">
<script charset="UTF-8" type="text/javascript" src="js00_utility/iframeSelection.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/color.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/pathSeg.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/select.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/helperFuncts.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/print.js"></script>
<script charset="UTF-8" type="text/javascript" src="js00_utility/zoom.js"></script>
<script charset="UTF-8" type="text/javascript" src="js01_start/jquery2.js"></script>
<script charset="UTF-8" type="text/javascript" src="js01_start/initD3Svg.js"></script>
<script charset="UTF-8" type="text/javascript" src="js01_start/grid.js"></script>
<script charset="UTF-8" type="text/javascript" src="js02_location/cursorLoc.js"></script>
<script charset="UTF-8" type="text/javascript" src="js02_location/transformAdd.js"></script>
<script charset="UTF-8" type="text/javascript" src="js04_svgSource/handleSource.js"></script>
<script charset="UTF-8" type="text/javascript" src="js04_svgSource/showSource.js"></script>
<script charset="UTF-8" type="text/javascript" src="d3.v4.min.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjZoom.js"></script>
<style type="text/css">
.noselect {
/*---prevent text element focus under create/edit elements---*/
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
unselectable="on"
onselectstart="return false;"
onmousedown="return false;"
}
</style>
</head>
<body style='font-family:arial' >
<DIV id=containerDiv style=position:absolute;top:40px;left:0px >
<TABLE>
<TR>
<TD valign=top>
<DIV ID="iframeDiv" style='position:relative;top:0px;left:0px;width:400px'>
<div id=addElemIconFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemIconFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Icon/drawIcon.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjIcon.js"></script>
<div id=addElemCircleFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemCircleFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Circle/drawCircle.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjCircle.js"></script>
<div id=addElemArcFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemArcFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Arc/drawArc.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjArc.js"></script>
<div id=addElemEllipseFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemEllipseFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Ellipse/drawEllipse.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjEllipse.js"></script>
<div id=addElemRectFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemRectFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Rect/drawRect.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjRect.js"></script>
<div id=addElemTextFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemTextFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Text/drawText.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjText.js"></script>
<div id=addElemPathFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemPathFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/drawPath.js"></script>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/drawPathButton.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragPathPoint.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragAddPath.js"></script>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/pathZoneMarker.js"></script>
<div id=addElemPathEditFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemPathEditFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/drawPathEdit.js"></script>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/drawPathEditButton.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragPathPointEdit.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragPathEdit.js"></script>
<script charset="UTF-8" type="text/javascript" src="AddElem/Path/pathEditZoneMarker.js"></script>
<div id=addElemSymbolFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemSymbolFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Symbol/drawSymbol.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjSymbol.js"></script>
<div id=addElemTextureFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemTextureFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Texture/drawTexture.js"></script>
<script charset="UTF-8" type="text/javascript" src="AddElem/Texture/textures.js"></script>
<div id=addElemGradientFrameDiv style='border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemGradientFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Gradient/drawGradient.js"></script>
<div id=addElemPolygonFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemPolygonFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/Polygon/drawPolygon.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjPolygon.js"></script>
<div id=addElemBGimageFrameDiv style='padding:10px;border-radius:10px;position:fixed;visibility:hidden;width:1px;height:1px;overflow:hidden'><iframe id=addElemBGimageFrame style='border-width:0px;height:1px;overflow:hidden;' scrolling='no' frameborder='0' ></iframe></div>
<script charset="UTF-8" type="text/javascript" src="AddElem/BGimage/drawBGimage.js"></script>
<script charset="UTF-8" type="text/javascript" src="js03_drag/dragObjBGimage.js"></script>
</DIV>
</TD>
<TD>
<div id=svgDiv style="border:1px solid black;width:800px;height:560px">
<svg id=mySVG width=800 height=560 viewBox="0 0 800 560" style="cursor:default">
<style type="text/css" >
<![CDATA[
.grid line {
stroke: lightgrey;
stroke-opacity: 0.7;
shape-rendering: crispEdges;
}
.grid path {
stroke-width: 0;
}
]]>
</style>
</svg>
</div>
<center> (To edit an element, <b>click right-mouse button</b> when the cursor is over the element.)
<p></p>
Drawing Width:<input type="text" value=800 id=svgWidthValue style='width:40px' />
Drawing Height:<input type="text" value=560 id=svgHeightValue style='width:40px' /> <button id=setSVGSizeButton onClick=setSVGSizeButtonClicked() title="Set SVG drawing size">set</button>
<TABLE><TR>
<TD> <button title="Show current drawing's SVG source" onClick=svgCopy()>SVG Source</button> <button title="Copy SVG for other applications" onClick=publishSVG()>Publish</button>
<button id=clearButton title="Clear current SVG drawing" onClick=clearButtonClicked() >Clear/Start Over</button> </TD>
<TD>
<table>
<tr>
<td>Save/Edit SVG:</td>
<td><input id="inputFileNameToSaveAs" placeholder="Save fileName.svg"></input></td>
<td><button Title="Save current drawing to your computer for future editing" onclick="saveSvgAsFile()">save</button></td>
</tr>
</table>
</TD>
<TD>
<button title="Edit an existing SVG sidekick drawing" onClick=openExistingSVG()>Existing<br>SVG</button></TD>
</TR>
<TR>
<TD COLSPAN=3 ALIGN=CENTER> <div class="copy" id=existingSVGDiv style="display:none">
<textarea id=existingSVGValue placeholder="Paste existing SVG Sidekick svg source here..." style=width:90%;height:100px></textarea>
<br> <button id=closeExistingDivButton style='visibility:hidden' title="Close" onclick=closeExistingDiv()>cancel</button> <button style=color:blue; onClick=insertExistingSVG()><u>insert</u></button>
</div> </TD>
</TR></TABLE>
<div class="copy" id=publishSVGDiv style="display:none">
<center>Download this schematic to your computer for publication in other applications.</center>
<textarea id=publishSVGValue style=width:90%;height:100px></textarea>
<table>
<tr>
<td><nobr>Publish SVG As:</nobr></td>
<td><input id="inputPublishFileNameToSaveAs" placeholder="Include your fileName.svg"></input></td>
<td><button Title="Save current drawing to your computer" onclick="publishSvgAsFile()">send</button></td>
<td><button style='background:lightgreen' Title="Publish: Mobile-Friendly" onclick="openMobileHelp()">Mobile</button></td>
<td><button id=closePublishDivButton style='visibility:hidden;border-width:0px;' title="Close" onclick=closePublishDiv()><u style=color:blue>Close</u></button></td>
</tr>
</table>
</div>
</center>
</TD>
</TR>
</TABLE>
<center>
<div id=svgSaveDiv class="copySource" style=display:none;height:1px;overflow:auto;width:1200px;text-align:left; /></div>
<div id=svgSourceDiv style=display:none;overflow:auto;width:1200px;text-align:left; /></div>
<p></p>
<div style='width:100%;text-align:right' >Download SVGsidekick .zip file <a href="https://github.com/fhemsher/SVG-Sidekick" target="_blank">SVGsidekick.com Files</a></div>
<div id=emDiv style='width:100%;text-align:right' ></div>
</center>
</DIV>
<div id=introDiv style='position:absolute;top:40px;left:10px;width:360px;height:640px;background:#ABCDEF;border:1px solid blue;border-radius:15px;padding:10px;color:MIDNIGHTBLUE'>
<center>
<b>Create/Save/Edit SVG Drawings</b><br>
<img src="Images/intro.png" alt="Create/Save/Edit SVG Drawings" />
</center>
</div>
<div id=helpDiv style='visibility:hidden;position:absolute;top:40px;left:10px;width:360px;height:1px;background:#ABCDEF;border:1px solid blue;border-radius:15px;padding:10px;color:midnightblue;overflow:hidden'>
<table style=width:100%><td style=width:90%; align=center><h7><b>Simply Create Elegant SVG Drawings</b></h7></td><td align=right><button onclick=closeHelp()>X</button></td></table>
<p></p>
<b>Paths</b> - Both linear and curved paths can be created by clicking their points on the drawing. Drag any point to modify its shape.
<br>Paths can also create 3d-like stroke:
<center><img src="Images/pipe3d.png" alt="" width="115" height="61" /></center>
<br>Paths can include evenly-spaced markers along the path:
<center><svg xmlns="http://www.w3.org/2000/svg" id="publishSVG" width="300" height="60" viewBox="0 0 300 60" style="cursor: default; touch-action: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><style xmlns="http://www.w3.org/1999/xhtml"></style><defs xmlns="http://www.w3.org/1999/xhtml"></defs>
<g id="publishG"><g id="publishElemG" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" pointer-events="none"><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(33,23)rotate(57.52877418269262)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(40.761165618896484,34.64546203613281)rotate(-127.78653371949643)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(51.5299186706543,43.34810256958008)rotate(20.511912412806225)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(65.26084899902344,43.62485885620117)rotate(165.78722864430893)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(78.42819213867188,38.89059829711914)rotate(-21.754004011747273)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(91.61798858642578,34.218658447265625)rotate(164.49467862385941)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(105.46361541748047,33.25312042236328)rotate(11.145924748692435)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(118.62879180908203,37.90804672241211)rotate(-155.73611872524313)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(131.64048767089844,43.03495407104492)rotate(14.667089803707556)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(145.50650024414062,44.05995559692383)rotate(173.4154664731933)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(159.0949249267578,40.76487731933594)rotate(-17.814757045046537)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(172.3617401123047,36.29092025756836)rotate(161.4523200030853)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(185.81329345703125,32.43181228637695)rotate(-11.843642515807561)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(199.71221923828125,31.258516311645508)rotate(-175.87414335827106)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(213.20037841796875,34.800254821777344)rotate(22.91443277354848)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(225.7602996826172,40.97504425048828)rotate(-152.19894898728347)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(238.49392700195312,46.751407623291016)rotate(16.769713021059296)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(252.28749084472656,47.265995025634766)rotate(166.869269985224)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(264.9097595214844,41.36123275756836)rotate(-33.97558263619209)">▲</text><text font-size="15" text-anchor="middle" font-family="Arial Unicode MS" stroke-width="0.3" fill="#DC143C" stroke="black" transform="translate(275.83447265625,32.62757873535156)rotate(137.65995981044193)">▲</text><path fill="none" fill-opacity="0" stroke="#9400D3" stroke-width="2" d="M33,23L36.5,28.5C40,34,47,45,58.83336,44.66664C70.6667,44.33336,87.3333,32.66664,101.1667,32.83336C115,33,126,45,142.3334,44.33336C158.6666,43.66664,180.3334,30.33332,198.3334,31.16668C216.3334,32,230.6666,47,244.6666,48C258.667,49,272.333,36,279.167,29.5L286,23" linearD="M 33 23 L 54 56 L 104 21 L 137 57 L 202 17 L 245 62 L 286 23" markers="true" marker-unicode="25B2" marker-fill="#DC143C" marker-fontsize="15" marker-quantity="20"/></g></g></svg></center>
<p></p><b>Symbols</b> - This a list of thirty(30) polygons that can be created and placed in the drawing.
<center><img src="Images/symbols.png" alt="" /></center>
<p></p><b>Icons</b> - Over 500 icons created from groups of unicode text elements: DINGBATS, GEOMETRIC, ARROWS, MATHEMATICAL, TECHNICAL, and SYMBOLS.
<center><img src="Images/icons.png" alt="" /></center>
<p></p><b>Textures</b> - Three(3) types of pre-built patterns are available: circles, lines, and paths. The pattern is placed in either an element's fill or stroke.
<p></p><b>Gradients</b> - Radial and linear gradients can be created to be placed in either an element's fill or stroke.
<p></p> <b>Shadows</b> - Each element can be selected to include a drop-shadow.
<p></p> <b>Save/Edit SVG Drawing</b> - You may save the drawing within an .svg drawing stored on your computer. It can then be edited in the future by placing the file in the textarea, under the 'Existing SVG' selection.
<br><br><img align=left src="Images/rightClick.png" alt="" width="45" height="65" /> NOTE: Any element can be changed with cursor over element & mouse <b style=color:red>Right-Click</b>.
</div
<center>
<div id=selectDrawElemDiv style='position:fixed;top:5px;left:0px;'><b><span style=color:red>SVG</span> <span style=color:blue><i>sidekick</i></span></b> <button onClick=openHelp() style=width:20px;height:20px;border:0px;padding:0px;background:white><img src="Images/help.png" width=20 height=20 alt="" /></button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddCircleButton style=background-color:linen onClick=openAddCircleDraw()>Circles</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddEllipseButton style=background-color:linen onClick=openAddEllipseDraw()>Ellipses</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddRectButton style=background-color:linen onClick=openAddRectDraw()>Rectangles</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddTextButton style=background-color:linen onClick=openAddTextDraw()>Text</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddPathButton style=background-color:linen onClick=openAddPathDraw()>Paths</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddArcButton style=background-color:linen onClick=openAddArcDraw()>Arcs</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddPolygonButton style=background-color:linen onClick=openAddPolygonDraw()>Polygons</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddIconButton style=background-color:linen onClick=openAddIconDraw()>Icons</button>
<button onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddSymbolButton style=background-color:#538BBA;color:white onClick=openAddSymbolDraw()>Symbols</button>
<button title="Add pattern/texture fill to elements" onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddTextureButton style=background-color:linen onClick=openAddTexture()><i>Textures</i></button>
<button title="" onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddGradientButton style=background-color:linen onClick=openAddGradient()><i>Gradients</i></button>
<button title="Import image from your computer as background template" onmouseover=this.style.borderColor="lime" onmouseout=this.style.borderColor='' id=openAddBGimageButton style=background-color:ghostwhite onClick=openAddBGimage() >Template Image</button>
</div>
</center>
<div id=elemSizeDiv
style='box-shadow: 4px 4px 4px #888888;-webkit-box-shadow:2px 3px 4px #888888;
font-size:80%;z-index:20;padding:4px;position:absolute;top:0px;left:0px;visibility:hidden;
background-color:linen;border: solid 1px black;border-radius:5px;cursor:default;'>
</div>
<div id=savedTextureDiv style='padding:5px;border-radius:8px;border:2px lightblue solid;visibility:hidden;background:linen;position:fixed;top:5px;left:400px;width:800px;height:70px;overflow-y:hidden;'>
<table id=savedTextureTable ><tr align=center></tr></table>
</div>
<div style='position:fixed;top:5px;left:95%'><button onClick=zoomDrawing() title="Mousewheel Zoom Drawing" id=zoomButton style='background:transparent;border:0px;width:30px;height:30px;padding:0px'><img src="Images/zoomButton.png" width=25 height=25 /></button> <button onClick=openZoomHelp() style=width:20px;height:20px;padding:0px;border:0px;background:transparent ><img src="Images/help.png" width=20 height=20 /></button> </div>
<div id=zoomHelpDiv style='background:white;visibility:hidden;position:fixed;top:60px;left:70%;width:300px;height:1px;border:1px solid blue;border-radius:5px;padding:10px;overflow:hidden'>
<table style=width:100%><td style=width:90%; align=center><h7><b>Mousewheel Zoom</b></h7></td><td align=right><button onclick=closeZoomHelp()>X</button></td></table>
<div style=text-align:justify>
Select this to zoom into the drawing via the mousewheel.<p></p>When zoomed you may drag/drop any element: With the cursor
over the element<img align=center src="Images/rightClick.png" alt="" width="45" height="65" /> <b>right-click</b> the mouse button, then drag the element.
<p></p>
To close the Mousewheel zoom feature, click the red zoom button symbol.
<img align=left src="Images/zoomRedButton.png" alt="" width="25" height="25" />
</div>
</div>
<div id=publishMobileDiv style='background:lightgreen;visibility:hidden;position:fixed;top:80px;left:40%;width:400px;height:1px;border:1px solid blue;border-radius:5px;padding:10px;overflow:hidden'>
<table style=width:100%><td style=width:90%; align=center><h7><b>Publish SVG Drawing: Mobile-Friendly</b></h7></td><td align=right><button onclick=closeMobileHelp()>X</button></td></table>
<div style=text-align:justify>
Excellent mobile-friendly interactive SVG zoom/pan<br>
The following is the typical HTML source at your website's web page to publish your drawing for mobile units.
<center>Copy (Ctrl-C) the below:</center>
<textarea style='width:400px;height:400px;font-size:80%;'>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Zoom SVG Drawing using Leaflet</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin=""/>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA==" crossorigin=""></script>
</head>
<body onload=init() style='padding:0px;font-family:arial'>
<div style=position:absolute;top:0px;left:0px id="MyDrawing" ></div>
<script id=myScript>
var MyDrawing = L.map('MyDrawing', {
crs: L.CRS.Simple,
zoomControl:false //--remove +- buttons---
});
function init()
{
var myDiv=document.getElementsByTagName("div")[0]
myDiv.style.width=window.innerWidth+"px"
myDiv.style.height=window.innerHeight+"px"
var bounds = [[0,0], [window.innerWidth,window.innerHeight]];
var image = L.imageOverlay('mySVGFile.svg', bounds).addTo(MyDrawing);
MyDrawing.fitBounds(bounds);
}
</script>
</body>
</html>
</textarea>
</div>
</div>
</body>
<script>
function openHelp()
{
var height=helpDiv.scrollHeight
d3.select("#helpDiv").transition().duration(800).style("height", height+"px")
helpDiv.style.visibility="visible"
introDiv.style.visibility="hidden"
}
function closeHelp()
{
var height=1
d3.select("#helpDiv").transition().duration(800).style("height", height+"px")
setTimeout('helpDiv.style.visibility="hidden"',900)
}
function openZoomHelp()
{
var height=zoomHelpDiv.scrollHeight
d3.select("#zoomHelpDiv").transition().duration(500).style("height", height+"px")
zoomHelpDiv.style.visibility="visible"
}
function closeZoomHelp()
{
var height=1
d3.select("#zoomHelpDiv").transition().duration(500).style("height", height+"px")
setTimeout('zoomHelpDiv.style.visibility="hidden"',600)
}
function openMobileHelp()
{
var height=publishMobileDiv.scrollHeight
d3.select("#publishMobileDiv").transition().duration(500).style("height", height+"px")
publishMobileDiv.style.visibility="visible"
}
function closeMobileHelp()
{
var height=1
d3.select("#publishMobileDiv").transition().duration(500).style("height", height+"px")
setTimeout('publishMobileDiv.style.visibility="hidden"',600)
}
function svgCopy()
{
svgSaveDiv.style.display="block"
showSaveSVG()
}
function destroyClickedElement(event)
{
document.body.removeChild(event.target);
}
//================insert/edit existing svg================
function openExistingSVG()
{
existingSVGDiv.style.display="block"
closeExistingDivButton.style.visibility="visible"
existingSVGValue.focus()
}
function closeExistingDiv()
{
existingSVGDiv.style.display="none"
closeExistingDivButton.style.visibility="hidden"
}
function insertExistingSVGxxx()
{
clearButtonClicked()
var svgString=existingSVGValue.value.replace(/\\n/g,"")
var parser = new DOMParser();
var SVGdoc=parser.parseFromString(svgString,"text/xml").documentElement;
var svgWidth=SVGdoc.getAttribute("width")
var svgHeight=SVGdoc.getAttribute("height")
svgWidthValue.value=svgWidth
svgHeightValue.value=svgHeight
svgDiv.style.width=svgWidth+"px"
svgDiv.style.height=svgHeight+"px"
mySVG.setAttribute("width",svgWidth)
mySVG.setAttribute("height",svgHeight)
mySVG.setAttribute("viewBox", "0 0 "+svgWidth+" "+svgHeight)
createGridLayer()
var zooomG=SVGdoc.getElementsByTagName("g")[0]
for(var k=0;k<SVGdoc.childNodes.length;k++)
{
var elem=SVGdoc.childNodes.item(k)
if(elem.nodeName!="#text")
{
if(elem.id=="arrowDefs")
{
var arrows=elem.childNodes
for(var a=0;a<arrows.length;a++)
if(arrows.item(a).nodeName!="#text")
arrowDefs.appendChild(arrows.item(a).cloneNode(true))
}
if(elem.id=="defsPattern")
{
var patterns=elem.childNodes
for(var a=0;a<patterns.length;a++)
if(patterns.item(a).nodeName!="#text")
defsPattern.appendChild(patterns.item(a).cloneNode(true))
}
if(elem.id=="defsGradient")
{
var gradients=elem.childNodes
for(var a=0;a<gradients.length;a++)
if(gradients.item(a).nodeName!="#text")
defsGradient.appendChild(gradients.item(a).cloneNode(true))
}
}
}
for(var m=0;m<zooomG.childNodes.length;m++)
{
var elem=zooomG.childNodes.item(m)
if(elem.nodeName!="#text")
{
if(elem.id=="topG")
{
elem.setAttribute("pointer-events","none")
for(var z=0;z<elem.childNodes.length;z++)
{
var elz=elem.childNodes.item(z)
if(elz.nodeName!="#text")
{
if (elz.id=="domAddPathG")
{
var pathG = elz
for(var p = 0; p<pathG.childNodes.length; p++)
{
if(pathG.childNodes.item(p).nodeName!="#text")
{
var pathId="path"+p
pathG.childNodes.item(p).setAttribute("id",pathId)
pathG.childNodes.item(p).setAttribute("onmousedown","startPathDrawEdit("+pathId+",evt)");
domAddPathG.appendChild(pathG.childNodes.item(p).cloneNode(true))
}
}
}
else if(elz.id=="domAddElemG")
{
var elemG =elz
for(var e = 0; e<elemG.childNodes.length; e++)
{
var el=elemG.childNodes.item(e)
if(el.nodeName!="#text")
{
if(el.nodeName=="circle")
{
var id="circle"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editCircleDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="polygon")
{
var id="polygon"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editPolygonDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="ellipse")
{
var id="ellipse"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editEllipseDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="rect")
{
var id="rect"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editRectDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="text")
{
var id="text"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editTextDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
}
}
}
}
}
} //---topG---
if(elem.id=="domAddSymbolG")
{
for(var p = 0; p<elem.childNodes.length; p++)
{
var el=elem.childNodes.item(p)
if(el.nodeName!="#text")
{
var id="symbol"+p
el.setAttribute("id",id)
el.setAttribute("class","dragTargetObj")
el.setAttribute("onmousedown","editPgonStart(evt)");
domAddSymbolG.appendChild(el.cloneNode(true))
}
}
}
if(elem.id=="domAddIconG")
{
for(var p = 0; p<elem.childNodes.length; p++)
{
var el=elem.childNodes.item(p)
if(el.nodeName!="#text")
{
var id="icon"+p
el.setAttribute("id",id)
el.setAttribute("class","dragTargetObj")
el.setAttribute("onmousedown","editIconStart(evt)");
domAddIconG.appendChild(el.cloneNode(true))
}
}
}
}//---#text
} //---zoomG---
closeExistingDiv()
showSourceSVG()
showSaveSVG()
}
function zzzinsertExistingSVG()
{
if(existingSVGValue.value!="")
{
clearButtonClicked()
var svgString=existingSVGValue.value.replace(/\\n/g,"")
var parser = new DOMParser();
var SVGdoc=parser.parseFromString(svgString,"text/xml").documentElement;
var svgWidth=SVGdoc.getAttribute("width")
var svgHeight=SVGdoc.getAttribute("height")
svgWidthValue.value=svgWidth
svgHeightValue.value=svgHeight
svgDiv.style.width=svgWidth+"px"
svgDiv.style.height=svgHeight+"px"
mySVG.setAttribute("width",svgWidth)
mySVG.setAttribute("height",svgHeight)
mySVG.setAttribute("viewBox", "0 0 "+svgWidth+" "+svgHeight)
createGridLayer()
for(var k=0;k<SVGdoc.childNodes.length;k++)
{
var elem=SVGdoc.childNodes.item(k)
if(elem.nodeName!="#text")
{
if(elem.id=="arrowDefs")
{
var arrows=elem.childNodes
for(var a=0;a<arrows.length;a++)
if(arrows.item(a).nodeName!="#text")
arrowDefs.appendChild(arrows.item(a).cloneNode(true))
}
if(elem.id=="defsPattern")
{
var patterns=elem.childNodes
for(var a=0;a<patterns.length;a++)
if(patterns.item(a).nodeName!="#text")
defsPattern.appendChild(patterns.item(a).cloneNode(true))
}
if(elem.id=="defsGradient")
{
var gradients=elem.childNodes
for(var a=0;a<gradients.length;a++)
if(gradients.item(a).nodeName!="#text")
defsGradient.appendChild(gradients.item(a).cloneNode(true))
}
if(elem.id=="topG")
{
elem.setAttribute("pointer-events","none")
for(var z=0;z<elem.childNodes.length;z++)
{
var elz=elem.childNodes.item(z)
if(elz.nodeName!="#text")
{
if (elz.id=="domAddPathG")
{
var pathG = elz
for(var p = 0; p<pathG.childNodes.length; p++)
{
if(pathG.childNodes.item(p).nodeName!="#text")
{
var pathId="path"+p
pathG.childNodes.item(p).setAttribute("id",pathId)
pathG.childNodes.item(p).setAttribute("onmousedown","startPathDrawEdit("+pathId+",evt)");
domAddPathG.appendChild(pathG.childNodes.item(p).cloneNode(true))
}
}
}
else if(elz.id=="domAddElemG")
{
var elemG =elz
for(var e = 0; e<elemG.childNodes.length; e++)
{
var el=elemG.childNodes.item(e)
if(el.nodeName!="#text")
{
if(el.nodeName=="circle")
{
var id="circle"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editCircleDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="polygon")
{
var id="polygon"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editPolygonDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="ellipse")
{
var id="ellipse"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editEllipseDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="rect")
{
var id="rect"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editRectDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
if(el.nodeName=="text")
{
var id="text"+e
el.setAttribute("id",id)
el.setAttribute("onmousedown","editTextDraw("+id+",evt)");
domAddElemG.appendChild(el.cloneNode("true"))
}
}
}
}
}
}
}
if(elem.id=="domAddSymbolG")
{
for(var p = 0; p<elem.childNodes.length; p++)
{
var el=elem.childNodes.item(p)
if(el.nodeName!="#text")
{
var id="symbol"+p
el.setAttribute("id",id)
el.setAttribute("class","dragTargetObj")
el.setAttribute("onmousedown","editPgonStart(evt)");
domAddSymbolG.appendChild(el.cloneNode(true))
}
}
}
if(elem.id=="domAddIconG")
{
for(var p = 0; p<elem.childNodes.length; p++)
{
var el=elem.childNodes.item(p)
if(el.nodeName!="#text")
{
var id="icon"+p
el.setAttribute("id",id)
el.setAttribute("class","dragTargetObj")
el.setAttribute("onmousedown","editIconStart(evt)");
domAddSymbolG.appendChild(el.cloneNode(true))
}
}
}
}
}
closeExistingDiv()
showSourceSVG()
showSaveSVG()
}
}
document.addEventListener("onload",init(),false)
function init()
{
initD3Svg()
createGridLayer()
startCursorLoc()
// showSourceSVG()
// showSaveSVG()
writeEM()
$(".copy").children().bind('contextmenu', function(e){
e.stopPropagation();
});
$(".copySource").bind('contextmenu', function(e){
e.stopPropagation();
});
d3.select("#textSVG").transition().duration(5000).attr("opacity",0)
setTimeout('mySVG.removeChild(textSVG)',5000)
}
function setSVGSizeButtonClicked()
{
var svgWidth=svgWidthValue.value
var svgHeight=svgHeightValue.value
svgDiv.style.width=svgWidth+"px"
svgDiv.style.height=svgHeight+"px"
mySVG.setAttribute("width",svgWidth)
mySVG.setAttribute("height",svgHeight)
mySVG.setAttribute("viewBox", "0 0 "+svgWidth+" "+svgHeight)
createGridLayer()
showSourceSVG()
showSaveSVG()
}
document.addEventListener('contextmenu', event => event.preventDefault());
function writeEM()
{
var em="Contact: "
em+="fhem"
em+="sher"
em+="@"
em+="gm"
em+="ail."
em+="com"
emDiv.innerHTML=em +" <span style=color:blue>Last Update: 1/16/2019</span>"
}
</script>
</html>