summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/js/lib/views/stream/hootstream.js11
-rw-r--r--views/partials/hootstream.ejs4
2 files changed, 11 insertions, 4 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>`
: "",
diff --git a/views/partials/hootstream.ejs b/views/partials/hootstream.ejs
index 86282aa..4a94aa2 100644
--- a/views/partials/hootstream.ejs
+++ b/views/partials/hootstream.ejs
@@ -16,14 +16,14 @@
<a class="avatarLink" href="/stream/profile/{{username}}" style="opacity: {{age_opacity}}">
<div class="avatar" title="{{username}}" style="background-image:url({{image}});opacity:{{showAvatar}};"></div>
</a>
- <div class="text" style="opacity: {{age_opacity}}">{{hoot}}</div>
+ <div class="text" style="opacity: {{hoot_opacity}}">{{hoot}}</div>
<div class="age date" style="opacity: {{age_opacity}}">{{age}}</div>
</div>
</script>
<script class="threadTemplate" type="text/html">
<div class="{{className}}">
- <a class="userLink" href="/stream/profile/{{username}}" style="opacity: {{age_opacity}}">
+ <a class="userLink" href="/stream/profile/{{username}}" style="opacity: {{thread_opacity}}">
{{username}}
</a>
<a class="avatarLink" href="/stream/profile/{{username}}" style="opacity: {{age_opacity}}">