generated from fastai/fastpages
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
116 lines (101 loc) · 2.59 KB
/
index.html
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
109
110
111
112
113
114
115
116
---
layout: home
search_exclude: true
image: images/logo.png
---
<link rel=" url" href="https://avatars.githubusercontent.com/u/77084624?v=4">
<body>
<!-- <button id = "personal" onclick="window.location.href = 'https://vun.sh';">Personal Page</button> -->
<div class="weather">
<img src="" alt="Icon" id="icon">
<div id="city">
</div>
<div id="container">
<div id="temp"> </div>
</div>
<div id="description">
</div>
</div>
<style>
/* #personal {
border-radius: 10px;
background-color: #8D8D8D;
border: none;
color: white;
padding: 10px 25px;
font-style: 'Roboto', 'sans-serif';
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
*/
#icon{
animation: fadeIn ease 1s;
}
@keyframes fadeIn{
0% {opacity:0;}
100% {opacity:1;}
}
#city{
font-size: 15px;
font-weight: 600;
color: rgb(255, 244, 244);
margin-top: 2px;
animation: fadeIn ease 1.5s;
animation-delay: .5s;
}
@keyframes fadeIn{
0% {opacity:0;}
100% {opacity:1;}
}
#temp {
margin-top:-.1%;
overflow: hidden;
font-size: 50px;
font-weight: 600;
color: rgb(255, 255, 255);
animation:
typing 1.5s forwards;
width: 0;
}
@keyframes typing {
from { width: 0 }
to { width: 100% }
}
#weather{
display: none;
flex-direction: row;
justify-content: center;
align-items: center;
}
body {
text-align: center;
font-family: 'Roboto', sans-serif;
justify-content: center;
}
</style>
<script>
var temp=document.getElementById("temp")
var city=document.getElementById("city")
var image = document.getElementById("icon")
fetch(`https://api.weatherbit.io/v2.0/current?lat=33.0167&lon=-117.1115&key=17270180ead94b27a3e874f0cdd513ec`)
.then(function(res){
return res.json()
})
.then(function(data){
if(!data) return;
const temper = data.data[0].temp
const fahrenheit = (temper * 9/5) + 32
temp.innerHTML = `<h1 id = "temp">${fahrenheit} F°</h1>`
temp.style.display = 'flex';
city.innerHTML = `<h1>4s Ranch, San Diego</h1>`
city.style.display = 'flex';
image.src=`https://www.weatherbit.io/static/img/icons/${data.data[0].weather.icon}.png`
image.style.display = 'flex';
})
</script>
</body>
# Posts