Skip to content

Commit

Permalink
upload temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Anksuh Raj Mahe Yam committed May 16, 2024
0 parents commit 1c4791a
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-2024 Ankush Raj Mahe Yam (ARMY)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Temperature-Converter

This is simple but most reliable Tempreture Convter application to use for interchange temperature parameter in Degree Celsius, Kelvin & Fahrenheit in realtime. This website made using HTML, CSSk & JavaScript.

## Features
- Convert Real time Temperature Measurment Unit.
- clear button to reset your data.

## Usage:
1. Clone this repository.
2. Open `index.html` in your web browser.
3. Start managing your address book!

## License
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/AnkushRajMaheYam/Temperature-Converter/blob/main/LICENSE.md) file for details.

## Credits
This website was created by Ankush Raj Mahe Yam (ARMY). All rights reserved.

[Ankush Raj Mahe Yam (ARMY)](https://github.com/AnkushRajMaheYam)
Binary file added images.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<meta name="description" content="This is simple but most reliable Tempreture Convter application to use for interchange temperature parameter in Degree Celsius, Kelvin & Fahrenheit in realtime. This website made using HTML, CSSk & JavaScript., This app created by Ankush Raj Mahe Yam">
<meta name="keywords" content="Temperature-Conveter-applications, celsius to kelvin to fahrenheit Convter">
<div class="container">
<div class="title">
<h1>Temperature Converter</h1>
<span class="Temperature-icon"><i class="fa-solid fa-temperature-three-quarters"></i></span>
</div>

<div id="celsius">
<input type="number" name="" placeholder="Celsius">
<span class="icon">&#8451</span>
</div>
<div id="fahrenheit">
<input type="number" name="" placeholder="Fahrenheit">
<span class="icon">&#8457</span>
</div>
<div id="kelvin">
<input type="number" name="" placeholder="Kelvin">
<span class="icon">&#8490</span>
</div>

<div class="button">
<button>All Clear</button>
</div>

</div>
<script>
let celsiusInput = document.querySelector('#celsius > input')
let fahrenheitInput = document.querySelector('#fahrenheit > input')
let kelvinInput = document.querySelector('#kelvin > input')

let btn = document.querySelector('.button button')


function roundNumber(number){
return Math.round(number*100)/100
}


/* Celcius to Fahrenheit and Kelvin */
celsiusInput.addEventListener('input', function(){
let cTemp = parseFloat(celsiusInput.value)
let fTemp = (cTemp*(9/5)) + 32
let kTemp = cTemp + 273.15

fahrenheitInput.value = roundNumber(fTemp)
kelvinInput.value = roundNumber(kTemp)
})


/* Fahrenheit to Celcius and Kelvin */
fahrenheitInput.addEventListener('input', function(){
let fTemp = parseFloat(fahrenheitInput.value)
let cTemp = (fTemp - 32) * (5/9)
let kTemp = (fTemp -32) * (5/9) + 273.15

celsiusInput.value = roundNumber(cTemp)
kelvinInput.value = roundNumber(kTemp)
})

/* Kelvin to Celcius and Fahrenheit */
kelvinInput.addEventListener('input', function(){
let kTemp = parseFloat(kelvinInput.value)
let cTemp = kTemp - 273.15
let fTemp = (kTemp - 273.15) * (9/5) + 32

celsiusInput.value = roundNumber(cTemp)
fahrenheitInput.value = roundNumber(fTemp)
})


btn.addEventListener('click', ()=>{
celsiusInput.value = ""
fahrenheitInput.value = ""
kelvinInput.value = ""
})
</script>
107 changes: 107 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}

body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}

.container{
max-width: 450px;
background: #003333;
border-radius: 8px;
box-shadow: 0px 0px 15px 3px rgba(0,0,0,0.4);
font-family: sans-serif;
padding: 20px;
}

.title{
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap-reverse;
gap: 10px;
}

.Temperature-icon{
font-size: 45px;
color: #fff;
}

h1{
color: #fff;
letter-spacing: 1.2px;
font-size: 30px;
}

#celsius, #fahrenheit, #kelvin{
display: flex;
justify-content: center;
align-items: center;
margin-top: 25px;
}

input{
flex: 5;
height: 60px;
font-size: 20px;
font-weight: 600;
text-align: center;
border: none;
outline: none;
border-radius: 8px 0 0 8px;
padding: 0 10px;
}


/* for chrome, safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
-webkit-appearance: none;
}

/* for Mozila firefox */
input{
-moz-appearance: textfield;
}


.icon{
flex: 1;
height: 60px;
line-height: 60px;
padding: 0 5px;
text-align: center;
font-size: 30px;
background: #4d5964;
color: #fff;
border-radius: 0 8px 8px 0;
}


.button{
margin-top: 25px;
text-align: center;
}


.button button{
border: none;
outline: none;
padding: 10px 30px;
font-size: 20px;
font-weight: 600;
border-radius: 3px;
cursor: pointer;
transition: 0.3s;
}

.button button:hover{
background: #000;
color: #fff;
}

0 comments on commit 1c4791a

Please sign in to comment.