Fix display for reactions plugin

This commit is contained in:
lowlighter
2021-03-10 02:33:41 +01:00
parent 7976c7dc11
commit 86a6fa9090
2 changed files with 11 additions and 9 deletions

View File

@@ -45,7 +45,7 @@
list[key] = {value, score:value/(display === "relative" ? max : reactions.length)}
//Results
return {list, comments:comments.length, details, days}
return {list, comments:comments.length, details, days, twemoji:q["config.twemoji"]}
}
//Handle errors
catch (error) {

View File

@@ -13,12 +13,14 @@
</div>
<% } else { %>
<div class="row fill-width">
<% if (plugins.reactions.twemoji) { %>
<style>
.gauge.info .twemoji {
transform: scale(0.5);
transform-origin: center;
}
</style>
<% } %>
<section class="categories">
<% for (const [reaction, icon] of Object.entries({HEART:"❤️", THUMBS_UP:"👍", THUMBS_DOWN:"👎", LAUGH:"😄", CONFUSED:"😕", EYES:"👀", ROCKET:"🚀", HOORAY:"🎉"})) { const {score = 0, value:count = 0} = plugins.reactions.list[reaction] ?? {} %>
<div class="categorie column">
@@ -26,13 +28,13 @@
<circle class="gauge-base" r="53" cx="60" cy="60"></circle>
<% if (score > 0) { %>
<circle class="gauge-arc" transform="rotate(-90 60 60)" r="53" cx="60" cy="60" stroke-dasharray="<%= score * 329 %> 329"></circle>
<% if (true) { %>
<% if (plugins.reactions.twemoji) { %>
<%= icon %>
<% } else { %>
<text x="60" y="60" dominant-baseline="central"><%= icon %></text>
<% } %>
<% } else { %>
<% if (true) { %>
<% if (plugins.reactions.twemoji) { %>
<%= icon %>
<% } else { %>
<text x="60" y="60" dominant-baseline="central"><%= icon %></text>