From 45df12a7741b8788274c6234010c67e77ee65f8a Mon Sep 17 00:00:00 2001 From: NILESH ENUGANDHULA <87946769+nileshsn@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:08:58 +0530 Subject: [PATCH] Add files via upload --- index.html | 18 ++++++++++++++++ scprit.js | 22 ++++++++++++++++++++ style.css | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 index.html create mode 100644 scprit.js create mode 100644 style.css diff --git a/index.html b/index.html new file mode 100644 index 0000000..da3f26b --- /dev/null +++ b/index.html @@ -0,0 +1,18 @@ + + + + + Temp Converter + + + +
+

TEMPERATURE CONVERTER ๐ŸŒกโ„

+ + + + + +
+ + \ No newline at end of file diff --git a/scprit.js b/scprit.js new file mode 100644 index 0000000..e0e002a --- /dev/null +++ b/scprit.js @@ -0,0 +1,22 @@ +document.getElementById('convert').onclick=tempConvert; +document.getElementById('clear').onclick=clearForm; + +function tempConvert(){ + var fahrenheit=document.getElementById("fahrenheit").value; + var celsius=document.getElementById("celsius").value; + + if(fahrenheit !=''){ + celsius=(parseFloat(fahrenheit)-32)/1.8; + } + else{ + fahrenheit=(parseFloat(celsius)*1.8)+32; + } + + document.getElementById('fahrenheit').value=parseFloat(fahrenheit).toFixed(1); + document.getElementById('celsius').value=parseFloat(celsius).toFixed(1); +} + +function clearForm(){ + document.getElementById('fahrenheit').value=''; + document.getElementById('celsius').value=''; +} diff --git a/style.css b/style.css new file mode 100644 index 0000000..e47f3e1 --- /dev/null +++ b/style.css @@ -0,0 +1,60 @@ +body{ + background-color: #18122b ; + color: #635985; + font-family: 'DM Mono', monospace; +} +input{ + background-color: #cecece; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} +input:focus{ + background-color: #6402a1; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} +textarea{ + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} +textarea:focus{ + background-color: #6402a1; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} +button{ + background-color: #635985; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} +button:hover{ + background-color: #6402a1; + border-radius: 5px; + -webkit-border-radius: 5PX; + -moz-border-radius: 5PX; + -ms-border-radius: 5PX; + -o-border-radius: 5PX; +} +button:focus{ + background-color: #01b11b; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; +} \ No newline at end of file