Skip to content

Commit

Permalink
Tweak styles of rank delta
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwarden committed Nov 11, 2024
1 parent 10cb1c3 commit 62501f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions templates/about-content.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ But the HN ranking is further influenced by moderator actions, user flags, and o


<h2 id="rank-delta">Rank Delta</h2>
<p>The delta between the raw rank and front page rank. An <span class="over-ranked"></span>over-ranked page may have received a boost by HN moderators, while an
<span class="under-ranked"></span>under-ranked page may have received a penalty.
<p>The delta between the raw rank and front page rank. An <span class="over-ranked">over-ranked</span> page may have received a boost by HN moderators, while an
<span class="under-ranked">under-ranked</span> page may have received a penalty.
</p>


Expand Down
2 changes: 1 addition & 1 deletion templates/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var userID {{if .UserID.Valid}} = {{.UserID}} {{end}}
{{if .IsBestPage}}
<a href="https://news.ycombinator.com/best">"Best" Page</a>.
{{end}} Page. The estimated <span class="upvoterate">×upvoteRate</span> <a class="question-mark" href="/about#upvote-rate">(?)</a> {{if .IsHNTopPage}}
and <span style="white-space:nowrap"><span class="over-ranked"></span><span class="under-ranked"></span>rankDelta <a class="question-mark" href="/about#rank-delta">(?)</span></a>
and <span style="white-space:nowrap"><span class="over-ranked"></span><span class="under-ranked"></span>rankDelta <a class="question-mark" href="/about#rank-delta">(?)</span></a>
{{end}} is shown below to each story: click on it to see charts of the story's rank, upvotes, and upvoteRate history.

</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/storyDetails.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{{if (not .Job)}}
<a href="/stats?id={{.ID}}">
<span>
{{if and .IsHNTopPage .OverRanked}}<span title="Over-Ranked" class="delta over-ranked">{{.RankDiffAbs}}</span> {{end}}
{{if and .IsHNTopPage .UnderRanked}}<span title="Under-Ranked" class="delta under-ranked">{{.RankDiffAbs}}</span> {{end}}
{{if and .IsHNTopPage .OverRanked}}<span title="Over-Ranked" class="delta over-ranked">{{.RankDiffAbs}}</span> {{end}}
{{if and .IsHNTopPage .UnderRanked}}<span title="Under-Ranked" class="delta under-ranked">{{.RankDiffAbs}}</span> {{end}}
</span>

<span
Expand Down
12 changes: 11 additions & 1 deletion templates/styles.css.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ a:visited.boost {
.delta {
display: inline-block;
text-align: center;
min-width: 2em;
border-radius: 6px;
padding-left: 1px;
padding-right: 1px;
Expand All @@ -258,12 +257,23 @@ a:visited.over-ranked {
color: darkgreen;
}

.over-ranked::before {
content: '↑'
}


.under-ranked,
a:link.under-ranked,
a:visited.under-ranked {
color: darkred;
}

.under-ranked::before {
content: '↓'
}



.original-age {
text-decoration: line-through;
}
Expand Down

0 comments on commit 62501f1

Please sign in to comment.