diff options
| -rw-r--r-- | public/assets/js/lib/views/keywords/keywords.js | 2 | ||||
| -rw-r--r-- | public/assets/js/util/format.js | 9 | ||||
| -rw-r--r-- | views/pages/keywords.ejs | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/keywords/keywords.js b/public/assets/js/lib/views/keywords/keywords.js index 88acffc..777bebf 100644 --- a/public/assets/js/lib/views/keywords/keywords.js +++ b/public/assets/js/lib/views/keywords/keywords.js @@ -62,6 +62,8 @@ var KeywordsView = View.extend({ .replace(/{{time}}/g, datetime[1]) .replace(/{{date_class}}/g, carbon_date(thread.lastmodified)) .replace(/{{age_opacity}}/g, get_age_opacity(thread.lastmodified)) + .replace(/{{views_opacity}}/g, get_views_opacity(viewed)) + .replace(/{{thread_opacity}}/g, get_size_opacity(threadCountNum)) .replace(/{{views}}/g, views[1]) .replace(/{{threadcount}}/, threadCount[1]) .replace(/{{threadcount_class}}/, threadCount[0]) diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 422a4c6..41d652a 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -286,6 +286,15 @@ const size_scale = [ function get_size_opacity(n) { return get_scale_opacity(n, size_scale); } +const views_scale = [ + [0, 0.5], + [100, 0.8], + [1000, 0.9], + [10000, 1.0], +]; +function get_views_opacity(n) { + return get_scale_opacity(n, views_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 diff --git a/views/pages/keywords.ejs b/views/pages/keywords.ejs index 28bdb21..495ea66 100644 --- a/views/pages/keywords.ejs +++ b/views/pages/keywords.ejs @@ -20,13 +20,13 @@ <div class='dot'> · </div> - <div class="date" style="opacity: {{age_opacity}}"> + <div class="date" style="opacity:{{age_opacity}}"> {{date}} <small>{{time}}</small> </div> - <div class="views {{views_class}}"> + <div class="views" style="opacity:{{views_opacity}}"> {{views}} </div> - <div class="threadcount {{threadcount_class}}"> + <div class="threadcount" style="opacity:{{thread_opacity}}"> {{threadcount}} </div> <div class="{{color}} title"> |
