Skip to content

Commit

Permalink
Merge branch 'main' into bharti
Browse files Browse the repository at this point in the history
  • Loading branch information
BhartiNagpure authored Aug 3, 2023
2 parents b674125 + eb6b12f commit 5f0edea
Show file tree
Hide file tree
Showing 19 changed files with 1,299 additions and 1 deletion.
18 changes: 17 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,23 @@ <h3 class="card__heading">Hotstar_Clone</h3>
<h3 class="card__heading">Cryptocurrency App</h3>
</div>
</a>
</div>
</div>
<a class="card" href="projects/Wordle/index.html">
<div class="card__background" style="background-image: url(projects/Wordle/wordle.png)"></div>
<div class="card__content">
<p class="card__category">Game</p>
<h3 class="card__heading">Wordle</h3>
</div>
</a>

<a class="card" href="projects/Temperature Converter/index.html">
<div class="card__background" style="background-image: url(projects/Temperature Converter/Temperature Converter.png)"></div>
<div class="card__content">
<p class="card__category">Convert Temarature Application</p>
<h3 class="card__heading">Temperature Converter</h3>
</div>
</a>
</div
</section>

<div class="section">
Expand Down
15 changes: 15 additions & 0 deletions projects/Temperature Converter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<h1 align="center">Temperature Converter </h1>

<div>
<br>
<h2>Hello Sir/Ma'am👋, Here is my Project of Temperature Converter </h2>
<h3>Issue No. #497</h3>


<p>Hello Coders👨‍💻 ,I am Arpan Chowdhury, a aspiring Web developer.🤖 Here is the project of the front-end Web Developement.This repo contains my project on temperature converter🥵 using HTML,CSS & JS. It contains conversion of different temperature parameters which are Celsius, Fahrenheit , Kelvin , Rankine.
I want to add my Project under GSSOC 2.0 . Please take a review of my PR & please merge it. 🙏</p>

# Video

https://github.com/apu52/Code-Canvas/assets/114172928/15ac337e-d4e2-4b9d-8d0d-5f4a7034ebb3

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
64 changes: 64 additions & 0 deletions projects/Temperature Converter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temperature Converter</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
</head>

<body>
<div class="background-image"></div>
<div class="container">
<div class="task-bar">
<div id="p1"></div>
<div class="icons">
<i class="bi bi-bell-slash-fill"></i>
<i class="bi bi-bluetooth"></i>
<i class="bi bi-battery-charging"></i>
</div>
</div>
<h1>Celcius-Fahrenheit-Kelvin-Rankine Converter</h1>
<div class="inputs">
<div style="display: flex;
flex-direction: column;">
<label for="degree">Value <span id="small">(In Numbers...)</span></label>
<input type="number" name="degree" id="inputValue" required>
</div>
<div class="inptsss">
<div>
<label for="type">From</label>
<select name="type" id="type1">
<option value="celcius">Celcius</option>
<option value="fahrenheit">Fahrenheit</option>
<option value="kelvin">Kelvin</option>
<option value="rankine">Rankine</option>
</select>
</div>
<div>
<label for="type">To</label>
<select name="type" id="type2">
<option value="celcius">Celcius</option>
<option value="fahrenheit">Fahrenheit</option>
<option value="kelvin">Kelvin</option>
<option value="rankine">Rankine</option>
</select>
</div>
</div>
</div>
<button type="submit" id="btn" onclick="temperature()">Convert</button>
<div class="resultss">
<label for="result">Result</label>
<div id="result"></div>
</div>
</div>

<div class="footer">
<p>Designed by <a href="https://www.linkedin.com/in/arpan-chowdhury-775294251/">Arpan Chowdhury</a></p>
</div>
<script src="main.js"></script>
</body>
</html>
90 changes: 90 additions & 0 deletions projects/Temperature Converter/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Logic for the digital watch
function currentTime() {
let p1 = document.getElementById("p1")
let date = new Date();
let hr = date.getHours();
let mn = date.getMinutes();
let ss = date.getSeconds();
let current_time = hr + ":" + mn + ":" + ss;
p1.innerHTML = current_time;
let t = setTimeout(function () { currentTime() }, 1000);
}
currentTime();



