Commit dc9f10a 1 parent 0aaa2b3 commit dc9f10a Copy full SHA for dc9f10a
File tree 4 files changed +41
-0
lines changed
4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 34
34
< option value ="base64 "> Base64</ option >
35
35
< option value ="ascii "> Aescii</ option >
36
36
</ select >
37
+ < div class ="paramTool " onclick ="swap() ">
38
+ < img src ="../img/replace1.png " alt ="copy " />
39
+ </ div >
37
40
</ div >
38
41
< textarea id ="inData " placeholder ="Input data... " rows ="7 "> </ textarea >
39
42
< button onclick ="decode() "> convert</ button >
Original file line number Diff line number Diff line change @@ -92,3 +92,21 @@ const decode = () => {
92
92
} ;
93
93
94
94
const copyOutputData = ( ) => navigator . clipboard . writeText ( document . getElementById ( 'outData' ) . value ) ;
95
+
96
+ const swap = ( ) => {
97
+ const inType = document . getElementById ( 'inType' ) ;
98
+ const outType = document . getElementById ( 'outType' ) ;
99
+
100
+ let buf = inType . selectedOptions [ 0 ] . value ;
101
+
102
+ inType . value = outType . selectedOptions [ 0 ] . value ;
103
+ outType . value = buf ;
104
+
105
+ const inData = document . getElementById ( 'inData' ) ;
106
+ const outData = document . getElementById ( 'outData' ) ;
107
+
108
+ buf = inData . value ;
109
+
110
+ inData . value = outData . value ;
111
+ outData . value = buf ;
112
+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,26 @@ article {
34
34
display : inline-flex;
35
35
margin-top : 1em ;
36
36
gap : 0.5em ;
37
+ align-items : center;
38
+ }
39
+
40
+ .paramTool {
41
+ display : inline-flex;
42
+ cursor : pointer;
43
+ height : 1.5em ;
44
+ width : fit-content;
45
+ padding : 0.2em ;
46
+ border-radius : 0.3em ;
47
+ justify-content : center;
48
+ align-items : center;
49
+ }
50
+
51
+ .paramTool : hover {
52
+ background-color : aliceblue;
53
+ }
54
+
55
+ .paramTool > img {
56
+ height : 90% ;
37
57
}
38
58
39
59
button {
You can’t perform that action at this time.
0 commit comments