-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweather.html
More file actions
108 lines (108 loc) · 4.56 KB
/
Copy pathweather.html
File metadata and controls
108 lines (108 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8"><meta name="author" content="felixthecat8a">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple JS</title>
<!--Glide-->
<script src="https://cdn.jsdelivr.net/npm/@glidejs/glide"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@glidejs/glide/dist/css/glide.core.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@glidejs/glide/dist/css/glide.theme.min.css">
<!-- ChartJS -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="icon" href="favicon.ico"><script defer src="script/src_scss_style_scss.bundle.js"></script><script defer src="script/src_js_libs_catLib_js.bundle.js"></script><script defer src="script/weather.bundle.js"></script><link href="style/src_scss_style_scss.css" rel="stylesheet"><link href="style/weather.css" rel="stylesheet"></head>
<body>
<header>
<div class="header-container">
<h1><em>Simple</em>Examples</h1>
<nav>
<ul>
<li><a href="index.html">🏡<br>Home</a></li>
<li><a href="weather.html">🌦️<br>Weather</a></li>
<li><a href="cat.html">🐈<br>Cat</a></li>
</ul>
</nav>
</div>
</header>
<main>
<!-- <form>
<fieldset>
<legend>Temperature Conversion</legend>
<label for="celsiusVal">°Celsius: </label>
<input type="number" id="celsiusVal" placeholder="Celsius" /><button id="convert" type="button" class="button-info">Convert</button>
<p>Enter the temperature in this box, and click the convert button. The conversion will appear in the other box.</p>
<br>
<label fahrenheitVal>°Fahrenheit: </label>
<input type="number" id="fahrenheitVal" placeholder="Fahrenheit" />
<p>Enter the temperature in this box, and the conversion will appear in the other box automatically.</p>
</fieldset>
</form>
<script>
const celsiusVal = document.getElementById('celsiusVal');
const fahrenheitVal = document.getElementById('fahrenheitVal');
const convert = document.getElementById('convert');
celsiusVal.addEventListener('keypress', function (event) {
if (event.key === 'Enter') {
event.preventDefault();
convert.click();
}
});
fahrenheitVal.addEventListener('keypress', function (event) {
if (event.key === 'Enter') {
event.preventDefault();
convert.click();
}
});
convert.addEventListener('click', toFahrenheit);
function toFahrenheit() {
if (celsiusVal.value) {
var fahrenheitOutput = parseFloat(celsiusVal.value) * 1.8 + 32;
fahrenheitVal.value = fahrenheitOutput.toFixed(2);
}
else {
fahrenheitVal.value = '';
}
}
fahrenheitVal.addEventListener('input', toCelsius);
function toCelsius() {
if (fahrenheitVal.value) {
var celsiusOutput = (parseFloat(fahrenheitVal.value) - 32) / 1.8;
celsiusVal.value = celsiusOutput.toFixed(2);
}
else {
celsiusVal.value = '';
}
}
</script>
<br>
<hr>
<br> -->
<article class="weather-display">
<div class="heading-container">
<div class="heading-card">
<h1><a href="" target="_blank" id="apiLink" title="API Link">National Weather Service API</a></h1>
<select id="apiSelect" title="Select API">
<optgroup label="Weather">
<option value="showDefault" selected>JEHS, TX</option>
<option value="showForecast">Use My Location</option>
</optgroup>
<optgroup label="Cat">
<option value="showCat">Show a Cat</option>
<option value="showCatSlider">Show Five Cats</option>
</optgroup>
</select>
</div>
</div>
<div id="statusDiv"></div>
<span id="displayDiv"></span>
</article>
<h5>Charts created using <a href="https://www.chartjs.org" target="_blank" rel="noopener noreferrer">Chart.js</a></h5>
<h5>Sliders created using <a href="https://glidejs.com/" target="_blank" rel="noopener noreferrer">Glide.js</a></h5>
</main>
<footer>
<h5>©2026 felixthecat8a🐈 | <a href="https://github.com/felixthecat8a" target="_blank" rel="noopener noreferrer" style="color:Chartreuse;">GitHub</a></h5>
<h6>temperature.html</h6>
</footer>
</body>
</html>