Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshirana2403 authored Aug 28, 2023
1 parent 2b6b9aa commit 63dbe7c
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 0 deletions.
Binary file added ba.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added back.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>temperature convertor</title>
<link rel="stylesheet" href="style.css">

</head>

<body>

<h class="tt">TEMPERATURE CONVERTOR</h>
<div id="container">
<div class="box1">
<label class="tit" for="cel">Celcius</label>
<br>
<input type="number" value="0" id="cel" class="inp">
</div>
<br>
<div class="box1">
<label class="tit" for="fah">Fahrenheit</label>
<br>
<input type="number" value="32" id="fah" class="inp">
</div>
<br>
<div class="box1">
<label class="tit" for="kel">Kelvin</label>
<br>
<input type="number" value="273.15" id="kel" class="inp">
</div>
</div>
<br>
<br>
<center><span style="color:white"> &copy; created by Himanshi Rana </span></center>
<script src="script.js"></script>
</body>

</html>
38 changes: 38 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

var cel = document.getElementById('cel');
var fah = document.getElementById('fah');
var kel = document.getElementById('kel');

cel.addEventListener('input',function(){
console.log("Celsius value changed");
let c=this.value;
let f=((c*9/5)+32).toFixed(2);
let k=((c-0)+273.15).toFixed(2);
fah.value=f;
kel.value=k;
});
fah.addEventListener('input', function(){
console.log("Celsius value changed");
let f=this.value;
let c=((f - 32) * 5/9).toFixed(2);
let k = ((f- 32) * 5/9 + 273.15).toFixed(2);
cel.value=c;
kel.value=k;

});
kel.addEventListener('input', function(){
console.log("Celsius value changed");
let k=this.value;
let c=(k - 273.15).toFixed(2);
let f= ((k - 273.15) * 9/5 + 32).toFixed(2);
cel.value=c;
fah.value=f;
});








44 changes: 44 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
body{

background-image: url("back.jpg");
}
.tt
{
display: flex;
justify-content: center;
align-items: center;
color:blue ;
font-size: 20px;
margin-left: 35%;
margin-top: 4%;
display: inline-block;
background-image:url("ba.jpg") ;
margin-bottom: 40px;
padding: 27px 8%;

}

#container
{

justify-content: center;
align-items: center;
margin-left: 35%;


}
.tit
{
display: inline-block;
background-color:gray;
color:#FFFACD ;
padding: 15px;
margin-bottom: 10px;
}
.inp
{
font-size: 20px;
color: brown;
opacity: 80%;
padding: 25px;
}

0 comments on commit 63dbe7c

Please sign in to comment.