diff --git a/domlab.css b/domlab.css new file mode 100644 index 0000000..175a3b6 --- /dev/null +++ b/domlab.css @@ -0,0 +1,28 @@ +h1 { + font-size: 30px; + +} + +.first { + display:block; + position:relative; +} + +#userInput, label { + display:block; + position: relative; + top: 10%; + left: 35%; + width: 25%; + text-align: center; + + +} + +#calculate { + display: block; + position: absolute; + top: 16%; + left: 75%; + text-align: center; +} \ No newline at end of file diff --git a/domlab.html b/domlab.html new file mode 100644 index 0000000..79b1409 --- /dev/null +++ b/domlab.html @@ -0,0 +1,44 @@ + + + + + + Temperature Scale Convertor + + + + +
+

Temperature Scale Convertor

+ + + +
+
+

Fahrenheit + + + + + + +

+

Celsius
+ + +

+

kelvin
+ +

+ +

Rankine
+ +

+
+ + +
+ + + + diff --git a/domlab.js b/domlab.js new file mode 100644 index 0000000..974b43c --- /dev/null +++ b/domlab.js @@ -0,0 +1,20 @@ + +// celsius convertor +function calc(){ + let userInput = parseInt(document.getElementById('userInput').value) + + // celsius + let cValue = (userInput - 32) * (5/9) + document.getElementById('cValue').innerHTML = cValue + + // kelvin + let kelvin = (userInput - 32) * (5/9) + 273.15 + document.getElementById('kelvin').innerHTML = kelvin + + // rankine + let rankine = userInput + 459.67 + document.getElementById('rankine').innerHTML = rankine + + + +}