This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
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
1 parent
489a1c8
commit 76c7d77
Showing
1 changed file
with
45 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,45 @@ | ||
<head> | ||
<title>Active Tornado Warnings</title> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<div align="center"> | ||
<body style="font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"> | ||
<div align="center"> | ||
<h1>Active Tornado Warnings</h1> | ||
<div class="warning-card"> | ||
<h2>There are</h2> | ||
<h1 class="warningnum" id="warncount">0</h1> | ||
<h3 class="warnsay">Tornado Warnings Now</h3> | ||
<h3 class="credit">This project/code was built by: Jesse Hasty/Chesham Academy</h3> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<style> | ||
body { | ||
background-color: transparent; | ||
align-items: center; | ||
} | ||
.warning-card { | ||
background-color: darkred; | ||
width: 300px; | ||
color: white; | ||
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; | ||
} | ||
.warningnum { | ||
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif; | ||
font-size: 48px; | ||
} | ||
</style> | ||
<script> | ||
getAlert(); | ||
const api_url = `https://api.aerisapi.com/alerts/summary/minneapolis,mn?radius=2500miles&filter=severe;tornado&client_id=DZLMGEFxCvfbQRG7aSN3c&client_secret=N63dulcmKzQTrWjIrTe2aGKmOw5AhERWWUmjHQKt`; | ||
async function getAlert() { | ||
const wx = await fetch(api_url); | ||
const data = await wx.json(); | ||
const {response, summary, count} = data; | ||
|
||
document.getElementById('warncount').textContent = response[0].summary.count; | ||
} | ||
getAlert(); | ||
</script> |