Skip to content

Commit

Permalink
Replace weather images with emojis. (#2502)
Browse files Browse the repository at this point in the history
* Remove weather images in favor of weather emojis

* fix bad copy pasta of emojis

* rename CSS class to `weather-boost`
  • Loading branch information
fosJoddie authored and sebastienvercammen committed Mar 3, 2018
1 parent 089ba62 commit 3c4d785
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 14 deletions.
Binary file removed static/images/weather/weather_clear_day.png
Binary file not shown.
Binary file removed static/images/weather/weather_clear_night.png
Binary file not shown.
Binary file removed static/images/weather/weather_cloudy.png
Binary file not shown.
Binary file removed static/images/weather/weather_fog.png
Binary file not shown.
Binary file removed static/images/weather/weather_partly_cloudy_day.png
Binary file not shown.
Binary file not shown.
Binary file removed static/images/weather/weather_rain.png
Binary file not shown.
Binary file removed static/images/weather/weather_snow.png
Binary file not shown.
Binary file removed static/images/weather/weather_windy.png
Binary file not shown.
16 changes: 2 additions & 14 deletions static/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,7 @@ const excludedRaritiesList = [
['common', 'uncommon', 'rare', 'very rare', 'ultra rare']
]

const weatherTypes = ['none', 'clear', 'rain', 'partly_cloudy', 'cloudy', 'windy', 'snow', 'fog']

function weatherImage(weatherCondition, timeOfDay) {
var weatherType = weatherTypes[weatherCondition]
if (timeOfDay && ((weatherCondition === 1) || (weatherCondition === 3))) {
return `weather_${weatherType}_${timeOfDay}.png`
} else {
return `weather_${weatherType}.png`
}
}
const weatherEmojis = [ '', '☀️', '☔️', '⛅', '☁️', '💨', '⛄️', '🌁' ]

/*
text place holders:
Expand Down Expand Up @@ -569,17 +560,14 @@ function pokemonLabel(item) {
var cpMultiplier = item['cp_multiplier']
var weatherBoostedCondition = item['weather_boosted_condition']
var weatherDisplay = ''
var currentDate = new Date()
var currentHour = currentDate.getHours()
var timeOfDay = (currentHour >= 6 && currentHour < 19) ? 'day' : 'night'
const showStats = Store.get('showPokemonStats')

$.each(types, function (index, type) {
typesDisplay += getTypeSpan(type)
})

if (weatherBoostedCondition) {
weatherDisplay = `<img src='static/images/weather/${weatherImage(weatherBoostedCondition, timeOfDay)}' style="width: 24px; vertical-align: middle;">`
weatherDisplay = `<span class="pokemon weather-boost">${weatherEmojis[weatherBoostedCondition]}</span>`
}

var details = ''
Expand Down
5 changes: 5 additions & 0 deletions static/sass/layout/_pokemon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
font-size: 11px;
}

&.weather-boost {
font-size: 16px;
vertical-align: middle;
}

&.disappear {
font-size: 14px;
font-weight: 900;
Expand Down

0 comments on commit 3c4d785

Please sign in to comment.