diff --git a/web/css/dynmap_style.css b/web/css/dynmap_style.css index 94978192..26345bd4 100644 --- a/web/css/dynmap_style.css +++ b/web/css/dynmap_style.css @@ -159,12 +159,6 @@ color: #fff; border-left: 1px solid rgba(0,0,0,0.5); - - -moz-transition: all 0.6s ease-in-out; - -webkit-transition: all 0.6s ease-in-out; - -o-transition: all 0.6s ease-in-out; - - transition: all 0.6s ease-in-out; } .dynmap .hitbar { @@ -186,26 +180,43 @@ background-position:center; border: 1px solid rgba(0,0,0,0.5); - - -moz-transition: all 0.6s ease-in-out; - -webkit-transition: all 0.6s ease-in-out; - -o-transition: all 0.6s ease-in-out; - - transition: all 0.6s ease-in-out; } /* magic and metrics */ -.dynmap .sidebar:hover, +/* The following only applies to desktops, not to mobile devices */ +@media screen and (min-device-width: 640px) { + .dynmap .sidebar { + -moz-transition: all 0.6s ease-in-out; + -webkit-transition: all 0.6s ease-in-out; + -o-transition: all 0.6s ease-in-out; + transition: all 0.6s ease-in-out; + } + + .dynmap .hitbar { + -moz-transition: all 0.6s ease-in-out; + -webkit-transition: all 0.6s ease-in-out; + -o-transition: all 0.6s ease-in-out; + transition: all 0.6s ease-in-out; + } + + .dynmap .sidebar:hover { + margin-right: 0px; + } + + .dynmap .sidebar < .hitbar:hover { + margin-right: 0px; + } + + .dynmap .sidebar:hover .hitbar { + right: -120px; + } +} + .dynmap .sidebar.pinned { margin-right: 0px; } -.dynmap .sidebar < .hitbar:hover { - margin-right: 0px; -} - -.dynmap .sidebar:hover .hitbar, .dynmap .sidebar.pinned .hitbar { right: -120px; } diff --git a/web/index.html b/web/index.html index d7e54ae0..24fab7e2 100644 --- a/web/index.html +++ b/web/index.html @@ -7,7 +7,7 @@ - + diff --git a/web/js/map.js b/web/js/map.js index 55c05762..d209b747 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -328,12 +328,15 @@ DynMap.prototype = { .append(link=$('')) .data('link', link) .appendTo(container);*/ - if(me.options.sidebaropened != 'true') { - $('
') - .addClass('hitbar') - .appendTo(panel); + if(me.options.sidebaropened != 'true') { + var hitbar = $('') + .addClass('hitbar') + .click(function() { + sidebar.toggleClass('pinned'); + }) + .appendTo(panel); } - + var alertbox = me.alertbox = $('') .addClass('alertbox') .hide()