1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-03 08:28:31 +00:00

Fix a few bugs with CSS generation for the new colored badges, and make sure the staff badge is visible.

This commit is contained in:
SirStendec 2016-10-05 23:24:23 -04:00
parent 7e24fa6c0e
commit e5357596b6
3 changed files with 12 additions and 8 deletions

View file

@ -8,6 +8,7 @@ var FFZ = window.FrankerFaceZ,
CSS_BADGES = {
staff: { 1: { color: "#200f33", use_svg: true } },
admin: { 1: { color: "#faaf19", use_svg: true } },
global_mod: { 1: { color: "#0c6f20", use_svg: true } },
broadcaster: { 1: { color: "#e71818", use_svg: true } },
moderator: { 1: { color: "#34ae0a", use_svg: true } },
@ -52,11 +53,6 @@ var FFZ = window.FrankerFaceZ,
};
CSS_BADGES['global-moderator'] = {
1: { color: "#0c6f20", use_svg: true }
};
// --------------------
// Settings
// --------------------
@ -301,9 +297,10 @@ FFZ.prototype.setup_badges = function() {
this.log("Generating CSS for existing Twitch badges.");
for(var badge_id in CSS_BADGES) {
var badge_data = CSS_BADGES[badge_id];
var badge_data = CSS_BADGES[badge_id],
klass = BADGE_KLASSES[badge_id] || badge_id;
for(var version in badge_data)
utils.update_css(s, 'twitch-' + badge_id + '-' + version, utils.cdn_badge_css(badge_id, version, badge_data[version]));
utils.update_css(s, 'twitch-' + badge_id + '-' + version, utils.cdn_badge_css(klass, version, badge_data[version]));
}
this.log("Loading badges.");

View file

@ -921,7 +921,7 @@ module.exports = FFZ.utils = {
'background-image: image-set(url("' + image_1x + '") 1x, url("' + image_2x + '") 2x, url("' + image_4x + '") 4x); }') +
(data.no_color ? '' : '.badge.' + badge_id + '.version-' + version + '.colored {' +
'background: linear-gradient(' + color + ',' + color + ');' +
(is_svg ? '-webkit-mask-size: 18px 18px;mask-size: 18px 18px' : '') +
(is_svg ? '-webkit-mask-size: 18px 18px;mask-size: 18px 18px;' : '') +
'-webkit-mask-image: url("' + image_1x + '");' +
'mask-image: url("' + image_1x + '");}');
}

View file

@ -3287,6 +3287,13 @@ body.ffz-bttv #ffz-feed-tabs .tabs { margin-bottom: 0 }
/* Odd Badges */
.badge.click_url { cursor: pointer }
.ffz-dark .badge.staff.version-1.colored,
.theatre .badge.staff.version-1.colored,
.dark .badge.staff.version-1.colored,
.force-dark .badge.staff.version-1.colored {
background: linear-gradient(#6441a4,#6441a4);
}
/*.badge.premium.version-1:not(.colored) {
background: url("https://cdn.frankerfacez.com/badges/twitch/premium/1/1.png") #009cdc;
background-image: -webkit-image-set(url("https://cdn.frankerfacez.com/badges/twitch/premium/1/1.png") 1x, url("https://cdn.frankerfacez.com/badges/twitch/premium/1/2.png") 2x, url("https://cdn.frankerfacez.com/badges/twitch/premium/1/4.png") 4x);