From d6b8b386fa06633f8557f2b3353990e425f33dae Mon Sep 17 00:00:00 2001 From: Zed Date: Tue, 25 Jun 2019 00:39:32 +0200 Subject: [PATCH] Show badges on quoted gifs --- public/style.css | 4 +++- src/parserutils.nim | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/style.css b/public/style.css index 93e5423..fba4cc6 100644 --- a/public/style.css +++ b/public/style.css @@ -661,7 +661,7 @@ video { } .quote-badge { - left: 0px; + left: 6px; position: absolute; z-index: 1; align-self: flex-end; @@ -673,4 +673,6 @@ video { border-radius: 4px; color: #fffffff0; padding: 0px 2px; + font-size: 12px; + font-weight: bold; } diff --git a/src/parserutils.nim b/src/parserutils.nim index bb69035..6325ac9 100644 --- a/src/parserutils.nim +++ b/src/parserutils.nim @@ -136,5 +136,9 @@ proc getQuoteMedia*(quote: var Quote; node: XmlNode) = quote.thumb = some(media.selectAttr("img", "src")) let badge = node.querySelector(".AdaptiveMedia-badgeText") + let gifBadge = node.querySelector(".Icon--gifBadge") + if not badge.isNil: quote.badge = some(badge.innerText()) + elif not gifBadge.isNil: + quote.badge = some("GIF")