-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcssGenerator.html
1974 lines (1696 loc) · 67.9 KB
/
cssGenerator.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>
<title>CSS Generator by OZTAS</title>
<meta charset="utf-8">
<style type="text/css">
div.main{
margin-top: 6px;
margin-left: 300px;
margin-right: 300px;
padding-left: 20px;
padding-top: 30px;
/*border-radius: 10px 10px 10px 10px;*/
background-color: #F0F0F0;
}
summary{
font-size: 14px;
background-color: CCCC66;
color: orange;
height: 20px;
display: block;
cursor: pointer;
}
summary::-webkit-details-marker {
display: none
}
summary:after {
border-radius: 1px;
width: 20px;
content: "+";
float: left;
font-size: 14px;
text-align: left;
}
details[open] summary:after {
content: "-";
}
.txt {
width: 100px;
}
header{
margin-left: 300px;
margin-right: 300px;
padding-left: 20px;
padding-top: 6px;
border-radius: 10px 10px 0px 0px;
background-color: #F0F0F0;
padding-bottom: 10px;
}
footer{
margin-left: 300px;
margin-right: 300px;
padding-left: 20px;
padding-top: 10px;
border-radius: 0px 0px 10px 10px;
background-color: #F0F0F0;
margin-top: 6px;
font-family: verdana;
font-size: 10px;
text-align: center;
}
</style>
<!-- ********************************************************js for text************************************************************************ -->
<script type="text/javascript">
// variables
var fontSizeUp;
var textColor = "#000000";
var textBackgroundColor = "#FFFFFF";
var textAlignSituation = "left";
var textTransformSituation = "none";
var textBorderStyleSituation = "ridge";
var textW;
var textH;
var borderRadiusX1;
var borderRadiusY1;
var borderRadiusX2;
var borderRadiusY2;
var textBorderSize;
var textBorderCol = "#000000";
var textPaddingT;
var textPaddingL;
var textPaddingR;
var textPaddingB;
var textMarginT;
var textMarginL;
var textMarginR;
var textMarginB;
var textBoxShadowT;
var textBoxShadowL;
var textBoxShadowR;
var textBoxShadowB;
var textBoxShadowColor;
// initFunction for textArea
function initFunction(){
// button code for code area;
initBtnFunction();
// label code for code area;
initLabelFunction();
// text: font-size
fontSizeUp = document.getElementById("fontSizeUp").value;
// text: color
textColor = document.getElementById("textColor").value;
// text: background-color
textBackgroundColor = document.getElementById("textBackgroundColor").value;
// text: width
textW = document.getElementById("textWidth").value;
// text: height
textH = document.getElementById("textHeight").value;
// text: border-radius
borderRadiusX1 = document.getElementById("borderRadiusX1").value;
borderRadiusY1 = document.getElementById("borderRadiusY1").value;
borderRadiusX2 = document.getElementById("borderRadiusX2").value;
borderRadiusY2 = document.getElementById("borderRadiusY2").value;
// text: border-size
textBorderSize = document.getElementById("textBorderSize").value;
// text: border-color
textBorderCol = document.getElementById("textBorderCol").value;
// text: padding-top
textPaddingT = document.getElementById("textPaddingT").value;
// text: padding-left
textPaddingL = document.getElementById("textPaddingL").value;
// text: padding-right
textPaddingR = document.getElementById("textPaddingR").value;
// text: padding-bottom
textPaddingB = document.getElementById("textPaddingB").value;
// text: margin-top
textMarginT = document.getElementById("textMarginT").value;
// text: margin-left
textMarginL = document.getElementById("textMarginL").value;
// text: margin-right
textMarginR = document.getElementById("textMarginR").value;
// text: margin-bottom
textMarginB = document.getElementById("textMarginB").value;
// text: box-shadow
textBoxShadowT = document.getElementById("textBoxShadowT").value;
textBoxShadowL = document.getElementById("textBoxShadowL").value;
textBoxShadowR = document.getElementById("textBoxShadowR").value;
textBoxShadowB = document.getElementById("textBoxShadowB").value;
// get color
textBoxShadowColor = document.getElementById("textBoxShadowColor").value;
// initParams are the properties of page for codeArea
var initParams1 = "{\n" + "font-size: " + fontSizeUp + "px;\n" + "color: " + textColor + ";\n";
var initParams2 = "background-color: " + textBackgroundColor + ";\n" + "text-align: " + textAlignSituation + ";\n" + "text-transform: " + textTransformSituation + ";\n";
var initParams3 = "height: " + textH + "px;\n" + "border-radius: " + borderRadiusX1 + "px " + borderRadiusY1 + "px " + borderRadiusX2 + "px " + borderRadiusY2 + "px;\n";
var initParams4 = "border: " + textBorderSize + "px;\n" + "border-color: " + textBorderCol + ";\n";
var initParams5 = "border-style: " + textBorderStyleSituation + ";\n" + "width: " + textW + "px;\n";
var initParams6 = "padding-top: " + textPaddingT + "px;\n" + "padding-left: " + textPaddingL + "px;\n" + "padding-right: " + textPaddingR + "px;\n" + "padding-bottom: " + textPaddingB + "px;\n";
var initParams7 = "margin-top: " + textMarginT + "px;\n" + "margin-left: " + textMarginL + "px;\n" + "margin-right: " + textMarginR + "px;\n" + "margin-top: " + textMarginT + "px;\n";
var initParams8 = "box-shadow: " + textBoxShadowT + "px " + textBoxShadowL + "px " + textBoxShadowR + "px " + textBoxShadowB + "px " + textBoxShadowColor + ";\n}";
// write initParams to codeArea
var initParams = initParams1 + initParams2 + initParams3 + initParams4 + initParams5 + initParams6 + initParams7 + initParams8;
document.getElementById("codeArea").value = initParams;
}
// RGB color chooser
var colorR;
var colorG;
var colorB;
function colorLabel(){
colorR = document.getElementById("labelRColor").value;
colorG = document.getElementById("labelGColor").value;
colorB = document.getElementById("labelBColor").value;
document.getElementById("colorTD").style.backgroundColor = "rgb(" + parseInt(colorR) + ", " + parseInt(colorB) + ", " + parseInt(colorG) + ")";
document.getElementById("colorR").innerHTML = colorR;
document.getElementById("colorG").innerHTML = colorG;
document.getElementById("colorB").innerHTML = colorB;
}
// text font-size
function textFontSize(){
fontSizeUp = document.getElementById("fontSizeUp").value;
document.getElementById("text").style.fontSize = parseInt(fontSizeUp) + "px";
initFunction();
}
// text color chooser
function colorText(){
textColor = document.getElementById("textColor").value;
document.getElementById("text").style.color = textColor;
initFunction();
}
// text background-color chooser
function colorTextBackGround(){
textBackgroundColor = document.getElementById("textBackgroundColor").value;
document.getElementById("text").style.backgroundColor = textBackgroundColor;
initFunction();
}
// text-align - > left
function textAlignLeft(){
textAlignSituation = "left";
document.getElementById("text").style.textAlign = "left";
initFunction();
}
// text-align - > center
function textAlignCenter(){
textAlignSituation = "center";
document.getElementById("text").style.textAlign = "center";
initFunction();
}
// text-align - > right
function textAlignRight(){
textAlignSituation = "right";
document.getElementById("text").style.textAlign = "right";
initFunction();
}
// text-transform -> none
function textTransformNone(){
textTransformSituation = "none";
document.getElementById("text").style.textTransform = "none";
initFunction();
}
// text-transform -> capitalize
function textTransformCapitalize(){
textTransformSituation = "capitalize";
document.getElementById("text").style.textTransform = "capitalize";
initFunction();
}
// text-transform -> uppercase
function textTransformUppercase(){
textTransformSituation = "uppercase";
document.getElementById("text").style.textTransform = "uppercase";
initFunction();
}
// text-transform -> lowercase
function textTransformLowercase(){
textTransformSituation = "lowercase";
document.getElementById("text").style.textTransform = "lowercase";
initFunction();
}
//text: border-style -> default
function textBorderStyleDefault(){
textBorderStyleSituation = "default";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "text";
initFunction();
}
// text: border-style -> none
function textBorderStyleNone(){
textBorderStyleSituation = "none";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "none";
initFunction();
}
// text: border-style -> hidden
function textBorderStyleHidden(){
textBorderStyleSituation = "hidden";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "hidden";
initFunction();
}
// text: border-style -> dotted
function textBorderStyleDotted(){
textBorderStyleSituation = "dotted";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "dotted";
initFunction();
}
// text: border-style -> dashed
function textBorderStyleDashed(){
textBorderStyleSituation = "dashed";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "dashed";
initFunction();
}
// text: border-style -> solid
function textBorderStyleSolid(){
textBorderStyleSituation = "solid";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "solid";
initFunction();
}
// text: border-style -> double
function textBorderStyleDouble(){
textBorderStyleSituation = "double";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "double";
initFunction();
}
// text: border-style -> groove
function textBorderStyleGroove(){
textBorderStyleSituation = "groove";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "groove";
initFunction();
}
// text: border-style -> ridge
function textBorderStyleRidge(){
textBorderStyleSituation = "ridge";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "ridge";
initFunction();
}
// text: border-style -> inset
function textBorderStyleInset(){
textBorderStyleSituation = "inset";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "inset";
initFunction();
}
// text: border-style -> outset
function textBorderStyleOutset(){
textBorderStyleSituation = "outset";
var textBorderS = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderS) + "px";
var textBorderC = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderC;
document.getElementById("text").style.borderStyle = "outset";
initFunction();
}
// text: width
function textWidth(){
textW = document.getElementById("textWidth").value;
document.getElementById("text").style.width = parseInt(textW) + "px";
document.getElementById("textW").innerHTML = textW + " px";
initFunction();
}
// text: height
function textHeight(){
textH = document.getElementById("textHeight").value;
document.getElementById("text").style.height = parseInt(textH) + "px";
document.getElementById("textH").innerHTML = textH + " px";
initFunction();
}
// border radius
function borderRadiusXY(){
borderRadiusX1 = document.getElementById("borderRadiusX1").value;
borderRadiusY1 = document.getElementById("borderRadiusY1").value;
borderRadiusX2 = document.getElementById("borderRadiusX2").value;
borderRadiusY2 = document.getElementById("borderRadiusY2").value;
document.getElementById("text").style.borderRadius = parseInt(borderRadiusX1) + "px" + " " + parseInt(borderRadiusY1) + "px" + " " + parseInt(borderRadiusX2) + "px" + " " + parseInt(borderRadiusY2) + "px";
initFunction();
}
// border size
function textBorder(){
textBorderSize = document.getElementById("textBorderSize").value;
document.getElementById("text").style.border = parseInt(textBorderSize) + "px";
initFunction();
}
// border color
function textBorderColor () {
textBorderCol = document.getElementById("textBorderCol").value;
document.getElementById("text").style.borderColor = textBorderCol;
initFunction();
}
// padding-top
function textPaddingTop(){
textPaddingT = document.getElementById("textPaddingT").value;
document.getElementById("text").style.paddingTop = parseInt(textPaddingT) + "px";
initFunction();
}
// padding-left
function textPaddingLeft(){
textPaddingL = document.getElementById("textPaddingL").value;
document.getElementById("text").style.paddingLeft = parseInt(textPaddingL) + "px";
initFunction();
}
// padding-right
function textPaddingRight(){
textPaddingR = document.getElementById("textPaddingR").value;
document.getElementById("text").style.paddingRight = parseInt(textPaddingR) + "px";
initFunction();
}
// padding-bottom
function textPaddingBottom(){
textPaddingB = document.getElementById("textPaddingB").value;
document.getElementById("text").style.paddingBottom = parseInt(textPaddingB) + "px";
initFunction();
}
// margin-top
function textMarginTop(){
textMarginT = document.getElementById("textMarginT").value;
document.getElementById("text").style.marginTop = parseInt(textMarginT) + "px";
initFunction();
}
// margin-left
function textMarginLeft(){
textMarginL = document.getElementById("textMarginL").value;
document.getElementById("text").style.marginLeft = parseInt(textMarginL) + "px";
initFunction();
}
// margin - right
function textMarginRight(){
textMarginR = document.getElementById("textMarginR").value;
document.getElementById("text").style.marginRight = parseInt(textMarginR) + "px";
initFunction();
}
// margin - bottom
function textMarginBottom(){
textMarginB = document.getElementById("textMarginB").value;
document.getElementById("text").style.marginBottom = parseInt(textMarginB) + "px";
initFunction();
}
// box-shadow
function textBoxShadow(){
textBoxShadowT = document.getElementById("textBoxShadowT").value;
textBoxShadowL = document.getElementById("textBoxShadowL").value;
textBoxShadowR = document.getElementById("textBoxShadowR").value;
textBoxShadowB = document.getElementById("textBoxShadowB").value;
// get color
textBoxShadowColor = document.getElementById("textBoxShadowColor").value;
document.getElementById("text").style.boxShadow = parseInt(textBoxShadowT) + "px" + " " + parseInt(textBoxShadowL) + "px" + " " + parseInt(textBoxShadowR) + "px" + " " + parseInt(textBoxShadowB) + "px" + " " + textBoxShadowColor;
initFunction();
}
</script>
<!-- ********************************************************js for button********************************************************************** -->
<script type="text/javascript">
var btnFontSizeUp;
var btnColor;
var btnBackgroundColor;
var btnWidth;
var btnHeight;
var btnAlignSituation = "center";
var btnBorderSize = 1;
var btnBorderCol;
var btnBorderStyleSituation = "ridge";
var btnCursorSituation = "auto";
var btnPaddingT;
var btnPaddingL;
var btnPaddingR;
var btnPaddingB;
var btnMarginT;
var btnMarginL;
var btnMarginR;
var btnMarginB;
var btnBorderRadiusX1;
var btnBorderRadiusY1;
var btnBorderRadiusX2;
var btnBorderRadiusY2;
var btnBoxShadowT;
var btnBoxShadowL;
var btnBoxShadowR;
var btnBoxShadowB;
var btnFontStyleSituation = "normal";
var btnFontWeightSituation = "normal";
// init code for btnCodeArea
function initBtnFunction(){
btnFontSizeUp = document.getElementById("btnFontSizeUp").value;
btnColor = document.getElementById("btnColor").value;
btnBackgroundColor = document.getElementById("btnBackgroundColor").value;
btnWidth = document.getElementById("btnWidth").value;
btnHeight = document.getElementById("btnHeight").value;
// btnAlignSituation
btnBorderSize = document.getElementById("btnBorderSize").value;
btnBorderCol = document.getElementById("btnBorderCol").value;
// btnBorderStyleSituation
// btnCursorSituation
btnPaddingT = document.getElementById("btnPaddingT").value;
btnPaddingL = document.getElementById("btnPaddingL").value;
btnPaddingR = document.getElementById("btnPaddingR").value;
btnPaddingB = document.getElementById("btnPaddingB").value;
btnMarginT = document.getElementById("btnMarginT").value;
btnMarginL = document.getElementById("btnMarginL").value;
btnMarginR = document.getElementById("btnMarginR").value;
btnMarginB = document.getElementById("btnMarginB").value;
btnBorderRadiusX1 = document.getElementById("btnBorderRadiusX1").value;
btnBorderRadiusY1 = document.getElementById("btnBorderRadiusY1").value;
btnBorderRadiusX2 = document.getElementById("btnBorderRadiusX2").value;
btnBorderRadiusY2 = document.getElementById("btnBorderRadiusY2").value;
btnBoxShadowT = document.getElementById("btnBoxShadowT").value;
btnBoxShadowL = document.getElementById("btnBoxShadowL").value;
btnBoxShadowR = document.getElementById("btnBoxShadowR").value;
btnBoxShadowB = document.getElementById("btnBoxShadowB").value;
btnBoxShadowColor = document.getElementById("btnBoxShadowColor").value;
// btnFontStyleSituation
// btnFontWeightSituation
var brc1 = "{\n";
var brc2 = "\n}";
var btnInitParams1 = "font-size: " + btnFontSizeUp + "px;\n" + "font-style: " + btnFontStyleSituation + ";\n" + "font-weight: " + btnFontWeightSituation + ";\n";
var btnInitParams2 = "color: " + btnColor + ";\n" + "background-color: " + btnBackgroundColor + ";\n" + "text-align: " + btnAlignSituation + ";\n";
var btnInitParams3 = "border: " + btnBorderSize + "px;\n" + "border-color: " + btnBorderCol + ";\n" + "border-style: " + btnBorderStyleSituation + ";\n";
var btnInitParams4 = "cursor: " + btnCursorSituation + ";\n" + "width: " + btnWidth + "px;\n" + "height: " + btnHeight + "px;\n";
var btnInitParams5 = "padding-top: " + btnPaddingT + "px;\n" + "padding-left: " + btnPaddingL + "px;\n" + "padding-right: " + btnPaddingR + "px;\n" + "padding-bottom:" + btnPaddingB + "px;\n";
var btnInitParams6 = "margin-top: " + btnMarginT + "px;\n" + "margin-left: " + btnMarginT + "px;\n" + "margin-right: " + btnMarginR + "px;\n" + "margin-bottom: " + btnMarginB + "px;\n";
var btnInitParams7 = "border-radius: " + btnBorderRadiusX1 + "px " + btnBorderRadiusY1 + "px " + btnBorderRadiusX2 + "px " + btnBorderRadiusY2 + "px;\n";
var btnInitParams8 = "box-shadow: " + btnBoxShadowT + "px " + btnBoxShadowL + "px " + btnBoxShadowR + "px " + btnBoxShadowB + "px " + btnBoxShadowColor + ";";
var btnInitParams = brc1 + btnInitParams1 + btnInitParams2 + btnInitParams3 + btnInitParams4 + btnInitParams5 + btnInitParams6 + btnInitParams7 + btnInitParams8 + brc2;
document.getElementById("btnCodeArea").value = btnInitParams;
}
// give a name to btn
function giveBtnName(){
var btnName = document.getElementById("btnName").value;
document.getElementById("btn").value = btnName;
}
// btn font size
function btnFontSize(){
btnFontSizeUp = document.getElementById("btnFontSizeUp").value;
document.getElementById("btn").style.fontSize = parseInt(btnFontSizeUp) + "px";
initBtnFunction();
}
// btn color
function colorBtn(){
btnColor = document.getElementById("btnColor").value;
document.getElementById("btn").style.color = btnColor;
initBtnFunction();
}
// btn background-color
function colorBtnBackGround(){
btnBackgroundColor = document.getElementById("btnBackgroundColor").value;
document.getElementById("btn").style.backgroundColor = btnBackgroundColor;
initBtnFunction();
}
// btn width
function giveBtnWidth(){
btnWidth = document.getElementById("btnWidth").value;
document.getElementById("btn").style.width = parseInt(btnWidth) + "px";
document.getElementById("btnW").innerHTML = btnWidth + "px";
initBtnFunction();
}
// btn height
function giveBtnHeight(){
btnHeight = document.getElementById("btnHeight").value;
document.getElementById("btn").style.height = parseInt(btnHeight) + "px";
document.getElementById("btnH").innerHTML = btnHeight + "px";
initBtnFunction();
}
// btn text-align:left
function btnAlignLeft(){
btnAlignSituation = "left";
document.getElementById("btn").style.textAlign = "left";
initBtnFunction();
}
// btn text-align:center
function btnAlignCenter(){
btnAlignSituation = "center";
document.getElementById("btn").style.textAlign = "center";
initBtnFunction();
}
// btn text-align:right
function btnAlignRight(){
btnAlignSituation = "right";
document.getElementById("btn").style.textAlign = "right";
initBtnFunction();
}
// btn border-size
function btnBorder(){
btnBorderSize = document.getElementById("btnBorderSize").value;
document.getElementById("btn").style.border = parseInt(btnBorderSize) + "px";
initBtnFunction();
}
// btn border-color
function btnBorderColor(){
btnBorderCol = document.getElementById("btnBorderCol").value;
document.getElementById("btn").style.borderColor = btnBorderCol;
initBtnFunction();
}
// btn border-style:none
function btnBorderStyleNone(){
btnBorderStyleSituation = "none";
document.getElementById("btn").style.borderStyle = "none";
initBtnFunction();
}
// btn border-style:hidden
function btnBorderStyleHidden(){
btnBorderStyleSituation = "hidden";
document.getElementById("btn").style.borderStyle = "hidden";
initBtnFunction();
}
// btn border-style:dotted
function btnBorderStyleDotted(){
btnBorderStyleSituation = "dotted";
document.getElementById("btn").style.borderStyle = "dotted";
initBtnFunction();
}
// btn border-style:dashed
function btnBorderStyleDashed(){
btnBorderStyleSituation = "dashed";
document.getElementById("btn").style.borderStyle = "dashed";
initBtnFunction();
}
// btn border-style:solid
function btnBorderStyleSolid(){
btnBorderStyleSituation = "solid";
document.getElementById("btn").style.borderStyle = "solid";
initBtnFunction();
}
// btn border-style:double
function btnBorderStyleDouble(){
btnBorderStyleSituation = "double";
document.getElementById("btn").style.borderStyle = "double";
initBtnFunction();
}
// btn border-style:groove
function btnBorderStyleGroove(){
btnBorderStyleSituation = "groove";
document.getElementById("btn").style.borderStyle = "groove";
initBtnFunction();
}
// btn border-style:ridge
function btnBorderStyleRidge(){
btnBorderStyleSituation = "ridge";
document.getElementById("btn").style.borderStyle = "ridge";
initBtnFunction();
}
// btn border-style:inset
function btnBorderStyleInset(){
btnBorderStyleSituation = "inset";
document.getElementById("btn").style.borderStyle = "inset";
initBtnFunction();
}
// btn border-style:outset
function btnBorderStyleOutset(){
btnBorderStyleSituation = "outset";
document.getElementById("btn").style.borderStyle = "outset";
initBtnFunction();
}
// btn cursor: auto
function btnCursorAuto(){
btnCursorSitutation = "auto";
document.getElementById("btn").style.cursor = "auto";
initBtnFunction();
}
// btn cursor: crosshair
function btnCursorCrosshair(){
btnCursorSitutation = "crosshair";
document.getElementById("btn").style.cursor = "crosshair";
initBtnFunction();
}
//btn cursor: default
function btnCursorDefault(){
btnCursorSituation = "default";
document.getElementById("btn").style.cursor = "default";
initBtnFunction();
}
// btn cursor: pointer
function btnCursorPointer(){
btnCursorSituation = "pointer";
document.getElementById("btn").style.cursor = "pointer";
initBtnFunction();
}
// btn cursor: move
function btnCursorMove(){
btnCursorSituation = "move";
document.getElementById("btn").style.cursor = "move";
initBtnFunction();
}
// btn cursor: e-resize
function btnCursorEResize(){
btnCursorSituation = "e-resize";
document.getElementById("btn").style.cursor = "e-resize";
initBtnFunction();
}
// btn cursor: ne-resize
function btnCursorNEResize(){
btnCursorSituation = "ne-resize";
document.getElementById("btn").style.cursor = "ne-resize";
initBtnFunction();
}
// btn cursor: nw-resize
function btnCursorNWResize(){
btnCursorSituation = "nw-resize";
document.getElementById("btn").style.cursor = "nw-resize";
initBtnFunction();
}
// btn cursor: n-resize
function btnCursorNResize(){
btnCursorSituation = "n-resize";
document.getElementById("btn").style.cursor = "n-resize";
initBtnFunction();
}
// btn cursor: se-resize
function btnCursorSEResize(){
btnCursorSituation = "se-resize";
document.getElementById("btn").style.cursor = "se-resize";
initBtnFunction();
}
// btn cursor: s-resize
function btnCursorSResize(){
btnCursorSituation = "s-resize";
document.getElementById("btn").style.cursor = "s-resize";
initBtnFunction();
}
// btn cursor: w-resize
function btnCursorWResize(){
btnCursorSituation = "w-resize";
document.getElementById("btn").style.cursor = "w-resize";
initBtnFunction();
}
// btn cursor: text
function btnCursorText(){
btnCursorSituation = "text";
document.getElementById("btn").style.cursor = "text";
initBtnFunction();
}
// btn cursor: wait
function btnCursorWait(){
btnCursorSituation = "wait";
document.getElementById("btn").style.cursor = "wait";
initBtnFunction();
}
// btn cursor: help
function btnCursorHelp(){
btnCursorSituation = "help";
document.getElementById("btn").style.cursor = "help";
initBtnFunction();
}
// btn padding: top
function btnPaddingTop(){
btnPaddingT = document.getElementById("btnPaddingT").value;
document.getElementById("btn").style.paddingTop = parseInt(btnPaddingT) + "px";
initBtnFunction();
}
// btn padding: left
function btnPaddingLeft(){
btnPaddingL = document.getElementById("btnPaddingL").value;
document.getElementById("btn").style.paddingLeft = parseInt(btnPaddingL) + "px";
initBtnFunction();
}
// btn padding: right
function btnPaddingRight(){
btnPaddingR = document.getElementById("btnPaddingR").value;
document.getElementById("btn").style.paddingRight = parseInt(btnPaddingR) + "px";
initBtnFunction();
}
// btn padding: bottom
function btnPaddingBottom(){
btnPaddingB = document.getElementById("btnPaddingB").value;
document.getElementById("btn").style.paddingBottom = parseInt(btnPaddingB) + "px";
initBtnFunction();
}
// btn margin: top
function btnMarginTop(){
btnMarginT = document.getElementById("btnMarginT").value;
document.getElementById("btn").style.marginTop = parseInt(btnMarginT) + "px";
initBtnFunction();
}
// btn margin: left
function btnMarginLeft(){
btnMarginL = document.getElementById("btnMarginL").value;
document.getElementById("btn").style.marginLeft = parseInt(btnMarginL) + "px";
initBtnFunction();
}
// btn margin: right
function btnMarginRight(){
btnMarginR = document.getElementById("btnMarginR").value;
document.getElementById("btn").style.marginRight = parseInt(btnMarginR) + "px";
initBtnFunction();
}
// btn margin: bottom
function btnMarginBottom(){
btnMarginB = document.getElementById("btnMarginB").value;
document.getElementById("btn").style.marginBottom = parseInt(btnMarginB) + "px";
initBtnFunction();
}
// btn border-radius
function btnBorderRadiusXY(){
btnBorderRadiusX1 = document.getElementById("btnBorderRadiusX1").value;
btnBorderRadiusY1 = document.getElementById("btnBorderRadiusY1").value;
btnBorderRadiusX2 = document.getElementById("btnBorderRadiusX2").value;
btnBorderRadiusY2 = document.getElementById("btnBorderRadiusY2").value;
document.getElementById("btn").style.borderRadius = parseInt(btnBorderRadiusX1) + "px" + " " + parseInt(btnBorderRadiusY1) + "px" + " " + parseInt(btnBorderRadiusX2) + "px" + " " + parseInt(btnBorderRadiusY2) + "px";
initBtnFunction();
}
// btn box-shadow
function btnBoxShadow(){
btnBoxShadowT = document.getElementById("btnBoxShadowT").value;
btnBoxShadowL = document.getElementById("btnBoxShadowL").value;
btnBoxShadowR = document.getElementById("btnBoxShadowR").value;
btnBoxShadowB = document.getElementById("btnBoxShadowB").value;
// get color:
btnBoxShadowColor = document.getElementById("btnBoxShadowColor").value;
// set box-shadow:
document.getElementById("btn").style.boxShadow = parseInt(btnBoxShadowT) + "px" + " " + parseInt(btnBoxShadowL) + "px" + " " + parseInt(btnBoxShadowR) + "px" + " " + parseInt(btnBoxShadowB) + "px" + " " + btnBoxShadowColor;
initBtnFunction();
}