many ui iprovements by lechd

This commit is contained in:
Arthur Mayer 2011-02-19 20:51:21 +01:00
parent 9d2af0f641
commit f3078e5c3b
6 changed files with 323 additions and 166 deletions

View file

@ -1,15 +1,29 @@
#chat { #chat {
position:absolute; position:absolute;
bottom:14px; bottom:0px;
left:14px; left:14px;
border: 1px solid rgba(0,0,0,0.5);
background: rgba(0, 0, 0, 0.6); border-color: rgba(0,0,0,0.5);
background: rgba(0,0,0,0.6);
border-style: solid;
border-width: 1px 1px 0px 1px;
-moz-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-o-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-moz-border-radius: 3px 3px 0px 0px;
-webkit-border-radius: 3px 3px 0px 0px;
-o-border-radius: 3px 3px 0px 0px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
border-radius: 3px 3px 0px 0px;
} }
#chatcursor { #chatcursor {
position:absolute; position:absolute;
left:5px; left:5px;
bottom:5px; bottom:5px;
font-size:10px;
color: white; color: white;
padding:0px; padding:0px;
} }
@ -17,8 +31,6 @@
margin:4px; margin:4px;
width:608px; width:608px;
height:12px; height:12px;
font-family:sans-serif;
font-size:10px;
padding:1px; padding:1px;
padding-left:15px; padding-left:15px;
color: white; color: white;
@ -29,11 +41,8 @@
margin:4px 4px 0px 4px; margin:4px 4px 0px 4px;
width:622px; width:622px;
max-height:198px; max-height:198px;
font-family:sans-serif;
font-size: 10px;
padding:1px; padding:1px;
color: white; color: white;
background: rgba(0, 0, 0, 0.6);
overflow:hidden; overflow:hidden;
display:none; display:none;
} }
@ -42,9 +51,8 @@
left:0px; left:0px;
bottom:0px; bottom:0px;
max-height:200px; max-height:200px;
font-family:sans-serif;
font-size: 10px;
color: white; color: white;
font-weight:bold;
} }
.messageicon { .messageicon {
position:relative; position:relative;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Before After
Before After

View file

@ -3,25 +3,25 @@
*/ */
html { html {
height: 100% height: 100%
} }
body { body {
height: 100%; height: 100%;
font-family: sans-serif; font-family: sans-serif;
font-size: 11px; font-size: 11px;
color: #fff; color: #fff;
background: #000; background: #000;
margin: 0px; margin: 0px;
padding: 0px ; padding: 0px ;
} }
.dynmap .map .tile img { .dynmap .map .tile img, img {
image-rendering: -moz-crisp-edges; image-rendering: -moz-crisp-edges;
-ms-interpolation-mode: nearest-neighbor; -ms-interpolation-mode: nearest-neighbor;
} }
@ -30,13 +30,13 @@ body {
*/ */
.dynmap fieldset { .dynmap fieldset {
border: none; border: none;
border-top: 1px solid rgba(196,196,196,0.4); border-top: 1px solid rgba(196,196,196,0.4);
} }
.dynmap legend { .dynmap legend {
padding: 8px 4px; padding: 8px 4px;
font-weight: bold; font-weight: bold;
} }
@ -45,59 +45,61 @@ body {
*/ */
#mcmap { #mcmap {
width: 100%; width: 100%;
height: 100% height: 100%
} }
.dynmap { .dynmap {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
} }
.dynmap > .map { .dynmap > .map {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #000; background: #000;
} }
/* Map Controls */ /* Map Controls */
.gmnoprint{ .gmnoprint{
margin-top:-75px; margin-top:-75px;
margin-left:-20px margin-left:-20px
} }
/* Google branding */ /* Google branding */
.dynmap > div.map > DIV > DIV:first-child + DIV, .dynmap > div.map > DIV > DIV:first-child + DIV,
.dynmap > div.map > DIV > DIV:first-child + DIV + DIV { .dynmap > div.map > DIV > DIV:first-child + DIV + DIV {
visibility: hidden !important; visibility: hidden !important;
} }
/******************* /*******************
* Alerts * Alerts are pretty.
*/ */
.alertbox { .alertbox {
position: fixed; position: fixed;
width: 50%; width: 50%;
z-index: 999;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
color: #a00; font-size: 16px;
background-color: #fff; font-weight: bold;
margin: auto; color: #fff;
padding: 5px; background: #c00;
border: 1px solid #a00; border-color: #a00;
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.3);
border-radius: 0 0 3px 3px; margin: auto;
padding: 8px;
} }
@ -106,16 +108,35 @@ body {
*/ */
.dynmap .panel ul, .dynmap .panel li { .dynmap .panel ul, .dynmap .panel li {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.maplist li a, .maplist li a,
.playerlist li a { .playerlist li a {
outline: none; outline: none;
text-decoration: none; text-decoration: none;
}
.alertbox,
.largeclock {
background: rgba(0,0,0,0.6);
border-style: solid;
border-width: 0px 1px 1px 1px;
-moz-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-webkit-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-o-box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
-moz-border-radius: 0 0 3px 3px;
-webkit-border-radius: 0 0 3px 3px;
-o-border-radius: 0 0 3px 3px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
border-radius: 0 0 3px 3px;
} }
/******************* /*******************
@ -124,139 +145,221 @@ body {
.dynmap .sidebar { .dynmap .sidebar {
display: block; display: block;
position: absolute; position: absolute;
z-index: 120;
top: 0px; top: 0px;
right: 0px; right: 0px;
width: 250px; width: 200px;
height: 100%; height: 100%;
background: rgb(0,0,0); /* FU IE */ background: rgb(0,0,0); /* FU IE */
background: rgba(0,0,0,0.6); background: rgba(0,0,0,0.6);
color: #fff; color: #fff;
border-left: 1px solid rgba(0,0,0,0.5); border-left: 1px solid rgba(0,0,0,0.5);
margin-right: -253px; margin-right: -203px;
/*margin-right: 251px;*/
-moz-transition: all 0.6s ease-in-out; -moz-transition: all 0.6s ease-in-out;
-webkit-transition: all 0.6s ease-in-out; -webkit-transition: all 0.6s ease-in-out;
-o-transition: all 0.6s ease-in-out; -o-transition: all 0.6s ease-in-out;
transition: all 0.6s ease-in-out;
transition: all 0.6s ease-in-out;
} }
.dynmap .hitbar { .dynmap .hitbar {
display: block; display: block;
position: fixed; position: fixed;
z-index: 110;
right: 0px; right: 0px;
top: 0px; top: 0px;
height: 100%; height: 100%;
width: 16px; width: 16px;
text-align: center; text-align: center;
background: url(sidebar_hint.png) rgb(0,0,0); background: url(sidebar_hint.png) rgb(0,0,0);
background: url(sidebar_hint.png) rgba(0,0,0,0.6); background: url(sidebar_hint.png) rgba(0,0,0,0.6);
background-repeat: no-repeat; background-repeat: no-repeat;
background-position:center; background-position:center;
border: 1px solid rgba(0,0,0,0.5); border: 1px solid rgba(0,0,0,0.5);
-moz-transition: all 0.6s ease-in-out; -moz-transition: all 0.6s ease-in-out;
-webkit-transition: all 0.6s ease-in-out; -webkit-transition: all 0.6s ease-in-out;
-o-transition: all 0.6s ease-in-out; -o-transition: all 0.6s ease-in-out;
transition: all 0.6s ease-in-out;
}
.dynmap .sidebar .panel > .pin { transition: all 0.6s ease-in-out;
position: absolute;
right: 4px;
top: 4px;
width: 16px;
height: 16px;
background-image: url(window_unpinned.png);
}
.dynmap .sidebar.pinned .panel > .pin {
background-image: url(window_pinned.png);
} }
/* magic and metrics */ /* magic and metrics */
.dynmap .sidebar:hover, .dynmap .sidebar:hover,
.dynmap .sidebar.pinned { .dynmap .sidebar.pinned {
margin-right: 0px; margin-right: 0px;
} }
.dynmap .sidebar < .hitbar:hover { .dynmap .sidebar < .hitbar:hover {
margin-right: 0px; margin-right: 0px;
} }
.dynmap .sidebar:hover .hitbar, .dynmap .sidebar:hover .hitbar,
.dynmap .sidebar.pinned .hitbar { .dynmap .sidebar.pinned .hitbar {
right: -120px; right: -120px;
} }
/* pinning */
.dynmap .sidebar .panel > .pin {
position: absolute;
right: 8px;
top: 7px;
width: 16px;
height: 16px;
background-image: url(window_close.png);
}
.dynmap .sidebar .panel > .pin:hover {
background-image: url(window_pinned.png);
}
.dynmap .sidebar.pinned .panel > .pin:hover {
background-image: url(window_close.png);
}
.dynmap .sidebar.pinned .panel > .pin {
background-image: url(window_pinned.png);
}
/*******************
* Sidebar clock style
*/
/*.dynmap .panel .clock {
display: inline-block;
height: 16px;
font-weight: bold;
background-repeat: no-repeat;
padding-left: 20px;
margin-left: 8px;
}*/
.clock {
position:relative;
bottom:12px;
text-align:center;
}
/*.clock.night {
background-image: url(clock_night.png);
color: #dff;
}
.clock.day {
background-image: url(clock_day.png);
color: #fd3;
}*/
.clock.night, clock.day {
-moz-transition: all 8s 8s linear;
-webkit-transition: all 8s 8s linear;
-o-transition: all 8s 8s linear;
transition: all 8s 8s linear;
}
/*******************
* Large clock style
*/
.largeclock {
position: absolute;
top: 0;
left: 0;
right: 0;
border-color: rgba(0,0,0,0.5);
width: 150px;
height: 60px;
background: rgba(0,0,0,0.6);
margin: auto;
}
.timeofday {
background-repeat: no-repeat;
}
.timeofday.sun {
background-image: url(sun.png);
}
.timeofday.moon {
background-image: url(moon.png);
}
/******************* /*******************
* map list-specific styling * map list-specific styling
*/ */
.dynmap .panel .world { .dynmap .panel .world {
display: block; display: block;
clear: both; clear: both;
width: 100%; width: 100%;
line-height: 18px; line-height: 18px;
margin: 0 0 30px 0; margin: 0 0 30px 0;
border-bottom: 1px solid rgba(128,128,128,0.3); border-bottom: 1px solid rgba(128,128,128,0.3);
} }
.dynmap .maplist .map { .dynmap .maplist .map {
display: block; display: block;
float: left; float: left;
height: 18px; height: 18px;
width: 18px; width: 18px;
padding: 2px; padding: 2px;
margin: 5px 2px; margin: 5px 2px;
border-radius: 3px; border-radius: 3px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
background: rgba(32,32,32,0.6); background: rgba(32,32,32,0.6);
border: 1px solid rgba(64,64,64,0.6); border: 1px solid rgba(64,64,64,0.6);
} }
.dynmap .maplist .map:hover { .dynmap .maplist .map:hover {
background: rgba(64,64,64,0.6); background: rgba(64,64,64,0.6);
border: 1px solid rgba(128,128,128,0.6); border: 1px solid rgba(128,128,128,0.6);
} }
.dynmap .maplist .map.selected { .dynmap .maplist .map.selected {
background: rgba(128,128,128,0.5); background: rgba(128,128,128,0.5);
border: 1px solid rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.5);
} }
.dynmap .maplist .map > a { .dynmap .maplist .map > a {
display: block; display: block;
text-indent: -99999px; text-indent: -99999px;
outline: none; outline: none;
} }
.dynmap .maplist .map > a { .dynmap .maplist .map > a {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position:center; background-position: center;
} }
/******************* /*******************
@ -265,54 +368,93 @@ body {
.dynmap .playerlist .player { .dynmap .playerlist .player {
display: inline-block; display: inline-block;
float: left; float: left;
width: 100%; width: 100%;
padding: 4px 0; padding: 4px 0;
border: 3px solid transparent; border: 3px solid transparent;
} }
.dynmap .playerlist .player:hover { .dynmap .playerlist .player:hover {
background: rgba(64,64,64,0.6); background: rgba(64,64,64,0.6);
} }
.dynmap .playerlist .player a { .dynmap .playerlist .player a {
color: #fff; color: #fff;
} }
/* may need to tweak this for canvas */ .dynmap .playerlist .playerIcon img {
width: 16px;
height: 16px;
}
.dynmap .playerlist .playerIcon > * { .dynmap .playerlist .playerIcon > * {
vertical-align: middle; vertical-align: middle;
border: none; border: none;
} }
.dynmap .playerlist .playerIcon { .dynmap .playerlist .playerIcon {
width: 16px; width: 16px;
height: 16px; height: 16px;
margin: 0px 7px; margin: 0px 7px;
display: block; display: block;
float: left; float: left;
} }
.dynmap .playerlist .player.following { .dynmap .playerlist .player.following {
background: rgba(128,128,128,0.5); background: rgba(128,128,128,0.5);
border: 1px solid rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.5);
border-radius: 3px;
padding: 6px 2px; border-radius: 3px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
padding: 6px 2px;
} }
.dynmap .playerlist .player:hover .playericon { .dynmap .playerlist .player:hover .playericon {
background: url(player_follow_off.png) no-repeat; background: url(player_follow_off.png) no-repeat;
} }
.dynmap .playerlist .player.following .playericon { .dynmap .playerlist .player.following .playericon {
background: url(player_follow_on.gif) no-repeat; background: url(player_follow_on.gif) no-repeat;
} }
.dynmap .playerlist .player.following .playericon > *, .dynmap .playerlist .player.following .playericon > *,
.dynmap .playerlist .player:hover .playericon > * { .dynmap .playerlist .player:hover .playericon > * {
visibility: hidden; visibility: hidden;
}
/*******************
* players on the map
*/
.dynmap .playerName {
color: #fff;
background: rgba(0,0,0,0.6);
padding: 2px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/*******************
* Compass
*/
.compass {
display: block;
position: absolute;
z-index: 10;
height: 830px;
width: 84px;
top: 10px;
right: 32px;
background-repeat: no-repeat;
background-image: url(compass.png);
} }

View file

@ -174,6 +174,19 @@ DynMap.prototype = {
}); });
}); });
// The clock
var largeclock = $('<div/>')
.addClass('largeclock')
.appendTo(container);
var clock = me.clock = clocks['timeofday'](
$('<div/>')
.appendTo(largeclock)
);
var clockdigital = me.clockdigital = clocks['digital'](
$('<div/>')
.appendTo(largeclock)
);
// The Player List // The Player List
var playerlist; var playerlist;
$('<fieldset/>') $('<fieldset/>')
@ -181,19 +194,12 @@ DynMap.prototype = {
.append(me.playerlist = playerlist = $('<ul/>').addClass('playerlist')) .append(me.playerlist = playerlist = $('<ul/>').addClass('playerlist'))
.appendTo(panel); .appendTo(panel);
// The clock
var clock = me.clock = clocks[me.options.clock](
$('<div/>')
.appendTo(panel)
);
// The Compass // The Compass
var compass = me.compass = new MinecraftCompass( var compass = me.compass = new MinecraftCompass(
$('<div/>') $('<div/>')
.addClass('compass') .addClass('compass')
.appendTo(panel) .appendTo(container)
); );
compass.initialize();
// The chat // The chat
if (me.options.showchat == 'modal') { if (me.options.showchat == 'modal') {
@ -270,6 +276,7 @@ DynMap.prototype = {
me.lasttimestamp = update.timestamp; me.lasttimestamp = update.timestamp;
me.clock.setTime(update.servertime); me.clock.setTime(update.servertime);
me.clockdigital.setTime(update.servertime);
var typeVisibleMap = {}; var typeVisibleMap = {};
var newmarkers = {}; var newmarkers = {};
@ -300,7 +307,7 @@ DynMap.prototype = {
webchat: function() { webchat: function() {
if (!me.options.showchat) if (!me.options.showchat)
return; return;
me.onPlayerChat('[WEB] ' + update.playerName, update.message); me.onPlayerChat('[WEB]' + update.playerName, update.message);
} }
}, function(type) { }, function(type) {
console.log('Unknown type ', value, '!'); console.log('Unknown type ', value, '!');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Before After
Before After