Make tweets clickable

Fixes #6
This commit is contained in:
Zed 2019-09-19 03:19:06 +02:00
parent e663b04761
commit 10bcf99205
8 changed files with 41 additions and 9 deletions

View file

@ -123,4 +123,5 @@
min-width: 0; min-width: 0;
padding: .75em; padding: .75em;
display: flex; display: flex;
position: relative;
} }

View file

@ -11,11 +11,15 @@
flex: 1; flex: 1;
min-width: 0; min-width: 0;
margin-left: 58px; margin-left: 58px;
pointer-events: none;
z-index: 1;
} }
.tweet-content { .tweet-content {
font-family: $font_3; font-family: $font_3;
line-height: 1.4em; line-height: 1.4em;
pointer-events: all;
display: inline;
} }
.tweet-header { .tweet-header {
@ -28,6 +32,7 @@
display: inline-block; display: inline-block;
word-break: break-all; word-break: break-all;
max-width: 100%; max-width: 100%;
pointer-events: all;
} }
} }
@ -80,6 +85,7 @@
.replying-to { .replying-to {
color: $fg_dark; color: $fg_dark;
margin: -2px 0 4px; margin: -2px 0 4px;
pointer-events: all;
} }
.retweet, .pinned, .tweet-stats { .retweet, .pinned, .tweet-stats {
@ -122,3 +128,15 @@
border-radius: 10px; border-radius: 10px;
background-color: $bg_color; background-color: $bg_color;
} }
.tweet-link {
height: 100%;
width: 100%;
left: 0;
top: 0;
position: absolute;
&:hover {
background-color: #1a1a1a;
}
}

View file

@ -3,6 +3,7 @@
.card { .card {
margin: 5px 0; margin: 5px 0;
pointer-events: all;
} }
.card-container { .card-container {

View file

@ -9,6 +9,7 @@
flex-grow: 1; flex-grow: 1;
max-height: 379.5px; max-height: 379.5px;
max-width: 533px; max-width: 533px;
pointer-events: all;
.still-image { .still-image {
width: 100%; width: 100%;
@ -27,6 +28,7 @@
flex-flow: column; flex-flow: column;
background-color: $bg_color; background-color: $bg_color;
align-items: center; align-items: center;
pointer-events: all;
.image-attachment { .image-attachment {
width: 100%; width: 100%;

View file

@ -24,14 +24,17 @@
margin-right: 6px; margin-right: 6px;
min-width: 30px; min-width: 30px;
text-align: right; text-align: right;
pointer-events: all;
} }
.poll-choice-option { .poll-choice-option {
position: relative; position: relative;
pointer-events: all;
} }
.poll-info { .poll-info {
color: $grey; color: $grey;
pointer-events: all;
} }
.leader .poll-choice-bar { .leader .poll-choice-bar {

View file

@ -8,6 +8,7 @@
overflow: auto; overflow: auto;
padding: 6px; padding: 6px;
position: relative; position: relative;
pointer-events: all;
&:hover { &:hover {
border-color: $grey; border-color: $grey;
@ -28,6 +29,9 @@
left: 0; left: 0;
top: 0; top: 0;
position: absolute; position: absolute;
}
.quote .quote-link {
z-index: 1; z-index: 1;
} }

View file

@ -20,7 +20,8 @@
} }
.thread-line { .thread-line {
.timeline-item::before { .timeline-item::before,
&.timeline-item::before {
background: $accent_dark; background: $accent_dark;
content: ''; content: '';
position: relative; position: relative;
@ -31,6 +32,8 @@
margin-left: -3px; margin-left: -3px;
margin-bottom: 37px; margin-bottom: 37px;
top: 56px; top: 56px;
z-index: 1;
pointer-events: none;
} }
.unavailable::before { .unavailable::before {

View file

@ -1,4 +1,4 @@
import strutils, sequtils import strutils, sequtils, strformat
import karax/[karaxdsl, vdom, vstyles] import karax/[karaxdsl, vdom, vstyles]
import renderutils import renderutils
@ -228,8 +228,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class="";
divClass = "thread-last " & class divClass = "thread-last " & class
if not tweet.available: if not tweet.available:
return buildHtml(tdiv(class=divClass)): return buildHtml(tdiv(class=divClass & "unavailable timeline-item")):
tdiv(class="timeline-item unavailable"):
tdiv(class="unavailable-box"): tdiv(class="unavailable-box"):
if tweet.tombstone.len > 0: if tweet.tombstone.len > 0:
text tweet.tombstone text tweet.tombstone
@ -237,6 +236,7 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class="";
text "This tweet is unavailable" text "This tweet is unavailable"
buildHtml(tdiv(class=("timeline-item " & divClass))): buildHtml(tdiv(class=("timeline-item " & divClass))):
a(class="tweet-link", href=getLink(tweet))
tdiv(class="tweet-body"): tdiv(class="tweet-body"):
var views = "" var views = ""
renderHeader(tweet) renderHeader(tweet)