Skip to content

Commit 2beb287

Browse files
sides panels on widescreens
* pages from the top menu become side panesl on screen >900px wide * aboutbox opens on startup if screen >900px wide
1 parent 2298860 commit 2beb287

File tree

4 files changed

+39
-9
lines changed

4 files changed

+39
-9
lines changed

css/main.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,22 @@ header > div {
446446
overflow: auto;
447447
position: absolute;
448448
width: 100%;
449-
z-index: 50;
449+
z-index: 100;
450450
background: #fff;
451451
}
452452

453+
.topanel {
454+
float: right;
455+
position: relative;
456+
width: initial;
457+
padding: 0;
458+
padding-left: 10px;
459+
padding-right: 20px;
460+
box-shadow: 2px 0px 8px 0px #555;
461+
overflow-x: hidden;
462+
z-index: 3;
463+
}
464+
453465
.flatpage p {
454466
display: block;
455467
text-align: justify;
@@ -596,6 +608,7 @@ header > div {
596608
width: 280px;
597609
background: #fff;
598610
position: relative;
611+
z-index: 2;
599612
}
600613
#telemetry_graph .holder {
601614
border-left: 1px solid #ddd;
@@ -625,6 +638,7 @@ header > div {
625638
width: 199px;
626639
overflow: hidden;
627640
margin-top: 55px;
641+
box-shadow: -2px 0px 6px 0px #555;
628642
}
629643
#main .data {
630644
height: 100%;

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,20 @@ <h2>Embed tracker
7070
a specific callsign. Or two, or three. There are options to play with. It's easy. Just visit the page bellow and check it out.
7171
</p>
7272
<p>
73-
<a href="embed-preview.html">Customize tracker for embedding</a>
73+
<a href="embed-preview.html" target="_blank">Customize tracker for embedding</a>
7474
</p>
7575
</div>
7676
</div>
7777
<div id="aboutbox" style="display: none" class="flatpage">
7878
<div class="slimContainer">
79-
<h2><i class="icon-question rfloat"></i>Motd</h2>
79+
<h2><i class="icon-question rfloat"></i>Welcome</h2>
8080
<hr/>
81-
<div id='motd'></div>
81+
<div id='motd'><img style='display:block;margin:0 auto' src="img/hab-spinner.gif" /></div>
8282
<br/>
83+
<iframe data-src="https://www.google.com/calendar/embed?title=Habhub%20Calendar&amp;showTitle=0&amp;showNav=0&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=0&amp;mode=AGENDA&amp;height=450&amp;wkst=2&amp;bgcolor=%23ffffff&amp;src=5m4629p2h0esfojq1elep31einvu2q0v%40import.calendar.google.com&amp;color=%2300a3d3&amp;ctz=Pacific%2FMidway" style=" border-width:0 " width="290" height="450" frameborder="0" scrolling="no"></iframe>
8384
<p>
8485
Want to track with <b>Google Earth</b> instead?<br/> <a href="track.kml">Just click here</a>
8586
</p>
86-
<iframe data-src="https://www.google.com/calendar/embed?title=Habhub%20Calendar&amp;showTitle=0&amp;showNav=0&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=0&amp;mode=AGENDA&amp;height=450&amp;wkst=2&amp;bgcolor=%23ffffff&amp;src=5m4629p2h0esfojq1elep31einvu2q0v%40import.calendar.google.com&amp;color=%2300a3d3&amp;ctz=Pacific%2FMidway" style=" border-width:0 " width="290" height="450" frameborder="0" scrolling="no"></iframe>
8787
<h2>Contribute</h2>
8888
<hr/>
8989
<p>

js/app.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ function checkSize() {
149149
//h = (h < 300) ? 300 : h; // absolute minimum 320px minus 20px for the iphone bar
150150
hh = $('header').height();
151151

152+
ph = 0;
153+
154+
if(w > 900 && $('.flatpage:visible').length) {
155+
$('.flatpage').addClass('topanel');
156+
ph = $('.flatpage:visible').width()+30;
157+
} else {
158+
$('.flatpage.topanel').removeClass('topanel');
159+
}
160+
152161
$("#mapscreen,.flatpage").height(h-hh-5);
153162

154163
sw = (wvar.vlist) ? 199 : 0;
@@ -163,7 +172,7 @@ function checkSize() {
163172
$('#map').height(h-hh-5);
164173
}
165174
$('body,#loading').height(h);
166-
$('#mapscreen,#map,#telemetry_graph,#telemetry_graph .holder').width(w-sw);
175+
$('#mapscreen,#map,#telemetry_graph,#telemetry_graph .holder').width(w-sw-ph);
167176
$('#main').width(sw);
168177
} else { // portrait mode
169178
//if(h < 420) h = 420;
@@ -489,15 +498,18 @@ $(window).ready(function() {
489498
.on('click', 'li', function() {
490499
var e = $(this);
491500
var name = e.attr('class').replace(" last","");
501+
502+
// makes the menu buttons act like a switch
503+
if($("#"+name+"box").is(':visible')) name = 'home';
504+
492505
var box = $("#"+name+"box");
493506

494507
if(box.is(':hidden')) {
495508
$('.flatpage').hide();
496509
box.show().scrollTop(0);
497510

498-
if(name == 'about') {
499-
if(box.hasClass('inited')) return;
500-
box.addClass('inited');
511+
if(name == 'about' && !$('#motd').hasClass('inited')) {
512+
$('#motd').addClass('inited');
501513

502514
$.getJSON("http://spacenear.us/tracker/datanew.php?type=info", function(data) {
503515
if('html' in data) $('#motd').html(data.html.replace(/\\/g,''));

js/tracker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,10 @@ function load() {
455455
$("#lookanglesbox .nofollow").fadeIn(500, "easeOut");
456456
}
457457
});
458+
459+
// if we there is enough screen space open aboutbox on startup
460+
if(!is_mobile && $(window).width() > 900) $('.nav li.about').click();
461+
458462
}, 500);
459463

460464
// initialize clouds layer

0 commit comments

Comments
 (0)