Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GST Calculator #304

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 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
69 changes: 69 additions & 0 deletions Calculators/GST_Calculator/design.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
body {
margin-top: 5%;
margin-bottom: 10%;
margin-left: 20%;
margin-right: 25%;
font-size: x-large;
background-image: linear-gradient(#00ffde,#097945,#002415);

background-size: cover;
display: flex;
color:white;
justify-content: center;
align-items: center;
font-weight: 900;
}

table {
font-size: 150%;
color:white;
width: 100%;
font-weight: 600;


}
.hit-the-floor {
color: #fff;
font-size: 75px;
font-weight: bold;
font-family: Helvetica;
text-shadow:
0 1px 0 #ccc,
0 2px 0 #c9c9c9,
0 3px 0 #bbb,
0 4px 0 #b9b9b9,
0 5px 0 #aaa,
0 6px 1px rgba(0,0,0,.1),
0 0 5px rgba(0,0,0,.1),
0 1px 3px rgba(0,0,0,.3),
0 3px 5px rgba(0,0,0,.2),
0 5px 10px rgba(0,0,0,.25),
0 10px 10px rgba(0,0,0,.2),
0 20px 20px rgba(0,0,0,.15);
}

.hit-the-floor {
text-align: center;
}



tr {
height: 70px;
color:white;
}

input[type=number] {
width: 50%;
font-size: 75%;
padding: 12px;
}

#main {
width: 1000px;
padding: 10px;
border: 5px solid gray;

color:white;
margin: 0;
}
81 changes: 81 additions & 0 deletions Calculators/GST_Calculator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<html lang="en" dir="ltr">

<head>
<link rel="stylesheet" href="design.css">
<link rel="stylesheet" href="css/bootstrap.min.css">

<meta charset="utf-8">
<title>GST Calculator</title>
</head>

<body>
<div id="main">
<div class="container">
<div class="row">
<div class="col-sm-12">




<h1>
<center><div class="hit-the-floor">GST Calculator</div></center>
</h1><br /><br />
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-9">
<form>
<table>
<tr>
<td><label>
Gross Price
</label></td>
<td>(in Rs)</td>
<td>
<div><input type="number" id="gross" size="125%" /></div>
</td>
</tr>
<tr>
<td><label>
GST Rate
</label></td>
<td>(in %)</td>
<td><span><input type="number" id="gstrate" size="125%" /></span></td>
</tr>
<tr>
<td><label>
Net Price
</label></td>
<td>(in Rs)</td>
<td><span id="netprice"></span< /td>
</tr>
<tr>
<td><label>
SGST
</label></td>
<td>(in Rs)</td>
<td><span id="sgst"></span></td>
</tr>
<tr>
<td><label>
CGST
</label></td>
<td>(in Rs)</td>
<td><span id="cgst"></span></td>
</tr>
</table>
<center><button type="button" id="button">Submit</button></center>
</form>
</div>
</div>
</div>
</div>
<script src="script.js" charset="utf-8"></script>



</body>

</html>
11 changes: 11 additions & 0 deletions Calculators/GST_Calculator/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<p>
<center><h1>GST Calculator</h1></center>
<h5><I> A simple website that takes Gross Price & GST Rate as the input and returns Net Price & SGST/CGST as output.<br>
Shows output only for valid GST Tax slabs.</I><br><br>
<b>Made using HTML , CSS & JS.</b></h5><br>
Website can be seen at https://babyelias.github.io/GST_Calculator/<br>

</p>


30 changes: 30 additions & 0 deletions Calculators/GST_Calculator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
document.getElementById("button").addEventListener("click", handleclick);

function handleclick() {
var gross_price = parseFloat(document.getElementById("gross").value);
var gst_rate = parseFloat(document.getElementById("gstrate").value);



var x1 = (100 * gross_price) / (100 + gst_rate);
var x2 = (x1 * gst_rate) / 200;
if (gst_rate === 5 || gst_rate === 12 || gst_rate === 18 || gst_rate === 28) {
document.getElementById("netprice").innerHTML = x1.toPrecision(4);

document.getElementById("sgst").innerHTML = x2.toPrecision(4);

document.getElementById("cgst").innerHTML = x2.toPrecision(4);

} else {
alert("Invalid GST Rate");
document.getElementById("netprice").innerHTML = " ";

document.getElementById("sgst").innerHTML = " ";

document.getElementById("cgst").innerHTML = " ";
}




}