From f97d2de6d9f8d5bd5652c302a2680d09c1153a1b Mon Sep 17 00:00:00 2001 From: Denae716 Date: Wed, 9 Dec 2020 23:32:46 -0500 Subject: [PATCH 1/4] domlab --- domlab.html | 20 ++++++++++++++++++++ domlab.js | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 domlab.html create mode 100644 domlab.js diff --git a/domlab.html b/domlab.html new file mode 100644 index 0000000..a740ac2 --- /dev/null +++ b/domlab.html @@ -0,0 +1,20 @@ + + + + + + Temperature Scale Convertor + + +

Temp Convertor

+

fahrenheit

+ + + +

Celsius

+ + + + + + diff --git a/domlab.js b/domlab.js new file mode 100644 index 0000000..d113f1f --- /dev/null +++ b/domlab.js @@ -0,0 +1,10 @@ + +let input = document.querySelector('input') +let cValue = (input - 32) * 5/9 + +const span = document.querySelector("span") +const button = document.querySelector('calulateButton') + +button.addEventListener('click', () => { + cValue = span.value +}) From 0aa9437b50126c45c650e28b74d849fd30068713 Mon Sep 17 00:00:00 2001 From: Denae716 Date: Sun, 20 Dec 2020 21:06:47 -0500 Subject: [PATCH 2/4] still trying to work it --- domlab.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/domlab.js b/domlab.js index d113f1f..07e3979 100644 --- a/domlab.js +++ b/domlab.js @@ -1,10 +1,13 @@ +// f to c cnvertor function -let input = document.querySelector('input') -let cValue = (input - 32) * 5/9 +function calc(userInput){ + userInput = document.getElementsByClassName('userInput').value + let c = document.getElementsByClassName('c').value + c += userInput - 32 * (5/9) + console.log(c) +} +// getting calc butten to work -const span = document.querySelector("span") -const button = document.querySelector('calulateButton') +let button = document.getElementsByClassName('calculateButton') -button.addEventListener('click', () => { - cValue = span.value -}) +button[0].addEventListener('click', calc); From 9b9a9c0ee9b4248d74dd48d9a5feb4056f5a2f75 Mon Sep 17 00:00:00 2001 From: Denae716 Date: Sun, 10 Jan 2021 17:12:34 -0500 Subject: [PATCH 3/4] Celsius convertor --- domlab.html | 21 ++++++++++++++------- domlab.js | 19 +++++++++---------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/domlab.html b/domlab.html index a740ac2..12e7ed8 100644 --- a/domlab.html +++ b/domlab.html @@ -7,14 +7,21 @@

Temp Convertor

-

fahrenheit

- - - -

Celsius

+

Fahrenheit

+ +
+ + Value + +

Celsius


+

+ +

+ +
- - + + diff --git a/domlab.js b/domlab.js index 07e3979..678c76c 100644 --- a/domlab.js +++ b/domlab.js @@ -1,13 +1,12 @@ -// f to c cnvertor function -function calc(userInput){ - userInput = document.getElementsByClassName('userInput').value - let c = document.getElementsByClassName('c').value - c += userInput - 32 * (5/9) - console.log(c) -} -// getting calc butten to work -let button = document.getElementsByClassName('calculateButton') +function calc(){ + let userInput = parseInt(document.getElementById('userInput').value) + + let cValue = (userInput - 32) * (5/9) -button[0].addEventListener('click', calc); + document.getElementById('cValue').innerHTML = cValue + + + +} From 954a817e8d6f94c9c285f2ae58afaa8a3f8a49a2 Mon Sep 17 00:00:00 2001 From: Denae716 Date: Fri, 15 Jan 2021 16:13:50 -0500 Subject: [PATCH 4/4] part2, styling needs adjusting --- domlab.css | 28 ++++++++++++++++++++++++++++ domlab.html | 45 +++++++++++++++++++++++++++++++-------------- domlab.js | 14 +++++++++++--- 3 files changed, 70 insertions(+), 17 deletions(-) create mode 100644 domlab.css 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 index 12e7ed8..79b1409 100644 --- a/domlab.html +++ b/domlab.html @@ -4,24 +4,41 @@ Temperature Scale Convertor + + -

Temp Convertor

-

Fahrenheit

- -
- - Value - -

Celsius


-

- -

+
+

Temperature Scale Convertor

+ - + +
+
+

Fahrenheit + + + + + + +

+

Celsius
+ + +

+

kelvin
+ +

- +

Rankine
+ +

+
+ + +
- + diff --git a/domlab.js b/domlab.js index 678c76c..974b43c 100644 --- a/domlab.js +++ b/domlab.js @@ -1,12 +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 + - + }