From f0638e3e0cc56d0b676ff8b4183cf140ad2ba3b2 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Wed, 26 Oct 2022 19:55:25 +0200 Subject: fix counts --- public/assets/js/lib/views/stream/hootstream.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'public/assets/js/lib/views/stream/hootstream.js') 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 || "
" + tidy_urls(comment, true) + "
", 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 ["
Missing thread!
"]; } 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 [ "
", this.renderHoot({ template: this.threadTemplate, hoot: `${thread.title}`, + thread_opacity, keyword_link: thread.keyword ? `${thread.keyword}` : "", -- cgit v1.2.3-70-g09d2