diff options
Diffstat (limited to 'public/assets/js/lib/views/stream/hootstream.js')
| -rw-r--r-- | public/assets/js/lib/views/stream/hootstream.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index db646f1..ad1fbc9 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -102,6 +102,7 @@ var HootStream = View.extend({ ...options }) { // console.log(hoot, comment); + const age_opacity = get_age_opacity(date); return this.render(template || this.hootTemplate, { username, className: className ? `hoot ${className}` : "hoot", @@ -110,7 +111,8 @@ var HootStream = View.extend({ hoot: hoot || "<div class='hootText'>" + tidy_urls(comment, true) + "</div>", age: get_age(date), - age_opacity: className === "first_post" ? 1.0 : get_age_opacity(date), + hoot_opacity: className === "first_post" ? 1.0 : age_opacity, + age_opacity: age_opacity, ...options, }); }, @@ -130,18 +132,23 @@ var HootStream = View.extend({ return ["<div>Missing thread!</div>"]; } thread = thread.shift(); - console.log(query, thread.id); const isViewingKeyword = query.keyword === thread.keyword; const isViewingThread = query.thread === thread.id; // console.log(thread, comments, files, images); const postedToday = +new Date() / 1000 - thread.lastmodified < 86400; const age_opacity = get_age_opacity(thread.lastmodified); + const thread_opacity = clamp( + get_age_opacity(thread.lastmodified) + 0.2, + 0.0, + 1.0 + ); console.log(thread); return [ "<div class='divider dark'></div>", this.renderHoot({ template: this.threadTemplate, hoot: `<a class="threadLink" href="/stream/thread/${thread.id}">${thread.title}</a>`, + thread_opacity, keyword_link: thread.keyword ? `<a class="keywordLink" href="/stream/keyword/${thread.keyword}">${thread.keyword}</a>` : "", |
