First iteration of weather icons
This commit is contained in:
parent
8aa96b5c73
commit
49828683bd
6 changed files with 55 additions and 0 deletions
|
|
@ -107,6 +107,7 @@ web:
|
||||||
#- type: digitalclock
|
#- type: digitalclock
|
||||||
- type: timeofdayclock
|
- type: timeofdayclock
|
||||||
showdigitalclock: true
|
showdigitalclock: true
|
||||||
|
#showweather: true
|
||||||
#- type: regions
|
#- type: regions
|
||||||
# name: WorldGuard
|
# name: WorldGuard
|
||||||
# useworldpath: true
|
# useworldpath: true
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,39 @@
|
||||||
bottom: 16px;
|
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
|
* 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);
|
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) {
|
$(dynmap).bind('worldupdated', function(event, update) {
|
||||||
var sunangle;
|
var sunangle;
|
||||||
var time = update.servertime;
|
var time = update.servertime;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue