Made the sidebar use clicking instead of hovering for mobile devices.

This commit is contained in:
FrozenCow 2012-01-07 01:03:39 +01:00
parent 7d98afc44d
commit 25edd46e36
3 changed files with 38 additions and 24 deletions

View File

@ -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;
}

View File

@ -7,7 +7,7 @@
<meta charset="utf-8" />
<meta name="keywords" content="minecraft, map, dynamic" />
<meta name="description" content="Minecraft Dynamic Map" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<!-- These 2 lines make us fullscreen on apple mobile products - remove if you don't like that -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

View File

@ -328,12 +328,15 @@ DynMap.prototype = {
.append(link=$('<input type="text" />'))
.data('link', link)
.appendTo(container);*/
if(me.options.sidebaropened != 'true') {
$('<div/>')
.addClass('hitbar')
.appendTo(panel);
if(me.options.sidebaropened != 'true') {
var hitbar = $('<div/>')
.addClass('hitbar')
.click(function() {
sidebar.toggleClass('pinned');
})
.appendTo(panel);
}
var alertbox = me.alertbox = $('<div/>')
.addClass('alertbox')
.hide()