summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/assets/css/hootstream.css3
-rw-r--r--public/assets/js/lib/views/stream/hootstream.js2
-rw-r--r--public/assets/js/util/format.js9
3 files changed, 13 insertions, 1 deletions
diff --git a/public/assets/css/hootstream.css b/public/assets/css/hootstream.css
index efaa989..597c82f 100644
--- a/public/assets/css/hootstream.css
+++ b/public/assets/css/hootstream.css
@@ -53,6 +53,9 @@
transition: opacity 0.1s;
font-size: 13px;
}
+#hootevents a.keywordLink:not(:hover) {
+ color: #77c;
+}
#hootevents .keywordLink:hover {
text-decoration: none;
opacity: 1;
diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js
index f4e48c4..016c987 100644
--- a/public/assets/js/lib/views/stream/hootstream.js
+++ b/public/assets/js/lib/views/stream/hootstream.js
@@ -109,7 +109,7 @@ var HootStream = View.extend({
file_count: `${files.length || 0} f.`,
file_opacity: age_opacity * get_size_opacity(files.length),
comment_count: `${comments.length || 0} c.`,
- comment_opacity: age_opacity * get_size_opacity(files.length),
+ comment_opacity: age_opacity * get_size_opacity(comments.length),
}),
this.renderFiles(postedToday ? files : files.slice(0, 10)),
...this.renderHoots({ hoots: comments.slice(0, 1), tag: "first_post" }),
diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js
index 7058cea..aac8311 100644
--- a/public/assets/js/util/format.js
+++ b/public/assets/js/util/format.js
@@ -282,9 +282,18 @@ const size_scale = [
function get_size_opacity(n) {
return get_scale_opacity(n, size_scale);
}
+/**
+ * find a value on one axis of an array of points, and return the proportional point
+ * @param {Array} value a value, to be matched on the first column of scale
+ * @param {Array} scale an array of points: (value, target)
+ * @return {Number} a proportional point within the closest target values
+ */
function get_scale_opacity(value, scale) {
for (let i = 1; i < scale.length; i++) {
const [max_value, max_lerp] = scale[i];
+ if (value === max_value) {
+ return max_lerp;
+ }
if (value < max_value) {
const [min_value, min_lerp] = scale[i - 1];
return lerp(norm(value, min_value, max_value), min_lerp, max_lerp);