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
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5502
}
38 changes: 38 additions & 0 deletions TSconverter.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.container {
border: black solid 2px;
display: flex;
flex-direction: column;
width: 450px;
padding: 15px;
margin-top: 120px;
margin-left:auto;
margin-right: auto;
margin-bottom: auto;
}

.align{
display: flex;
align-items: center;
justify-content: center;
}

.fhr{
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
}

.tmp{
font-weight: bold;
}

#btn {
border: solid blue 1px;
background-color: lightblue;
}

#userInput {
width: 70px;
text-align: center;
}

6 changes: 6 additions & 0 deletions TSconverter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function temperatureConverter(valNum) {
valNum = parseFloat(valNum);
document.getElementById("outputCelsius").innerHTML=(valNum-32)/1.8;
}


35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temp converter</title>
<link rel="stylesheet" href="TSconverter.css">
</head>

<body>
<div class="container">
<h1 class="tmp">Temperature Scale Converter</h1>

<div class="align">
<label id="labelValue">Value</label>
</div>

<div class="fhr">
<label>Fahrenheit</label>
<input id="userInput" type="number" onchange="temperatureConverter(this.value)">
<button id="btn">Calculate</button>
</div>

<br><br>

<label class="align"><strong>Celsius</strong></label><br>
<label id="outputCelsius" class="align"></label>

</div>

<script src="TSconverter.js"></script>

</body>
</html>