diff --git a/TempWizard/indexsamp.html b/TempWizard/indexsamp.html new file mode 100644 index 00000000..07d43132 --- /dev/null +++ b/TempWizard/indexsamp.html @@ -0,0 +1,42 @@ + + + + + +

TEMPERATURE CONVERTER

+
+
+
+

+
+
+
+ +image +
+
+
+
+

+
+
+
+image +
+
+
+
+

+
+
+
+image +
+
+
+ + + \ No newline at end of file diff --git a/TempWizard/script.js b/TempWizard/script.js new file mode 100644 index 00000000..8c4314c1 --- /dev/null +++ b/TempWizard/script.js @@ -0,0 +1,30 @@ +let celsius = + document.getElementById('celsius'); + let fahrenheit = + document.getElementById('fahrenheit'); + let kelvin = + document.getElementById('kelvin'); + celsius.oninput = function () { + let f = (parseFloat(celsius.value) * 9) / 5 + 32; + fahrenheit.value = parseFloat(f.toFixed(2)); + + let k = (parseFloat(celsius.value) + 273.15); + kelvin.value = parseFloat(k.toFixed(2)); + } + fahrenheit.oninput = function () { + let c = ((parseFloat( + fahrenheit.value) - 32) * 5) / 9; + celsius.value = parseFloat(c.toFixed(2)); + + let k = (parseFloat( + fahrenheit.value) - 32) * 5 / 9 + 273.15; + kelvin.value = parseFloat(k.toFixed(2)); + } + kelvin.oninput = function () { + let f = (parseFloat( + kelvin.value) - 273.15) * 9 / 5 + 32; + fahrenheit.value = parseFloat(f.toFixed(2)); + + let c = (parseFloat(kelvin.value) - 273.15); + celsius.value = parseFloat(c.toFixed(2)); + } \ No newline at end of file diff --git a/TempWizard/style.css b/TempWizard/style.css new file mode 100644 index 00000000..6c9a2cb2 --- /dev/null +++ b/TempWizard/style.css @@ -0,0 +1,29 @@ +body { + font-family: Arial, sans-serif; + text-align: center; + margin: 0; + padding: 0; + background-color: #f0f0f0; +} + +h1{ + padding:5%; + padding-bottom:3%; + font-size:50px; + color:green; +} + +div{ + padding-left:1% +} + +label{ + margin: 10px 0; +} +input +{ + border:none; + height:50px; + width:200px; + font-size:40px; +}