Compare commits
2 Commits
55d4469401
...
c3e818f5bd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3e818f5bd
|
||
|
|
1e1e9e265a
|
@@ -39,8 +39,5 @@ $shadow: rgba(0,0,0,.6);
|
|||||||
$shadow_dark: rgba(0,0,0,.2);
|
$shadow_dark: rgba(0,0,0,.2);
|
||||||
|
|
||||||
//fonts
|
//fonts
|
||||||
$font_0: Helvetica Neue;
|
$font_stack: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
$font_1: Helvetica;
|
$font_icon: fontello;
|
||||||
$font_2: Arial;
|
|
||||||
$font_3: sans-serif;
|
|
||||||
$font_4: fontello;
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ body {
|
|||||||
|
|
||||||
background-color: var(--bg_color);
|
background-color: var(--bg_color);
|
||||||
color: var(--fg_color);
|
color: var(--fg_color);
|
||||||
font-family: $font_0, $font_1, $font_2, $font_3;
|
font-family: $font_stack;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ input::-webkit-datetime-edit-year-field:focus {
|
|||||||
left: 2px;
|
left: 2px;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-family: $font_4;
|
font-family: $font_icon;
|
||||||
content: '\e803';
|
content: '\e803';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tweet-content {
|
.tweet-content {
|
||||||
font-family: $font_3;
|
font-family: $font_stack;
|
||||||
line-height: 1.3em;
|
line-height: 1.3em;
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
display: inline;
|
display: inline;
|
||||||
@@ -201,6 +201,10 @@
|
|||||||
.tweet-stats {
|
.tweet-stats {
|
||||||
margin-bottom: -3px;
|
margin-bottom: -3px;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
|
|
||||||
|
a {
|
||||||
|
pointer-events: all;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tweet-stat {
|
.tweet-stat {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import strutils, sequtils, strformat, options, algorithm
|
import strutils, sequtils, strformat, options, algorithm, uri
|
||||||
import karax/[karaxdsl, vdom, vstyles]
|
import karax/[karaxdsl, vdom, vstyles]
|
||||||
from jester import Request
|
from jester import Request
|
||||||
|
|
||||||
@@ -178,11 +178,11 @@ func formatStat(stat: int): string =
|
|||||||
if stat > 0: insertSep($stat, ',')
|
if stat > 0: insertSep($stat, ',')
|
||||||
else: ""
|
else: ""
|
||||||
|
|
||||||
proc renderStats(stats: TweetStats; views: string): VNode =
|
proc renderStats(tweet_id: int64; stats: TweetStats; views: string): VNode =
|
||||||
buildHtml(tdiv(class="tweet-stats")):
|
buildHtml(tdiv(class="tweet-stats")):
|
||||||
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
span(class="tweet-stat"): icon "comment", formatStat(stats.replies)
|
||||||
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
span(class="tweet-stat"): icon "retweet", formatStat(stats.retweets)
|
||||||
span(class="tweet-stat"): icon "quote", formatStat(stats.quotes)
|
a(class="tweet-stat", href=("/search?q=" & encodeUrl(&"-from:quotedreplies url:{tweet_id}") & "&e-nativeretweets=on")): icon "quote", formatStat(stats.quotes)
|
||||||
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
|
span(class="tweet-stat"): icon "heart", formatStat(stats.likes)
|
||||||
if views.len > 0:
|
if views.len > 0:
|
||||||
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
span(class="tweet-stat"): icon "play", insertSep(views, ',')
|
||||||
@@ -343,7 +343,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
|
|||||||
renderMediaTags(tweet.mediaTags)
|
renderMediaTags(tweet.mediaTags)
|
||||||
|
|
||||||
if not prefs.hideTweetStats:
|
if not prefs.hideTweetStats:
|
||||||
renderStats(tweet.stats, views)
|
renderStats(tweet.id, tweet.stats, views)
|
||||||
|
|
||||||
if showThread:
|
if showThread:
|
||||||
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
a(class="show-thread", href=("/i/status/" & $tweet.threadId)):
|
||||||
|
|||||||
Reference in New Issue
Block a user