Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="styles.css" />
<script src="script.js" defer></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</head>

<body>
<body class="light-theme">
<div id="header">
<div id="logo">CodeRunner</div>

Expand All @@ -19,8 +23,15 @@
<div class="toggle-btn" id="css">CSS</div>
<div class="toggle-btn" id="js">JS</div>
<div class="toggle-btn" id="output">Output</div>
</div>
</div>
<div class="dark">
Dark Mode
</div>
<div class="custom-control custom-switch myChange">
<input type="checkbox" class="custom-control-input" id="customSwitch1">
<label class="custom-control-label" for="customSwitch1"></label>
</div>
</div>
<div id="bodyContainer">
<textarea class="panelH" id="htmlTA" placeholder="Enter HTML"></textarea>
<textarea class="panel" id="cssTA" placeholder="Enter CSS"></textarea>
Expand All @@ -29,8 +40,8 @@
id="jsTA"
placeholder="Enter Java Script"
></textarea>
<div>
<p style="margin: 0px; color: grey" id="output-txt" class="panel">
<div class="extra-cover">
<p style="margin: 0px; color: grey; width:100%;" id="output-txt" class="panel">
Output
</p>
<hr />
Expand Down
13 changes: 12 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
alert("Click on language pills to open different tabs.");

$(".toggle-btn").click(function () {
$(this).toggleClass("active");
if ($(this).attr("id") == "output") {
Expand All @@ -20,6 +20,17 @@ $("#runBtn").click(function () {
$("iframe").contents().find("html").html(addCode);
document.getElementById("outputDiv").contentWindow.eval($("#jsTA").val());
});
// Added later..//
//************************************************//
$("#customSwitch1").change(function(){
$(".panelH").toggleClass("dark-mode-panel");
$(".panel").toggleClass("dark-mode-panel");
$(".extra-cover").toggleClass("dark-mode-panel");
$(".panelH").toggleClass("text-colors");
$(".panel").toggleClass("text-colors");
$(".extra-cover").toggleClass("text-colors");
});
//************************************************//
if ($("#htmlTA").is(":visible")) {
$("#html").addClass("active");
}
42 changes: 37 additions & 5 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ body {
width: 100%;
display: flex;
flex-direction: row;
/* justify-content: center; */
/* justify-content: space-between;*/
background-color: #B6EAEE;
/* background-color:black; */
}
Expand Down Expand Up @@ -54,13 +54,30 @@ body {
.toggle-btn:hover {
background-color: #EBF3FF;
}

#html {
/*Added later on..*/
/******************************/
.dark
{
display: inline-block;
font-weight: bold;
font-size: 100%;
margin: auto 5px;
color: #227C7B;
-webkit-text-stroke: black 0.5px;
}
.myChange
{
display: inline-block;
vertical-align: baseline;
margin: auto ;
}
/******************************/
#html{
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}

#output {
#output{
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
Expand Down Expand Up @@ -98,4 +115,19 @@ iframe {

hr {
background-color: #227C7B;
}
}

/* Added later on..*/
/**************************************/
.dark-mode-panel
{
background-color: #282828;
}
.text-colors
{
color:white;
}
.place-color {
color:#FFFFFF;
}
/**************************************/