From cd68b2dad8106053cf5176d1457b714f7582ed89 Mon Sep 17 00:00:00 2001 From: brogers-97 Date: Fri, 10 Mar 2023 09:32:29 -0700 Subject: [PATCH] Fahrenheit converter Deliverable --- css/style.css | 22 +++++++++++++++++++++- index.html | 14 +++++++++++--- js/script.js | 19 +++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index ccf22a0..7c70739 100644 --- a/css/style.css +++ b/css/style.css @@ -1,3 +1,23 @@ h1 { - color: blue; + color: black } +.flexbody { + align-items: center; + justify-content: center; +} +body { + text-align: center; +} +button { + border: 1px solid rgb(50, 50, 50); + color: white; + background-color: black; + margin: 25px; +} +input[type=text] { +background-color: black; +color: white; +} +h2 { + color: red; +} \ No newline at end of file diff --git a/index.html b/index.html index 96b6656..76cca1e 100644 --- a/index.html +++ b/index.html @@ -1,14 +1,22 @@ + Hello Front-End -

Hello Front-End

- - +
+

Temp Converter

+
+ + +
+ + +

Celsius is

+
diff --git a/js/script.js b/js/script.js index a811909..c3522e3 100644 --- a/js/script.js +++ b/js/script.js @@ -1 +1,20 @@ console.log('Hello, front end'); + + +const returnButton = document.querySelector("#returnTemp") +const clearButton = document.querySelector("#getClear") +const userInput = document.querySelector("#userInput") +const answer = document.querySelector("#answer") + + +returnButton.addEventListener("click", function() { + const inputValue = userInput.value; + const tempAnswer = (Math.floor((inputValue - 32)* 5/9)) + console.log(inputValue) + answer.innerHTML = "Celcius is " + tempAnswer +}) + +clearButton.addEventListener("click", function() { + userInput.value = "" + answer.innerHTML = "Celsius is " +}) \ No newline at end of file