generated from Ankit0050/temperature-converter-TASK1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bharatintern2.html
114 lines (95 loc) · 3.4 KB
/
bharatintern2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>temperatureConverter</title>
<!-- <link rel="icon" type="image/x-icon" href="html css.jpg"> -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Merriweather&family=Playfair+Display:wght@500&family=Roboto:wght@300&display=swap"
rel="stylesheet">
</head>
<style>
* {
margin: 0px;
padding: 0px;
font-family: 'Merriweather', serif;
font-family: 'Playfair Display', serif;
font-family: 'Roboto', sans-serif;
color: rgb(0, 0, 0);
}
.container {
background-color: rgb(42, 12, 48);
border: 50px solid rgb(8, 7, 33);
}
form {
text-align: center;
justify-content: center;
margin-top: 200px;
background-color: rgb(147, 141, 134);
width: 400px;
height: 400px;
position: relative;
bottom: 150px;
left: 510px;
}
h1 {
text-align: center;
margin-top: 30px;
text-decoration: underline;
}
.cel {
margin: 10px;
}
.center {
justify-content: center;
padding-top: 90px;
}
.fah {
margin-bottom: 30px;
}
.btn {
background-color: rgb(18, 45, 18);
margin: 20px;
padding: 10px;
font-size: 20px;
color: gray;
}
</style>
<body>
<div class="container">
<div class="box">
<h1><b style="color: rgb(177, 167, 167);">Temperature converter</b></h1>
<form action="">
<div class="center">
<div class="cel"><label for="celcius" style="font-size: 23px;font-weight: 100;">Enter
tempertaure:</label>
<input type="number" id="celcius" name="celcius" placeholder="in celcius"
oninput="temperatureConverter(this.value)" onchange="temperatureConverter(this.value)">
<p>Fahrenheit: <span id="outputFahrenheit"></span></p>
</div>
<div class="fah"><label for="fahrenheit" style="font-size: 23px;font-weight: 100;">Enter
tempertaure:</label>
<input type="number" id="fahrenheit" name="fahrenheit" placeholder="in fahrenheit"
oninput="temperatureConverter1(this.value)" onchange="temperatureConverter(this.value)">
<p>Celcius: <span id="outputCelcius"></span></p>
</div>
</div>
<input type="reset" id="btn" name="btn" class="btn" value="reset">
</form>
</div>
</div>
<script>
function temperatureConverter(valNum) {
valNum = parseFloat(valNum);
document.getElementById("outputFahrenheit").innerHTML = (valNum * 1.8) + 32;
}
function temperatureConverter1(valNum) {
valNum = parseFloat(valNum);
document.getElementById("outputCelcius").innerHTML = (valNum - 32) / 1.8;
}
</script>
</body>
</html>