Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="style.css">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temp Scale Converter</title>
</head>

<body>
<main>
<header>
<h1><strong>Temperature Scale Converter</strong></h1>
</header>
<section class="value">
<p>Value</p>

</section>
<section class="fahrenheit">
<h1>Fahrenheit</h1>
<input type="number" name="value" id="value" class="input" placeholder="Fahrenheit Number">
<button onclick="myfunction()" style= background-color:lightblue>Calculate</button>

<!-- <button style= background-color:lightblue>Calculate</button> -->
</section>
<section class="celciusName">
<p><strong>Celcius</strong></p>


</section>
<section class="celcius">
<p id="celciusformula"></p>

</section>



</main>
<script src="main.js"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// function celsius
// {
// var cTemp = celsius;
// var cToFahr = cTemp * 9 / 5 + 32;
// var message = cTemp+'\xB0C is ' + cToFahr + ' \xB0F.';
// console.log(This is Celsius);
// }

// function fahrenheit
// {
// var fTemp = fahrenheit;
// var fToCel = (fTemp - 32) * 5 / 9;
// var message = fTemp+'\xB0F is ' + fToCel + '\xB0C.';
// console.log(This is Fahrenheit);
// }
// celcius(60);
// fahrenheit(45);

function myfunction() {
let celsius = (document.getElementById('value').value - 32) * 5/9;
document.getElementById('celciusformula').innerHTML = celsius;
}
49 changes: 49 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

main {
width: 100%;
height: 100vh;
}

header {
display: flex;
justify-content: center;
padding-top: 30px;
}



.fahrenheit{
text-align: center;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin: 10px;
}

.input {
margin: 0 100px;
border-radius: 5px;
padding: 5px;
border: solid;
}

body {
text-align: center;
border-style: solid;
margin: 50px;
}


.value {
text-align: center;
margin: 10px;
}

.celciusName {
text-align: center;
}

.celcius {
text-align: center;
}