Skip to content

Commit cab5c38

Browse files
add components for result saving (icons, css, base elements);
improve decodeAsAsn1: do not decode if outData is empty;
1 parent 5dc48db commit cab5c38

File tree

7 files changed

+64
-5
lines changed

7 files changed

+64
-5
lines changed

img/add.png

350 Bytes
Loading

img/delete.png

429 Bytes
Loading

img/grab.png

1.02 KB
Loading

src/index.html

+20
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<title>Bytes formatter</title>
1414
<link rel="stylesheet" href="style.css">
1515
<link rel="stylesheet" href="examples.css">
16+
<link rel="stylesheet" href="results.css">
1617
<link rel="stylesheet" href="notifications.css">
1718
<link rel="preconnect" href="https://fonts.googleapis.com">
1819
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -112,11 +113,30 @@
112113
<div id="share" class="tool" onclick="share()">
113114
<img src="../img/share.png" alt="share" />
114115
</div>
116+
<div id="saveOutData" class="tool">
117+
<img src="../img/add.png" alt="add" />
118+
</div>
115119
<div id="asn1Tool" class="hide labeledTool" onclick="decodeAsAsn1()">
116120
<img src="../img/linking1.png" alt="asn1" />
117121
<span>asn1</span>
118122
</div>
119123
</div>
124+
<div class="results-container">
125+
<div class="result">
126+
<span>52538a80094f7b62948fd31e68fd17a315d8dc91</span>
127+
<div class="result-options">
128+
<div class="tool">
129+
<img src="../img/copy.png" alt="copy" />
130+
</div>
131+
<div class="tool">
132+
<img src="../img/grab.png" alt="grab" />
133+
</div>
134+
<div class="tool">
135+
<img src="../img/delete.png" alt="delete" />
136+
</div>
137+
</div>
138+
</div>
139+
</div>
120140
</article>
121141
<footer>
122142
<span>Bytes formatter Copyright © 2022 Pavlo Myroniuk; released as <a

src/results.css

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
.results-container {
3+
margin-top: 0.3em;
4+
display: flex;
5+
flex-direction: column;
6+
gap: 0.3em;
7+
}
8+
9+
.result {
10+
display: inline-flex;
11+
justify-content: space-between;
12+
align-items: center;
13+
width: calc(100% - 0.4em);
14+
height: 2em;
15+
border-radius: 0.3em;
16+
padding: 0.2em;
17+
}
18+
19+
.result:hover {
20+
background-color: #ded6cc;
21+
}
22+
23+
.result:hover .result-options {
24+
display: inline-flex;
25+
gap: 0.3em;
26+
align-items: center;
27+
}
28+
29+
.result-options {
30+
display: none;
31+
}

src/script.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,18 @@ const swap = () => {
221221
convert();
222222
}
223223

224-
const decodeAsAsn1 = () => window.open(
225-
`https://asn1.qkation.com/#${document.getElementById('outData').value}`,
226-
'_blank'
227-
).focus();
224+
const decodeAsAsn1 = () => {
225+
const value = document.getElementById('outData').value;
226+
227+
if (!value) {
228+
return;
229+
}
230+
231+
window.open(
232+
`https://asn1.qkation.com/#${value}`,
233+
'_blank'
234+
).focus();
235+
}
228236

229237
const toggleAsn1Button = () => {
230238
const outType = document.getElementById('outType').value;

src/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ article {
5858
}
5959

6060
.paramTool>img {
61-
height: 90%;
61+
height: 1.2em;
6262
}
6363

6464
button {

0 commit comments

Comments
 (0)