summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-26 16:01:28 +0200
committerjulian laplace <julescarbon@gmail.com>2022-10-26 16:01:28 +0200
commit3de2a5872fd0481568e918a1ea798b3f75ace610 (patch)
tree91d2e08c3f07bc0f866cfb22deecbc07afc78057
parent8fe5a1cf652fd4bd0b737bd18605a8d4c4028407 (diff)
update keyword hover colors
-rw-r--r--.gitignore2
-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
-rw-r--r--views/partials/hootstream.ejs4
5 files changed, 17 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 66152c2..60b6413 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,6 @@ uploads
npm-debug.log
app.min.js
app.min.js.map
+renew-i-asdf-us-cert
+bucky/search/pepper_search_experiments/
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);
diff --git a/views/partials/hootstream.ejs b/views/partials/hootstream.ejs
index dfc1ee6..c96291e 100644
--- a/views/partials/hootstream.ejs
+++ b/views/partials/hootstream.ejs
@@ -31,8 +31,8 @@
</a>
<div class="text" style="opacity: {{age_opacity}}">{{hoot}}</div>
<div class="keyword">{{keyword_link}}</div>
- <div class="commentCount date" style="opacity: {{comment_opacity}}">{{comment_count}}</div>
- <div class="fileCount date" style="opacity: {{file_opacity}}">{{file_count}}</div>
+ <div class="commentCount" style="opacity: {{comment_opacity}}">{{comment_count}}</div>
+ <div class="fileCount" style="opacity: {{file_opacity}}">{{file_count}}</div>
<div class="age date" style="opacity: {{age_opacity}}">{{age}}</div>
</div>
</script>