-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Height Converter</title> | ||
<style> | ||
h1 {color: #ffff00; font-family: trebuchet ms; text-align: center; font-size:300%} | ||
p {color: #ffffff; font-family: trebuchet ms; text-align: center; font-size:150%} | ||
body {background-color: #404040;} | ||
#slider {width: 720px; margin-left: auto; margin-right: auto; display: block;} | ||
#dispDiv {color: #ffffff; font-family: trebuchet ms; text-align: center; font-size: 300%} | ||
#suggestedClothes {color: #ffffff; font-family: trebuchet ms; text-align: center; font-size: 300%} | ||
.small-text {font-size: 100%} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Clothing Suggester</h1> | ||
<p>Suggest clothes to wear w/ temperature quickly using simple Javascript</p> | ||
<input type="range" min="-30" max="50" value="20" step="1" id="slider"> | ||
<div id="dispDiv" style='margin-top:2em;'></div> | ||
<p>Suggested clothing:</p> | ||
<div id="suggestedClothes" style='margin-top:2em;'></div> | ||
<script> | ||
var slider = document.getElementById("slider"); | ||
|
||
var a = 0; // Variable "a" is the temperature in Celsius | ||
|
||
setInterval(function() { | ||
a = slider.value; | ||
dispDiv.innerHTML = "Feels Like Temp: " + a + "°C"; | ||
if (a >= 35) { | ||
suggestedClothes.innerHTML = "Too hot to go outside!" | ||
} else if (a >= 30) { | ||
suggestedClothes.innerHTML = "π + π½ + π©³ + π" | ||
} else if (a >= 25) { | ||
suggestedClothes.innerHTML = "π + π + π©³ + π" | ||
} else if (a >= 15) { | ||
suggestedClothes.innerHTML = "π + π©³ + π" | ||
} else if (a >= 10) { | ||
suggestedClothes.innerHTML = "π + π + π₯Ύ" | ||
} else if (a >= 5) { | ||
suggestedClothes.innerHTML = "π§₯ + π + π₯Ύ" | ||
} else if (a >= -5) { | ||
suggestedClothes.innerHTML = "π + π§₯ + 𧀠+ π + π’" | ||
} else if (a >= -15) { | ||
suggestedClothes.innerHTML = "π + 𧣠+ π§₯ x2 + 𧀠+ π x2 + π’" | ||
} else { | ||
suggestedClothes.innerHTML = "Too cold to go outside!" | ||
} | ||
}, 100) | ||
</script> | ||
<p class=small-text>Made by JC</p> | ||
</body> | ||
</html> |