-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b6b9aa
commit 63dbe7c
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"> © created by Himanshi Rana </span></center> | ||
<script src="script.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |