+
+
diff --git a/app/views/index.ejs b/app/views/index.ejs new file mode 100644 index 0000000..534afaf --- /dev/null +++ b/app/views/index.ejs @@ -0,0 +1,217 @@ +<% +if (locals.locationError) {locationError = true} else {locationError = false} +if (locals.forecastError) {forecastError = true} else {forecastError = false} + +if (locals.currentForecast != "" && locals.currentForecast != undefined) { + currentForecast = locals.currentForecast + hourlyForecast=locals.hourlyForecast + dailyForecast=locals.dailyForecast + alertsForecast=locals.alertsForecast + timerTotal=locals.avgTimer +} else { + location = "" + currentForecast = "" + hourlyForecast = "" + dailyForecast = "" + alertsForecast = "" + timerTotal = "" +} +%> + +<%- include('inc/header.ejs') %> + +
+
+
+ <% if (currentForecast == "") { %> + + <% } else { %> + + <% } %> + +
+
+

+ + <% if (currentForecast == "") { %> +
+ + 60601 (Least accurate)
+ Chicago IL (More accurate)
+ 233 S Wacker Dr Chicago IL (Most accurate) +
+
+ <% } %> + + + <% if (locationError) { %> +
+
+

There was an issue finding your location, please double check your entry.

+
+ <% } %> + + + <% if (forecastError) { %> +
+
+

There was an issue obtaining your forecast, please refresh.

+
+ <% } %> + + + <% if (alertsForecast != "") { %> +
+ <% alertsForecast.forEach((alerts, i) => { %> +
+

+ +

+
+
+ <%=alerts.properties.description%>

<%=alerts.properties.senderName%> +
+
+
+ <% }) %> +
+ <% } %> + + + <% if (currentForecast != "") { %> +
+
+
Current
+
+
+
<%=currentForecast.temperatureTime%>
+ +

<%-currentForecast.temperature%> <%-currentForecast.temperaturetrend%>

+ <% if (currentForecast.apparentTemperature != currentForecast.temperature) { %> +

Feels like: <%-currentForecast.apparentTemperature%>

+ <% } %> + <% if (currentForecast.windSpeed != '') { %> +

Wind: <%-currentForecast.windSpeed%> + <% if (currentForecast.windGust != '') { %> +
Gusts: <%-currentForecast.windGust%> + <% } %> +

+ <% } %> +
<%=currentForecast.shortForecast%>
+ <%if (currentForecast.precipitation != 0 && currentForecast.weather != null && currentForecast.weather != 'fog') { %> +

<%=currentForecast.precipitation%>% chance of precipitation

+ <% } %> + <% if (currentForecast.highTemp != 999) { %> +

+ High <%-currentForecast.highTemp%> at <%=currentForecast.highTime%>
+  Low <%-currentForecast.lowTemp%> at <%=currentForecast.lowTime%> +

+ <% } else { %> +

High and Low times are not currently available

+ <% } %> + <% if (currentForecast.sunrise != null && currentForecast.sunset != null) { %> +
Sunrise <%=currentForecast.sunrise%>
+
Sunset <%=currentForecast.sunset%>
+ <% } %> +
+
+
+

+ <% } %> + + + <% if (hourlyForecast != "") { %> +
+
+
Hourly
+
+
+
+
+ <% + hourlyForecast.forEach((hourly) => { + %> +
+
<%=hourly.temperatureTime%>
+ +

<%-hourly.temperature%>

+ <% if (hourly.apparentTemperature != hourly.temperature) { %> +

Feels like: <%-hourly.apparentTemperature%>

+ <% } else { %> +
+ <% } %> +
<%=hourly.shortForecast%>
+ <%if (hourly.precipitation != 0 && hourly.weather != null && hourly.weather != 'fog') { %> +

<%=hourly.precipitation%>%

+ <% } %> +
+ <% + }) + %> +
+
+
+
+
+
+
+

+ <% } %> + + <% if (dailyForecast != "") { %> + + <% dailyForecast.forEach((daily) => { %> +
+
+
<%=daily.dayOfWeek%>
+
+
+ <% if (daily.morningHide != true) { %> + +
<%=daily.morningForecast.shortForecast%>
+

+ High <%-daily.morningHigh%> at <%=daily.morningHighTime%>
  + Low <%-daily.morningLow%> at <%=daily.morningLowTime%> +

+ <% } %> +
Sunrise <%=daily.sunrise%>


+ <% if (daily.dayHide != true) { %> + +
<%=daily.dayForecast.shortForecast%>
+

+ High <%-daily.dayHigh%> at <%=daily.dayHighTime%>
  + Low <%-daily.dayLow%> at <%=daily.dayLowTime%> +

+ <% } %> +
Sunset <%=daily.sunset%>


+ <% if (daily.eveningHide != true) { %> + +
<%=daily.eveningForecast.shortForecast%>
+

+ High <%-daily.eveningHigh%> at <%=daily.eveningHighTime%>
  + Low <%-daily.eveningLow%> at <%=daily.eveningLowTime%> +

+ <% } %> +
+
+
+

+ <% }) %> + <% } %> + + + +<%- include('inc/footer.ejs', {timerTotal: timerTotal}) %> diff --git a/app/views/maintenance.ejs b/app/views/maintenance.ejs new file mode 100644 index 0000000..df3a1b5 --- /dev/null +++ b/app/views/maintenance.ejs @@ -0,0 +1,10 @@ +<%- include('inc/header.ejs') %> + +
+

+

+ We are undergoing maintenance
We will be back online soon +

+
+ +<%- include('inc/footer.ejs') %>