Skip to content

Commit

Permalink
Create clothing-suggester.html
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnole25 authored Jan 8, 2024
1 parent 25c108f commit c6e62cd
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions clothing-suggester.html
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 + "&deg;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>

0 comments on commit c6e62cd

Please sign in to comment.