Skip to content

Commit

Permalink
new goog font, new bg color on pass-fail, add space div hourly
Browse files Browse the repository at this point in the history
  • Loading branch information
alexle committed Aug 14, 2013
1 parent 69db1d7 commit f3691dd
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 126 deletions.
81 changes: 33 additions & 48 deletions css/index.css
@@ -1,5 +1,6 @@
body {
font: 300 125%/1em "Helvetica", "Arial", sans-serif;
/*font: 300 125%/1em "Helvetica Neue", "Arial", sans-serif;*/
font-family: "Raleway", serif;
}
header, article, footer {
width: 23em;
Expand All @@ -18,50 +19,21 @@ footer {
}
.tr {
display: table-row;
border: 1px solid #777;
}
.td {
display: table-cell;
width: 5em;
}

/* Table current styles */
.curr_table {
display: table;
width: 100%;
}
.curr_tr {
display: table-row;
text-align: center;
}
.curr_td {
display: table-cell;
}
.td1 {
display: table-cell;
padding-left: 0.5em;
padding-right: 0.5em;
font-size: 1.3em;
}

#aaaa {
overflow-x: scroll;
overflow-y: hidden;

}

/* Clear styles */
.clear {
clear: both;
}
.current_to_hour_space {
height: 2em;
width: 100px;
}

