Skip to content

Commit 0a6f7fb

Browse files
committed
Added tabs ui
1 parent fb12f5c commit 0a6f7fb

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

css/style.css

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ canvas{
240240
width: 30px;
241241
height: 30px;
242242
position: absolute;
243-
top: 10px;
243+
top: 50px;
244244
right: 20px;
245245
z-index: 99;
246246
}
@@ -580,6 +580,34 @@ select:not([multiple]) {
580580
supported by Chrome and Opera */
581581
}
582582

583+
.tabs {
584+
text-align: left;
585+
}
586+
587+
.tabs .tab {
588+
width: 80px;
589+
padding: 11px 0;
590+
border: 1px solid #a6a6a6;
591+
display: inline-block;
592+
cursor: pointer;
593+
border-bottom: 0px ;
594+
text-align: center;
595+
}
596+
597+
.tabs .tab:first-child {
598+
border-top-left-radius: 5px;
599+
border-right: 1px;
600+
}
601+
602+
.tabs .tab:not(:first-child) {
603+
margin-left: -4px;
604+
border-top-right-radius: 5px;
605+
}
606+
607+
.tabs .tab.active {
608+
background-color: #ffffff;
609+
}
610+
583611
@media only screen and (max-width: 1048px) and (min-width: 992px) {
584612
.warning {
585613
justify-content: start;

index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@
142142
</div>
143143

144144
<div id="generated-tree" class="generated-tree">
145+
<div class="tabs">
146+
<a onclick="switchTab(this)" class="tab active">Image</a>
147+
<a onclick="switchTab(this)" class="tab">Json</a>
148+
</div>
145149
<a class="back cp" title="Try again">
146150
<div class="back-bg"></div>
147151
<img src="./img/reload.png" class="back-image" alt="Go back" onclick="retry()">

js/script.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ function readFile(file) {
184184
};
185185
}
186186

187+
function switchTab(elem) {
188+
document
189+
.querySelectorAll('.tabs .tab.active')
190+
.forEach(tab => tab.classList.remove('active'));
191+
elem.classList.add('active');
192+
}
193+
187194
Dropzone.options.myAwesomeDropzone = {
188195
paramName: "file",
189196
maxFiles: 1,

0 commit comments

Comments
 (0)