mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 05:05:16 +01:00
First iteration of weather icons
This commit is contained in:
parent
7f5d3ab23d
commit
619485212d
@ -107,6 +107,7 @@ web:
|
||||
#- type: digitalclock
|
||||
- type: timeofdayclock
|
||||
showdigitalclock: true
|
||||
#showweather: true
|
||||
#- type: regions
|
||||
# name: WorldGuard
|
||||
# useworldpath: true
|
||||
|
@ -294,6 +294,39 @@
|
||||
bottom: 16px;
|
||||
}
|
||||
|
||||
/*******************
|
||||
* Clock weather style
|
||||
*/
|
||||
|
||||
.weather {
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
right: 5px;
|
||||
width: 25px;
|
||||
height: 23px;
|
||||
display: block;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.weather.sunny {
|
||||
background-image: url(../images/weather_sunny.png);
|
||||
}
|
||||
|
||||
.weather.stormy {
|
||||
background-image: url(../images/weather_stormy.png);
|
||||
}
|
||||
.weather .thunder {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: none;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url(../images/weather_thunder.png);
|
||||
}
|
||||
|
||||
/*******************
|
||||
* map list-specific styling
|
||||
*/
|
||||
|
BIN
web/images/weather_stormy.png
Normal file
BIN
web/images/weather_stormy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
web/images/weather_sunny.png
Normal file
BIN
web/images/weather_sunny.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 905 B |
BIN
web/images/weather_thunder.png
Normal file
BIN
web/images/weather_thunder.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 627 B |
@ -62,6 +62,27 @@ componentconstructors['timeofdayclock'] = function(dynmap, configuration) {
|
||||
setTime(update.servertime);
|
||||
});
|
||||
}
|
||||
if(configuration.showweather) {
|
||||
var weather = $('<div/>')
|
||||
.addClass('weather')
|
||||
.appendTo(element);
|
||||
|
||||
var thunder = $('<div/>')
|
||||
.addClass('thunder')
|
||||
.css('display','none')
|
||||
.appendTo(weather);
|
||||
|
||||
var setWeather = function(hasStorm, isThundering) {
|
||||
weather
|
||||
.addClass(hasStorm ? 'stormy' : 'sunny')
|
||||
.removeClass(hasStorm ? 'sunny' : 'stormy');
|
||||
thunder.css('display',isThundering ? 'block' : 'none');
|
||||
};
|
||||
|
||||
$(dynmap).bind('worldupdated', function(event, update) {
|
||||
setWeather(update.hasStorm, update.isThundering);
|
||||
});
|
||||
}
|
||||
$(dynmap).bind('worldupdated', function(event, update) {
|
||||
var sunangle;
|
||||
var time = update.servertime;
|
||||
|
Loading…
Reference in New Issue
Block a user