Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Styled zoom buttons, added minimized form, changed font

Taylor Gunnoefb8a80ad07c0
diff --git a/src/css/new-ui.css b/src/css/new-ui.css
index d79ecb7d9..7e7aaf5e8 100644
--- a/src/css/new-ui.css
+++ b/src/css/new-ui.css
@@ -1,8 +1,14 @@
@font-face {
- font-family: 'Ubuntu Condensed';
+ font-family: 'Play';
font-style: normal;
font-weight: 400;
- src: url(../font/UbuntuCondensed-Regular.ttf) format('ttf');
+ src: url(../font/Play-Regular.ttf) format('truetype');
+}
+@font-face {
+ font-family: 'Play Bold';
+ font-style:bold;
+ font-weight: 700;
+ src: url(../font/Play-Bold.ttf) format('ttf');
}
*:focus {
outline: 0;
@@ -29,7 +35,7 @@
#timeline-footer text{
font-size:14px;
font-weight:normal;
- font-family:'Arial Narrow';
+ font-family:'Play', Fallback, sans-serif;
font-style:normal;
font-variant:normal;
font-stretch:normal;
@@ -93,7 +99,7 @@
stroke-dashoffset:0;
}
#timeline-header{
- background:;
+ margin-top:7px;
}
#timeline-header input{
height:60px;
@@ -101,7 +107,7 @@
border:1px solid transparent;
color:#1a1a1a;
font-size:33px;
- font-family:'Arial Narrow', sans-serif;
+ font-family:'Play', Fallback, sans-serif;
vertical-align:middle;
box-sizing:border-box;
-moz-box-sizing:border-box;
@@ -119,11 +125,6 @@
}
}
-/* Temporary sizing of inputs until something more dynamic can be made */
-#timeline-header input:nth-child(2){width:2em;padding:3px;}
-#timeline-header input:nth-child(3){width:1.8em;padding:3px;}
-#timeline-header input:nth-child(4){width:1.1em;padding:3px;}
-
#timeline-header .focus-guard{
/* display:none;
*/}
@@ -159,17 +160,17 @@ display:inline-block;}
fill-opacity:1;
stroke:none;
}
-#timeline-header, #timeline-footer{
- display:inline-block;
- vertical-align:middle;
+#timeline-header,#timeline-footer,#timeline-zoom,#timeline-hide{
+ float:left;
}
#timeline-footer{
display: inline-block;
- height:85px;
+ height:75px;
margin-left:0px;
+
}
#timeline-footer svg {
-overflow:visible;
+ overflow:visible;
}
/* Timeline svg classes */
@@ -209,7 +210,13 @@ overflow:visible;
#timeline-zoom{
display:inline-block;
vertical-align:middle;
- margin-left:10px;
+ overflow:hidden;
+ height:75px;
+ width:100px;
+ box-sizing:border-box;
+ -moz-box-sizing:border-box;
+ -webkit-box-sizing:border-box;
+
/*float:right;*/
}
#timeline-zoom a.zoom-btn{
@@ -217,13 +224,40 @@ overflow:visible;
clear:both;
cursor:pointer;
text-transform:uppercase;
+ text-align:center;
+ font-family:'Play', Fallback, sans-serif;
+}
+#timeline-zoom a.zoom-btn.depth-1{
+ color:#1a1a1a;
+ font-size:1.5em;
+ line-height:1.5em;
+}
+#timeline-zoom a.zoom-btn.depth-2{
+ color:#666666;
+ font-size:1em;
+ line-height:1em;
+}
+#timeline-zoom a.zoom-btn.depth-3{
+ color:#b3b3b3;
+ font-size:0.7em;
+ line-height:1em;
+}
+#timeline-zoom a.zoom-btn.depth-4{
+ display:none;
}
#timeline-zoom a.zoom-btn:hover{
background-color:#1a1a1a;
color:#fff;
}
-.zoom-btn-selected{
-
+#timeline-hide {
+ height:75px;
+ width:20px;
+ cursor:pointer;
+ float:right;
+ border-left:1px solid #1a1a1a;
+}
+#timeline-hide:hover{
+ background-color:#1a1a1a;
}
.x.axis > g.tick > text.sub-label{
fill:#777;
@@ -253,4 +287,15 @@ overflow:visible;
}
#guitarpick:hover rect{
fill:#999999;
+}
+#timeline-hide .hamburger{
+ vertical-align:middle;
+ display:block;
+ margin:32px auto 0 auto;
+}
+#timeline-hide .hamburger path{
+ fill:#1a1a1a;
+}
+#timeline-hide:hover .hamburger path {
+ fill:#cccccc;
}
\ No newline at end of file
diff --git a/src/font/Play-Bold.ttf b/src/font/Play-Bold.ttf
new file mode 100755
index 000000000..7b9d5bf0b
Binary files /dev/null and b/src/font/Play-Bold.ttf differ
diff --git a/src/font/Play-Regular.ttf b/src/font/Play-Regular.ttf
new file mode 100755
index 000000000..57ab4b1a9
Binary files /dev/null and b/src/font/Play-Regular.ttf differ
diff --git a/src/font/UbuntuCondensed-Regular.ttf b/src/font/UbuntuCondensed-Regular.ttf
deleted file mode 100755
index 8d3e86765..000000000
Binary files a/src/font/UbuntuCondensed-Regular.ttf and /dev/null differ
diff --git a/src/index.html b/src/index.html
index 54a208fda..ca4036723 100644
--- a/src/index.html
+++ b/src/index.html
@@ -221,9 +221,9 @@
<section id="timeline">
<div id="timeline-header">
<div id="focus-guard-1" class="focus-guard" tabindex="1"></div>
- <input type="text" value="2014" maxlength="4" class="button-input-group" id="year-input-group" tabindex="2" />
- <input type="text" value="Mar" maxlength="3" class="button-input-group" id="month-input-group" tabindex="3" />
- <input type="text" value="3" maxlength="2" class="button-input-group" id="day-input-group" tabindex="4" />
+ <input type="text" size="4" maxlength="4" class="button-input-group" id="year-input-group" tabindex="2" />
+ <input type="text" size="2" maxlength="3" class="button-input-group" id="month-input-group" tabindex="3" />
+ <input type="text" size="1" maxlength="2" class="button-input-group" id="day-input-group" tabindex="4" />
<div id="focus-guard-2" class="focus-guard" tabindex="5"></div>
<div class="button-action-group" id="left-arrow-group">
<svg>
@@ -233,7 +233,7 @@
</svg>
</div>
<div class="button-action-group" id="right-arrow-group">
- <svg>
+ <svg >
<path
d="M 10.240764,15 24,30 10.240764,45 0,45 13.759236,30 0,15 10.240764,15 z"
class="arrow" />
@@ -244,12 +244,16 @@
</div><!--/timeline-footer-->
<div id="timeline-zoom">
- <a class="zoom-btn" id="zoom-days">Weeks</a>
+ <a class="zoom-btn" id="zoom-weeks">Weeks</a>
<a class="zoom-btn" id="zoom-months">Months</a>
<a class="zoom-btn" id="zoom-years">Years</a>
<a class="zoom-btn" id="zoom-decades">Decades</a>
</div><!--/timeline-zoom-->
- <div id="timeline-hide"></div>
+ <div id="timeline-hide">
+ <svg class="hamburger" width="10" height="9">
+ <path d="M 0,0 0,1 10,1 10,0 0,0 z M 0,4 0,5 10,5 10,4 0,4 z M 0,8 0,9 10,9 10,8 0,8 z" />
+ </svg>
+ </div>
</section>
</div>
diff --git a/src/js/date/wv.date.timeline.js b/src/js/date/wv.date.timeline.js
index ff5664779..a8ab68dd3 100644
--- a/src/js/date/wv.date.timeline.js
+++ b/src/js/date/wv.date.timeline.js
@@ -46,8 +46,10 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
};
//subtract the datepicker from the width of the screen
- var width = window.innerWidth - $("#timeline-header").outerWidth() - 60 -50;
- var height = 85 - margin.top - margin.bottom;
+ var width;
+ var setWidth = function(){width = window.innerWidth - $("#timeline-header").outerWidth() - $("#timeline-zoom").outerWidth() - $("#timeline-hide").outerWidth() - 40;}
+ setWidth();
+ var height = 75 - margin.top - margin.bottom;
var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ];
@@ -140,7 +142,9 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
addSubAxes();
//UPDATE GUITARPICK
- guitarPick.attr("transform","translate("+(x(model.selected)-25)+",-10)");
+ if (guitarPick){
+ guitarPick.attr("transform","translate("+(x(model.selected)-25)+",-20)");
+ }
};
var addSubAxes = function(){
@@ -211,7 +215,8 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
var newDate;
switch(zoomLvl){
case 0:
- newDate = new Date((Math.ceil(d.getUTCFullYear() / 10) * 10),model.selected.getUTCMonth(),model.selected.getUTCDate());
+ var yearOffset = model.selected.getUTCFullYear() - Math.ceil(new Date(model.selected.getUTCFullYear()/10)*10);
+ newDate = new Date(d.getUTCFullYear()+yearOffset,model.selected.getUTCMonth(),model.selected.getUTCDate());
break;
case 1:
newDate = new Date(d.getUTCFullYear(),model.selected.getUTCMonth(),model.selected.getUTCDate());
@@ -291,7 +296,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
}
- guitarPick.attr("transform","translate("+(x(model.selected)-25)+",-10)");
+ guitarPick.attr("transform","translate("+(x(model.selected)-25)+",-20)");
// Don't grab focus to allow arrow keys to work
//$('.button-input-group-selected').select();
@@ -301,7 +306,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
};
var resizeWindow = function(){
- width = window.innerWidth - $("#timeline-header").outerWidth() - 60 -50;
+ setWidth();
d3.select('#timeline-footer svg')
.attr('width', width + margin.left + margin.right);
timeline.select(".x.axis line:first-child").attr("x2",width);
@@ -377,24 +382,28 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
.append("svg:rect")
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom+10)
- .attr("y","-10");
+ .attr("y","-20");
timeline = d3.select("#timeline-footer svg")
.append("svg:g")
+ .attr("clip-path","#timeline-boundary")
.attr("style","clip-path:url(#timeline-boundary);");
zoom.translate([width/2 - x(model.selected),0]);
-// zoom.center([x(model.selected),0]);
+
timeline.append("svg:g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
- .call(xAxis.tickSize(-height).tickPadding(5).ticks(zoomInterval,zoomStep))
.insert("line",":first-child")
.attr("x1",-10)
- .attr("x2",width);
+ .attr("x2",width+100);
- addSubAxes();
+ redrawAxis(zoomInterval, zoomStep);
+ $('#zoom-decades').addClass("depth-3").css("margin","5px 0 0 0");
+ $('#zoom-years').addClass("depth-2");
+ $('#zoom-months').addClass("depth-1");
+ $('#zoom-weeks').addClass("depth-2").css("margin","10px 0 0 0");
//Add y axis and remove labels
verticalAxis = timeline.append("svg:g")
@@ -408,12 +417,14 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
//Plot data
var chartBody = timeline.append("svg:g")
.attr("style","clip-path:url(#timeline-boundary)")
+ .attr("clip-path","#timeline-boundary")
.attr("height",height);
/*chartBody.append("svg:path")
.datum(layers)
.attr("class","layer-bar")
.attr("d", bar);
*/
+
//Add guitar pick
guitarPick = d3.select("#timeline-footer svg")
@@ -421,7 +432,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
.attr("id","guitarpick")
.attr("style","clip-path:url(#guitarpick-boundary);")
.append("svg:g")
- .attr("transform","translate("+(x(model.selected)-28)+",-10)");
+ .attr("transform","translate("+(x(model.selected)-28)+",-20)");
guitarPick.append("svg:path")
.attr("d", "M 7.3151,0.7426 C 3.5507,0.7426 0.5,3.7926 0.5,7.5553 l 0,21.2724 14.6038,15.7112 14.6039,15.7111 14.6038,-15.7111 14.6037,-15.7112 0,-21.2724 c 0,-3.7627 -3.051,-6.8127 -6.8151,-6.8127 l -44.785,0 z");
@@ -475,7 +486,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
break;
}
- guitarPick.attr("transform","translate("+ (x(newDate)-28) +",-10)");
+ guitarPick.attr("transform","translate("+ (x(newDate)-28) +",-20)");
model.select(newDate);
}
});
@@ -492,7 +503,21 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
$(this).addClass('button-input-group-selected');
$(this).select();
});
-
+ $('#timeline-hide').click(function(e){
+ var $tl = $('#timeline-footer, #timeline-zoom');
+ if($tl.is(':hidden')){
+ $tl.show('slow');
+ $('#timeline').css('right','10px');
+ d3.select('#timeline-footer svg g').attr("clip-path","#timeline-boundary");
+ $("#guitarpick").show();
+ }
+ else{
+ $tl.hide('slow');
+ $("#guitarpick").hide();
+ $('#timeline').css('right','auto');
+ }
+
+ });
model.events.on("select", function(){
updateTime();
});
@@ -557,8 +582,6 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
setZoomLevel(0);
});
d3.select("#zoom-years").on("click",function(d){
- $('.zoom-btn').removeClass("zoom-btn-selected");
- $(this).addClass("zoom-btn-selected");
setZoomLevel(1);
});
d3.select("#zoom-months").on("click",function(d){
@@ -566,7 +589,7 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
$(this).addClass("zoom-btn-selected");
setZoomLevel(2);
});
- d3.select("#zoom-days").on("click",function(d){
+ d3.select("#zoom-weeks").on("click",function(d){
$('.zoom-btn').removeClass("zoom-btn-selected");
$(this).addClass("zoom-btn-selected");
setZoomLevel(3);
@@ -585,6 +608,15 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
subStep = 1;
zoomStep = 10;
zoomScale = 1;
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-decades').addClass("depth-1");
+ $('#zoom-years').addClass("depth-2").css("font-size","1.2em");
+ $('#zoom-months').addClass("depth-3").css("margin","-3px 0 5px 0");
+ $('#zoom-weeks').addClass("depth-4");
+
+
break;
case 'years':
case 1:
@@ -592,7 +624,14 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
subInterval = d3.time.month.utc;
subStep = 1;
zoomStep = 1;
- zoomScale = 10;
+ zoomScale = 10
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-decades, #zoom-months').addClass("depth-2");
+ $('#zoom-years').addClass("depth-1").css("font-size","1.7em");
+ $('#zoom-weeks').addClass("depth-3").css("margin","-3px 0 3px 0");
+
break;
case 'months':
case 2:
@@ -601,14 +640,30 @@ wv.date.timeline = wv.date.timeline || function(models, config, ui) {
subStep = 1;
zoomStep = 1;
zoomScale = 170;
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-decades').addClass("depth-3").css("margin","5px 0 0 0");
+ $('#zoom-years').addClass("depth-2");
+ $('#zoom-months').addClass("depth-1");
+ $('#zoom-weeks').addClass("depth-2").css("margin","10px 0 0 0");
+
break;
- case 'days':
+ case 'weeks':
case 3:
zoomInterval = d3.time.week.utc;
subInterval = d3.time.day.utc;
subStep = 1;
zoomStep = 1;
zoomScale = 570;
+ $('.zoom-btn').removeClass(function (index, css) {
+ return (css.match (/(^|\s)depth-\S+/g) || []).join(' ');
+ }).css("margin","").css("font-size","");
+ $('#zoom-decades').addClass("depth-4");
+ $('#zoom-years').addClass("depth-3").css("margin","5px 0 0 0");
+ $('#zoom-months').addClass("depth-2");
+ $('#zoom-weeks').addClass("depth-1").css("margin","25px 0 0 0");
+
break;
default:
zoomInterval = d3.time.year.utc;