-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
213 lines (201 loc) · 7.51 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Web app to get info about spaceX launches.">
<meta name="theme-color" content="#97ca3e"/>
<title>SpaceX Platzi</title>
<link rel="icon" href="img/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="img/AppImages/ios/192.png">
<style>
header {
background-color: #595959;
color: white;
width:100%;
}
header img{
max-width: 100%;
height: auto;
}
#headerone{
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 0%;
}
#headertwo{
display: flex;
width: 100%;
justify-content: space-around;
align-items: center;
}
.card{
display: flex;
width: 50%;
justify-content: center;
background-color: #9191915b;
border-radius: 10%;
margin: 5%;
}
.card-container{
display:block;
text-align: center;
}
.row{
display: flex;
justify-content: center;
}
#btn-one{
width: 100%;
display: flex;
justify-content: center;
margin-bottom: 2%;
}
button{
padding: 1%;
}
footer {
background-color: #595959;
color: white;
display: flex;
justify-content: center;
}
.header {
display: inline;
}
.links:link {
color: #C9E09E;
background-color: transparent;
text-decoration: none;
}
.featured-launches-links {
color: #004BAD;
background-color: transparent;
text-decoration: none;
}
.past-launches {
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
align-items: center;
}
.launch-title-card {
margin: 1%;
padding: 1%;
border-radius: 1em;
background-color: #cdcbcb88;
}
.hide {
display: none;
}
@media (max-width: 751px) {
#headerone{
display: flex;
flex-direction: column;
text-align: center;
}
.row{
display: flex;
flex-direction: column;
align-items: center;
}
.card{
width: 90%;
}
}
</style>
<link rel="manifest" href="manifest.json">
</head>
<body>
<header>
<div id="headerone">
<h1 class="header">Platzinauta</h1>
<div class="description">
<h2>Like <a class="links" href="https://spacex.com" target="_blank">SpaceX</a> and <a class="links" href="https://platzi.com/" target="_blank">Platzi</a>? look launches info, for Platzinautas like you!</h2>
</div>
</div>
<div id="headertwo">
<div id="logo1" class="pruebas"> <img class="header" src="img/platzi-logo.png" width="258px" height="100px" alt="Platzi logo">
</div>
<div id="logo2" class="pruebas"> <img class="header" src="img/SpaceX_logo_black.svg.png" width="332px" height="41px" alt="SpaceX logo">
</div>
</div>
</header>
<section>
<div class="container">
<div class="row">
<div class="col-sm-3"></div>
<div id="upcoming" class="card">
<div id="upcoming-container" class="card-container">
<h2>Next Launch</h2>
<div id="title-upcoming-container">
<h3 id="title-upcoming"></h3>
</div>
<div id="img-upcoming-container">
<img id="img-upcoming" src="img/astronauta.png" width="60%" height="60%" alt="mission logo" />
</div>
<div id="date-upcoming-container">
<span><strong>When:</strong></span>
<p id="date-upcoming"></p>
</div>
<div id="countdown-upcoming-container">
<span><strong>Countdown for next launch:</strong></span>
<p id="countdown-upcoming"></p>
</div>
<p>Interested in see video, date and other info? see <a class="featured-launches-links" href="" id="more-upcoming">More details</a></p>
</div>
</div>
<div id="latest" class="card">
<div id="latest-container" class="card-container">
<h2>Last Launch</h2>
<div id="title-latest-container">
<h3 id="title-latest"></h3>
</div>
<div id="img-latest-container">
<img id="img-latest" src="img/astronauta.png" width="60%" height="60%" alt="mission logo" />
</div>
<div id="date-latest-container">
<span><strong>When:</strong></span>
<p id="date-latest"></p>
</div>
<p>Interested in see video, date and other info? see <a class="featured-launches-links" href="" id="more-latest">More details</a></p>
</div>
</div>
<div class="col-sm-3"></div>
</div>
<div id="btn-one">
<button id="past-launches-title" class="btn btn-secondary">List Past Launches</button>
</div>
<div class="hide" id="past-launches-container">
<div id="past-launches" class="past-launches btnlaunches"></div>
</div>
</div>
</section>
<footer>
<p>Developed by <a class="links" href="https://sb.js.org/">Santiago Bernal</a> and <a class="links" href="https://github.com/monocuka">Eliana Osorio</a> - <a class="links" href="https://github.com/santiaguf/spacex-platzi" target="_blank">Code</a> <br> Is the data too old? try <a id="clear-cache" class="links" href="#">clearing the cache</a></p>
</footer>
<script defer type="module" src="js/launches.js"></script>
<script defer type="text/javascript">
const clearcache = document.getElementById('clear-cache');
clearcache.addEventListener('click', () => {
localStorage.clear();
window.location.reload();
});
const btnListPastLaunches = document.getElementById("past-launches-title");
btnListPastLaunches.addEventListener("click", () => {
const pastLaunches = document.getElementById("past-launches-container");
pastLaunches.classList.remove("hide");
});
if ("serviceWorker" in navigator) {
window.addEventListener("load", function() {
navigator.serviceWorker
.register("/serviceWorker.js")
.then(res => console.log("service worker registered"))
.catch(err => console.log("service worker not registered", err))
})
}
</script>
</body>
</html>