Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
voc0der committed Jan 24, 2025
2 parents 0b8a128 + 8fd28ae commit a7db4f5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 41 deletions.
11 changes: 5 additions & 6 deletions src/mixins/header.pug
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
mixin header(user)
- var viewQuery = 'view=' + (query && query.view ? query.view : 'compact')
- var sortQuery = 'sort=' + (query ? (query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot') : 'hot')
div.header
div.header-item
a(href=`/?${sortQuery}&${viewQuery}`) home
a(href=`/?${viewQuery}`) home
div.header-item
a(href=`/r/all?${sortQuery}&${viewQuery}`) all
a(href=`/r/all?${viewQuery}`) all
div.header-item
a(href=`/search?${sortQuery}&${viewQuery}`) search
a(href=`/search?${viewQuery}`) search
div.header-item
a(href=`/subs?${sortQuery}&${viewQuery}`) subs
a(href=`/subs?${viewQuery}`) subs
if user
div.header-item
a(href=`/dashboard?${sortQuery}&${viewQuery}`) #{user.username}
a(href=`/dashboard${viewQuery}`) #{user.username}
| 
a(href='/logout') (logout)
else
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mixin post(p, currentUrl)
|  · 
| #{timeDifference(Date.now(), p.created * 1000)}
|  · 
a(href=`/r/${p.subreddit}`) r/#{p.subreddit}
a(href=`/r/${p.subreddit}?view=${viewQuery}`) r/#{p.subreddit}
|  · 
a(href=`/comments/${p.id}?from=${from}`) #{fmtnum (p.num_comments)}
if (query.view == "card" && !isPostMedia(p) && p.selftext_html)
Expand Down
41 changes: 9 additions & 32 deletions src/public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
--link-visited-color: #999;
--accent: var(--link-color);
--error-text-color: red;
--border-radius-card: 2vmin;
--border-radius-media: 1.5vmin;
--border-radius-preview: 1vmin;
--border-radius-card: 0.5vmin;
--border-radius-media: 0.5vmin;
--border-radius-preview: 0.3vmin;

font-family: Inter, sans-serif;
font-feature-settings: 'ss01' 1, 'kern' 1, 'liga' 1, 'cv05' 1, 'dlig' 1, 'ss01' 1, 'ss07' 1, 'ss08' 1;
Expand Down Expand Up @@ -203,7 +203,6 @@ nav {

.image-viewer {
position: relative;
margin: 0.9rem;
}

.image-viewer > img {
Expand Down Expand Up @@ -306,24 +305,12 @@ summary::before {
max-height: 70vh;
}

.image-viewer.main-content a {
margin: unset;
}

.image-viewer a:has(img) {
font-size: 0rem;
padding: unset;
margin: unset;
}

.media-preview a,
.image-viewer a {
font-size: 1.5rem;
text-decoration: none;
padding: unset;
margin: 1rem;
}

.media-maximized {
max-width: 100vw;
max-height: 100vh;
Expand Down Expand Up @@ -363,9 +350,9 @@ form {

@media (min-width: 768px) {
:root {
--border-radius-card: 1vmin;
--border-radius-media: 1vmin;
--border-radius-preview: 0.5vmin;
--border-radius-card: 0.5vmin;
--border-radius-media: 0.5vmin;
--border-radius-preview: 0.3vmin;
}
.post, .comments-container, .hero, .header, .footer {
flex: 1 1 90%;
Expand All @@ -380,12 +367,7 @@ form {
.image-viewer img,
.image-viewer video
{
max-height: 45vh;
}
.image-viewer a {
font-size: 1rem;
margin: 0.7rem;
padding: initial;
max-height: 50vh;
}
.post-text.card {
max-width: 100%;
Expand Down Expand Up @@ -429,17 +411,12 @@ form {
.image-viewer img,
.image-viewer video
{
max-height: 35vh;
max-height: 45vh;
}
.media-preview a {
font-size: 2rem;
padding: 2rem;
}
.image-viewer a {
font-size: 1rem;
margin: 1rem;
padding: initial;
}
.self-text.card {
-webkit-line-clamp: 4;
line-clamp: 4;
Expand Down Expand Up @@ -824,7 +801,7 @@ select {

.sticky {
background-color: var(--sticky-color);
border-radius: 2px;
border-radius: var(--border-radius-card);
border: 4px solid var(--sticky-color);
}

Expand Down
7 changes: 6 additions & 1 deletion src/utils.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
- var fmtnum = (n)=>n>=1000?(n/1000).toFixed(1)+'k':n;
-
function fmtnum(n) {
return n >= 1e6 ? (n / 1e6).toFixed(1) + 'mil' :
n >= 1e3 ? (n / 1e3).toFixed(1) + 'k' :
n;
}
- var fmttxt = (n,t)=>`${t}${n==1?'':'s'}`
- var stripPrefix = (s, p) => s.startsWith(p) ? s.slice(p.length) : s;
-
Expand Down
2 changes: 1 addition & 1 deletion src/views/comments.pug
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ html
video(controls data-dashjs-player src=`${url}`).post-media
else if isPostLink(post)
a(href=post.url)
| #{post.domain}
| #{post.url}

if post.selftext_html
div.self-text
Expand Down
11 changes: 11 additions & 0 deletions src/views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ html
button(onclick=`toggleSub('${subreddit}')` id=`thinger_${subreddit}`) subscribe
if about && !isMulti
div.about #{about.public_description}
else
div.about
| consider donating to 
a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
|, author of lurker
if about && !isMulti
div.info-container
p
| #{fmtnum(about.accounts_active)} active
|  · 
| #{fmtnum(about.subscribers)} subscribers
hr
details.sort-details
summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}
Expand Down

0 comments on commit a7db4f5

Please sign in to comment.