This commit is contained in:
Suvodip
2024-07-11 12:45:10 +05:30
parent d368213568
commit 040c4b87c1
33 changed files with 1042 additions and 867 deletions

View File

@@ -4,17 +4,19 @@
<section class="diZContainer diZmxAuto diZmy8">
<h1 class="diZBorderBottom">JSON Formatter</h1>
<div class="diZFlexRowCol">
<div class="diZw100 jsonCustomHeight diZFlexColumn diZJsonInputBorder">
<div class="diZw100 jsonCustomHeight diZFlexColumn diZJsonInputBorder diZBorderRadius5px diZmr2">
<textarea oninput="parseJSON()" id="jsonInput" class="diZJsonInput diZScrollBarNone" rows="40" placeholder="Enter JSON here"></textarea><br>
</div>
<div class="diZw100 jsonCustomHeight diZFlexColumn diZJsonInputBorder">
<div class="diZw100 jsonCustomHeight diZFlexColumn diZJsonInputBorder diZBorderRadius5px">
<div id="output" class="diZJsonViewer"></div>
</div>
</div>
<div class="diZFloatRight diZFlexRow diZJustifyCenter diZItemsCenter">
<p class=" diZJsonKey" id="countArray">Array Length: 0</p>
<button class="diZmt4 diZmb4 diZml2" onclick="copyToClipboard()"><span>Copy JSON</span></button>
<button class="diZmt4 diZmb4 diZml2" onclick="downloadJsonData()"><span>Download JSON</span></button>
</div>
<button class="diZFloatRight diZmt4 diZmb4 diZml2 diZJsonCopyButton" onclick="copyToClipboard()">Copy JSON</button>
<button class="diZFloatRight diZmt4 diZmb4 diZml2 diZJsonCopyButton" onclick="downloadJsonData()">Download JSON</button>
<p class="diZFloatRight diZJsonKey diZmt4" id="countArray">Array Length: 0</p>
</section>
<script>
function parseJSON() {
@@ -29,7 +31,6 @@
document.getElementById('countArray').innerHTML = 'Array Length: '+ totalObjects;
} catch (error) {
outputElement.textContent = 'Error parsing JSON: ' + error.message;
outputElement.style.color = '#fff';
}
}