// Logic for temperature converter
function temperature() {
let inputValue = document.querySelector("#inputValue").value;
let type1 = document.querySelector("#type1");
let type2 = document.querySelector("#type2");
let result = document.querySelector("#result");
if (inputValue == "") {
alert("Please Enter any Number....")
location.reload()
}
else if (type1.value == "celcius" && type2.value == "celcius") {
let Celcius = Number.parseInt(inputValue) * 1
result.innerHTML = Celcius.toFixed(3) + ` &deg;C`
}
else if (type1.value == "celcius" && type2.value == "fahrenheit") {
let Fahrenheit = Number.parseInt(inputValue) * (9 / 5) + 32
result.innerHTML = Fahrenheit.toFixed(3) + " F"
}
else if (type1.value == "celcius" && type2.value == "kelvin") {
let Kelvin = Number.parseInt(inputValue) + 273.15
result.innerHTML = Kelvin.toFixed(3) + " K"
}
else if (type1.value == "celcius" && type2.value == "rankine") {
let Rankine = Number.parseInt(inputValue) * (9 / 5) + 491.67
result.innerHTML = Rankine.toFixed(3) + " R"
}
else if (type1.value == "fahrenheit" && type2.value == "celcius") {
let Celcius = Number.parseInt(inputValue) - 32 * (5 / 9)
result.innerHTML = Celcius.toFixed(3) + ` &deg;C`
}
else if (type1.value == "fahrenheit" && type2.value == "fahrenheit") {
let Fahrenheit = Number.parseInt(inputValue) * 1
result.innerHTML = Fahrenheit.toFixed(3) + " F"
}
else if (type1.value == "fahrenheit" && type2.value == "kelvin") {
let Kelvin = Number.parseInt(inputValue) - 32 * (5 / 9) + 273.15
result.innerHTML = Kelvin.toFixed(3) + " K"
}
else if (type1.value == "fahrenheit" && type2.value == "rankine") {
let Rankine = Number.parseInt(inputValue) + 459.67
result.innerHTML = Rankine.toFixed(3) + " R"
}
else if (type1.value == "kelvin" && type2.value == "celcius") {
let Celcius = Number.parseInt(inputValue) - 273.15
result.innerHTML = Celcius.toFixed(3) + ` &deg;C`
}
else if (type1.value == "kelvin" && type2.value == "fahrenheit") {
let Fahrenheit = Number.parseInt(inputValue) - 273.15 * (9 / 5) + 32
result.innerHTML = Fahrenheit.toFixed(3) + " F"
}
else if (type1.value == "kelvin" && type2.value == "kelvin") {
let Kelvin = Number.parseInt(inputValue) * 1
result.innerHTML = Kelvin.toFixed(3) + " K"
}
else if (type1.value == "kelvin" && type2.value == "rankine") {
let Rankine = Number.parseInt(inputValue) * 1.8
result.innerHTML = Rankine.toFixed(3) + " R"
}
else if (type1.value == "rankine" && type2.value == "celcius") {
let Celcius = Number.parseInt(inputValue) - 491.67 * (5 / 9)
result.innerHTML = Celcius.toFixed(3) + ` &deg;C`
}
else if (type1.value == "rankine" && type2.value == "fahrenheit") {
let Fahrenheit = Number.parseInt(inputValue) - 495.67
result.innerHTML = Fahrenheit.toFixed(3) + " F"
}
else if (type1.value == "rankine" && type2.value == "kelvin") {
let Kelvin = Number.parseInt(inputValue) * (5 / 9)
result.innerHTML = Kelvin.toFixed(3) + " K"
}
else if (type1.value == "rankine" && type2.value == "rankine") {
let Rankine = Number.parseInt(inputValue) * 1
result.innerHTML = Rankine.toFixed(3) + " R"
}
}
Loading

0 comments on commit 5f0edea

Please sign in to comment.