/* Current styles */
.curr_wrapper {
}
.curr_top, .curr_mid {
display: table;
margin: 0 auto;
padding-bottom: 1.2em;
padding-top: 0.6em;
padding-bottom: 0.6em;
}
.curr_left {
float:left;
Expand All @@ -88,19 +60,12 @@ overflow-y: hidden;
.detail_right {
text-align: right;
}
.curr_detail_img {
height: 20px;
width: 20px;
}

/* Hour styles */
#hour_wrapper {
}
.hour_header {
}
.hourly {
.hour_wrapper {
border-top: 1px solid #777;
padding-top: 2.5em;
padding-top: 0.5em;
padding-bottom: 0.5em;
}
.hour_summary, .hour_temp, .hour_rain, .hour_time {
font-size: 1.6em;
Expand All @@ -119,10 +84,30 @@ overflow-y: hidden;
/* Day styles */
.day {
border-top: 1px solid #777;
padding-top: 20px;
padding-bottom: 20px;
margin-top: 20px;
margin-bottom: 20px;
}
.day_temp {
font-size: 2em;
}

/* Pass/Fail styles */
.pass {
background-color: #D6FFD6;
}

.fail {
/*
background-color: #FFD6D6;
*/
}

/* Clear styles */
.clear {
clear: both;
}
.current_to_hour_space {
height: 2em;
}


112 changes: 35 additions & 77 deletions index.html
Expand Up @@ -11,6 +11,8 @@

<!-- CSS -->
<link href="css/index.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Raleway">
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Exo">
</head>

<body onload="LoadSkyCon()">
Expand All @@ -19,101 +21,57 @@ <h2>Should Alex go for a run? {% if CurrentData.status == False %}<span style="c
</header>

<article>
<div class="curr_top">
<div class="curr_left">
<canvas id="curr" class="{{ CurrentData.icon }}" width="100" height="100"></canvas>
<div class="curr_wrapper">
<div class="table">
<div class="tr">
<div class="td detail_left">{{ CurrentData.time }}</div>
<div class="td detail_right">{{ CurrentData.location }}</div>
</div>
</div>
<div class="curr_right">
<div class="curr_temp">{{ CurrentData.temperature }}&deg;</div>
<div class="curr_top">
<div class="curr_left">
<canvas id="curr" class="{{ CurrentData.icon }}" width="100" height="100"></canvas>
</div>
<div class="curr_right">
<div class="curr_temp">{{ CurrentData.temperature }}&deg;</div>
</div>
</div>
</div>

<div class="clear"></div>
<div class="clear"></div>

<div class="curr_mid">{{ CurrentData.summary }}</div>
<div class="curr_mid">{{ CurrentData.summary }}</div>

<div class="curr_table">
<div class="tr">
<div class="curr_td detail_left">Rain: {{ CurrentData.precip_prob }}%</div>
<div class="curr_td detail_mid">Wind: {{ CurrentData.wind_speed }} mph</div>
<div class="curr_td detail_right">Cloud: {{ CurrentData.cloud_cover }}%</div>
<div class="table">
<div class="tr">
<div class="td detail_left">Rain: {{ CurrentData.precip_prob }}%</div>
<div class="td detail_mid">Wind: {{ CurrentData.wind_speed }} mph</div>
<div class="td detail_right">Cloud: {{ CurrentData.cloud_cover }}%</div>
</div>
</div>
</div>
</article>

<article>
<!--
<div class="curr_table">
<div class="tr">
<div class="curr_td curr_detail_left">Rain:</div>
<div class="curr_td curr_detail_left" style="width=100%">{{ CurrentData.precip_prob }}%</div>
<div class="curr_td curr_detail_right">Cloud:</div>
<div class="curr_td curr_detail_right">{{ CurrentData.cloud_cover }}%</div>
</div>
<div class="tr">
<div class="curr_td curr_detail_left">Wind:</div>
<div class="curr_td curr_detail_left">{{ CurrentData.wind_speed ~ " mph " ~ CurrentData.wind_bearing }}</div>
<div class="curr_td curr_detail_right">Humid:</div>
<div class="curr_td curr_detail_right">{{ CurrentData.humidity }}%</div>
</div>
</div>
-->

<div class="clear current_to_hour_space"></div>

<!--
<div id="aaaa">
<div class="table">
<div class="curr_tr">
{% for hour in HourlyData %}
<div class="td1">
<div class="curr_tr">{{ hour.time }}</div>
<div class="curr_tr">
<canvas id="hour{{ loop.index }}" class="{{ hour.icon }}" width="50" height="50"></canvas>
</div>
<div class="curr_tr">{{ hour.temperature }}&deg;</div>
<div class="curr_tr ">{% if hour.precip_prob > 0 %}{{ hour.precip_prob }}%{% endif %}</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="table">
{% for hour in HourlyData %}
<div class="tr">
<div class="td hour_time">{{ hour.time }}</div>
<div class="td">
<canvas id="hour{{ loop.index }}" class="{{ hour.icon }}" width="50" height="50"></canvas>
</div>
<div class="td hour_temp">{{ hour.temperature }}&deg;</div>
<div class="td hour_rain">{% if hour.precip_prob > 0 %}{{ hour.precip_prob }}%{% endif %}</div>
<div class="td hour_summary">{% if hour.status == False %}<span style="color:red">{{ hour.msg }}{% else %}<span style="color:green">{{ hour.msg }}</span>{% endif %}</div>
</div>
{% endfor %}
</div>
-->
<article>
<div class="table">
<div class="tr hour_header">
<div class="td"></div>
<div class="td"></div>
<div class="td">Temp</div>
<div class="td">Rain</div>
<div class="td">Wind</div>
<div class="td">Run?</div>
</div>
{% for hour in HourlyData %}
<div class="tr">
{% for hour in HourlyData %}
<div class="hour_wrapper">
{% if hour.status == True %}
<div class="tr pass">
{% else %}
<div class="tr fail">
{% endif %}
<div class="td">{{ hour.time }}</div>
<div class="td">
<canvas id="hour{{ loop.index }}" class="{{ hour.icon }}" width="50" height="50"></canvas>
</div>
<div class="td hour_temp">{{ hour.temperature }}&deg;</div>
<div class="td ">{{ hour.precip_prob }}%</div>
<div class="td ">{{ hour.wind_speed }} mph</div>
<div class="td">{% if hour.status == False %}<span style="color:red">{{ hour.msg }}{% else %}<span style="color:green">{{ hour.msg }}</span>{% endif %}</div>
<div class="td ">Rain: {{ hour.precip_prob }}%</div>
<div class="td ">Wind: {{ hour.wind_speed }} mph</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</article>
<!--
Expand Down
4 changes: 3 additions & 1 deletion main.py
Expand Up @@ -26,6 +26,7 @@ class CurrentlyData:
cloud_cover = ''
status = ''
msg = ''
location = ''

class DayEntry:
icon = ''
Expand Down Expand Up @@ -84,9 +85,10 @@ def ParseCurrently(json):
curr_data.precip_prob = int(round(json['currently']['precipProbability'] * 100))
curr_data.precip_intensity = json['currently']['precipIntensity']
curr_data.cloud_cover = int(round(json['currently']['cloudCover'] * 100))
curr_data.location = json['timezone']

loc_datetime = datetime.fromtimestamp(json['currently']['time']) + timedelta(hours=int(json['offset']))
curr_data.time = loc_datetime.strftime('%a %m-%d %I:%M %p').lstrip('0').lower()
curr_data.time = loc_datetime.strftime('%I:%M%p').lstrip('0').lower()

ShouldAlexRun( curr_data )

Expand Down
Binary file modified main.pyc
Binary file not shown.

0 comments on commit f3691dd

Please sign in to comment.