From ad7da047dac822af04074585a82cfbb79b188e52 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sun, 14 Mar 2021 13:01:24 +0000 Subject: [PATCH] dont show broken image for deleted flag, fallback to ? flag. should they just be completely be deleted from db? because they can be added back later, etc. hmmm... --- gulp/res/css/style.css | 16 +++++++++++++++- views/mixins/post.pug | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 23f92703..31573e75 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -1529,7 +1529,7 @@ row.wrap.sb .col { } -.flag { +.flag, .customflag::before { display: inline-block; width: 16px; height: 11px; @@ -1540,6 +1540,20 @@ row.wrap.sb .col { -ms-interpolation-mode: nearest-neighbor; } +.customflag { + display: inline-block; + width: 16px; + height: 11px; + image-rendering: crisp-edges; + image-rendering: pixelated; + image-rendering: -webkit-optimize-contrast; + -ms-interpolation-mode: nearest-neighbor; +} +.customflag:before { + content: ' '; + background-position:-48px -165px; +} + .flag.flag-xx { background-position:-48px -165px; } diff --git a/views/mixins/post.pug b/views/mixins/post.pug index 8310eb3b..aa88834d 100644 --- a/views/mixins/post.pug +++ b/views/mixins/post.pug @@ -33,7 +33,7 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false, overboar | if post.country && post.country.code if post.country.custom === true - img.flag(src=`/flag/${post.board}/${post.country.src}` title=post.country.name alt=post.country.name) + img.customflag(src=`/flag/${post.board}/${post.country.src}` title=post.country.name alt=' ') | else span(class=`flag flag-${post.country.code.toLowerCase()}` title=post.country.name alt=post.country.name)