diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | public/assets/css/hootstream.css | 3 | ||||
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 2 | ||||
| -rw-r--r-- | public/assets/js/util/format.js | 9 | ||||
| -rw-r--r-- | views/partials/hootstream.ejs | 4 |
5 files changed, 17 insertions, 3 deletions
@@ -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> |
