Skip to content

Commit

Permalink
fixed semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
AirTechWick committed Jun 18, 2024
1 parent 734b753 commit 7b72d79
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions card-with-tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
.text-area {
display: block;
}


</style>
</head>
<body>
Expand Down Expand Up @@ -191,13 +189,13 @@
</div>

<script>
var htmlTab = document.querySelector('.tab-html')
var cssTab = document.querySelector('.tab-css')
var jsTab = document.querySelector('.tab-js')
var htmlTab = document.querySelector('.tab-html');
var cssTab = document.querySelector('.tab-css');
var jsTab = document.querySelector('.tab-js');

var htmlCode = document.querySelector('.code-html')
var cssCode = document.querySelector('.code-css')
var jsCode = document.querySelector('.code-js')
var htmlCode = document.querySelector('.code-html');
var cssCode = document.querySelector('.code-css');
var jsCode = document.querySelector('.code-js');


htmlTab.addEventListener("click", function(){
Expand All @@ -223,43 +221,40 @@

function showAndCopyCode(tab_type){
if (tab_type == "html"){
htmlCode.classList.add("code-shown")
htmlCode.classList.remove("code-hidden")
navigator.clipboard.writeText(htmlCode.textContent)
htmlCode.classList.add("code-shown");
htmlCode.classList.remove("code-hidden");
navigator.clipboard.writeText(htmlCode.textContent);
}

if (tab_type == "css"){
cssCode.classList.add("code-shown")
cssCode.classList.remove("code-hidden")
navigator.clipboard.writeText(cssCode.textContent)
cssCode.classList.add("code-shown");
cssCode.classList.remove("code-hidden");
navigator.clipboard.writeText(cssCode.textContent);
}

if (tab_type == "js"){
jsCode.classList.add("code-shown")
jsCode.classList.remove("code-hidden")
navigator.clipboard.writeText(jsCode.textContent)
jsCode.classList.add("code-shown");
jsCode.classList.remove("code-hidden");
navigator.clipboard.writeText(jsCode.textContent);
}
}

function hideCode(tab_type){
if (tab_type == "html"){
htmlCode.classList.add("code-hidden")
htmlCode.classList.remove("code-shown")
htmlCode.classList.add("code-hidden");
htmlCode.classList.remove("code-shown");
}

if (tab_type == "css"){
cssCode.classList.add("code-hidden")
cssCode.classList.remove("code-shown")
cssCode.classList.add("code-hidden");
cssCode.classList.remove("code-shown");
}

if (tab_type == "js"){
jsCode.classList.add("code-hidden")
jsCode.classList.remove("code-shown")
jsCode.classList.add("code-hidden");
jsCode.classList.remove("code-shown");
}
}



</script>
</body>
</html>

0 comments on commit 7b72d79

Please sign in to comment.