aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mixins/header.pug11
-rw-r--r--src/mixins/post.pug2
-rw-r--r--src/public/styles.css41
-rw-r--r--src/utils.pug7
-rw-r--r--src/views/comments.pug2
-rw-r--r--src/views/index.pug6
6 files changed, 28 insertions, 41 deletions
diff --git a/src/mixins/header.pug b/src/mixins/header.pug
index 7d56ff5..16ab459 100644
--- a/src/mixins/header.pug
+++ b/src/mixins/header.pug
@@ -1,18 +1,17 @@
1mixin header(user) 1mixin header(user)
2 - var viewQuery = 'view=' + (query && query.view ? query.view : 'compact') 2 - var viewQuery = 'view=' + (query && query.view ? query.view : 'compact')
3 - var sortQuery = 'sort=' + (query ? (query.sort ? query.sort + (query.t ? '&t=' + query.t : '') : 'hot') : 'hot')
4 div.header 3 div.header
5 div.header-item 4 div.header-item
6 a(href=`/?${sortQuery}&${viewQuery}`) home 5 a(href=`/?${viewQuery}`) home
7 div.header-item 6 div.header-item
8 a(href=`/r/all?${sortQuery}&${viewQuery}`) all 7 a(href=`/r/all?${viewQuery}`) all
9 div.header-item 8 div.header-item
10 a(href=`/search?${sortQuery}&${viewQuery}`) search 9 a(href=`/search?${viewQuery}`) search
11 div.header-item 10 div.header-item
12 a(href=`/subs?${sortQuery}&${viewQuery}`) subs 11 a(href=`/subs?${viewQuery}`) subs
13 if user 12 if user
14 div.header-item 13 div.header-item
15 a(href=`/dashboard?${sortQuery}&${viewQuery}`) #{user.username} 14 a(href=`/dashboard${viewQuery}`) #{user.username}
16 |  15 | 
17 a(href='/logout') (logout) 16 a(href='/logout') (logout)
18 else 17 else
diff --git a/src/mixins/post.pug b/src/mixins/post.pug
index f4b6c4f..81b1124 100644
--- a/src/mixins/post.pug
+++ b/src/mixins/post.pug
@@ -25,7 +25,7 @@ mixin post(p, currentUrl)
25 |  ·  25 |  · 
26 | #{timeDifference(Date.now(), p.created * 1000)} 26 | #{timeDifference(Date.now(), p.created * 1000)}
27 |  ·  27 |  · 
28 a(href=`/r/${p.subreddit}`) r/#{p.subreddit} 28 a(href=`/r/${p.subreddit}?view=${viewQuery}`) r/#{p.subreddit}
29 |  ·  29 |  · 
30 a(href=`/comments/${p.id}?from=${from}`) #{fmtnum (p.num_comments)} ↩ 30 a(href=`/comments/${p.id}?from=${from}`) #{fmtnum (p.num_comments)} ↩
31 if (query.view == "card" && !isPostMedia(p) && p.selftext_html) 31 if (query.view == "card" && !isPostMedia(p) && p.selftext_html)
diff --git a/src/public/styles.css b/src/public/styles.css
index 580dbf9..6acf6af 100644
--- a/src/public/styles.css
+++ b/src/public/styles.css
@@ -11,9 +11,9 @@
11 --link-visited-color: #999; 11 --link-visited-color: #999;
12 --accent: var(--link-color); 12 --accent: var(--link-color);
13 --error-text-color: red; 13 --error-text-color: red;
14 --border-radius-card: 2vmin; 14 --border-radius-card: 0.5vmin;
15 --border-radius-media: 1.5vmin; 15 --border-radius-media: 0.5vmin;
16 --border-radius-preview: 1vmin; 16 --border-radius-preview: 0.3vmin;
17 17
18 font-family: Inter, sans-serif; 18 font-family: Inter, sans-serif;
19 font-feature-settings: 'ss01' 1, 'kern' 1, 'liga' 1, 'cv05' 1, 'dlig' 1, 'ss01' 1, 'ss07' 1, 'ss08' 1; 19 font-feature-settings: 'ss01' 1, 'kern' 1, 'liga' 1, 'cv05' 1, 'dlig' 1, 'ss01' 1, 'ss07' 1, 'ss08' 1;
@@ -203,7 +203,6 @@ nav {
203 203
204.image-viewer { 204.image-viewer {
205 position: relative; 205 position: relative;
206 margin: 0.9rem;
207} 206}
208 207
209.image-viewer > img { 208.image-viewer > img {
@@ -306,24 +305,12 @@ summary::before {
306 max-height: 70vh; 305 max-height: 70vh;
307} 306}
308 307
309.image-viewer.main-content a {
310 margin: unset;
311}
312
313.image-viewer a:has(img) { 308.image-viewer a:has(img) {
314 font-size: 0rem; 309 font-size: 0rem;
315 padding: unset; 310 padding: unset;
316 margin: unset; 311 margin: unset;
317} 312}
318 313
319.media-preview a,
320.image-viewer a {
321 font-size: 1.5rem;
322 text-decoration: none;
323 padding: unset;
324 margin: 1rem;
325}
326
327.media-maximized { 314.media-maximized {
328 max-width: 100vw; 315 max-width: 100vw;
329 max-height: 100vh; 316 max-height: 100vh;
@@ -363,9 +350,9 @@ form {
363 350
364@media (min-width: 768px) { 351@media (min-width: 768px) {
365 :root { 352 :root {
366 --border-radius-card: 1vmin; 353 --border-radius-card: 0.5vmin;
367 --border-radius-media: 1vmin; 354 --border-radius-media: 0.5vmin;
368 --border-radius-preview: 0.5vmin; 355 --border-radius-preview: 0.3vmin;
369 } 356 }
370 .post, .comments-container, .hero, .header, .footer { 357 .post, .comments-container, .hero, .header, .footer {
371 flex: 1 1 90%; 358 flex: 1 1 90%;
@@ -380,12 +367,7 @@ form {
380 .image-viewer img, 367 .image-viewer img,
381 .image-viewer video 368 .image-viewer video
382 { 369 {
383 max-height: 45vh; 370 max-height: 50vh;
384 }
385 .image-viewer a {
386 font-size: 1rem;
387 margin: 0.7rem;
388 padding: initial;
389 } 371 }
390 .post-text.card { 372 .post-text.card {
391 max-width: 100%; 373 max-width: 100%;
@@ -429,17 +411,12 @@ form {
429 .image-viewer img, 411 .image-viewer img,
430 .image-viewer video 412 .image-viewer video
431 { 413 {
432 max-height: 35vh; 414 max-height: 45vh;
433 } 415 }
434 .media-preview a { 416 .media-preview a {
435 font-size: 2rem; 417 font-size: 2rem;
436 padding: 2rem; 418 padding: 2rem;
437 } 419 }
438 .image-viewer a {
439 font-size: 1rem;
440 margin: 1rem;
441 padding: initial;
442 }
443 .self-text.card { 420 .self-text.card {
444 -webkit-line-clamp: 4; 421 -webkit-line-clamp: 4;
445 line-clamp: 4; 422 line-clamp: 4;
@@ -824,7 +801,7 @@ select {
824 801
825.sticky { 802.sticky {
826 background-color: var(--sticky-color); 803 background-color: var(--sticky-color);
827 border-radius: 2px; 804 border-radius: var(--border-radius-card);
828 border: 4px solid var(--sticky-color); 805 border: 4px solid var(--sticky-color);
829} 806}
830 807
diff --git a/src/utils.pug b/src/utils.pug
index 17d1763..82876de 100644
--- a/src/utils.pug
+++ b/src/utils.pug
@@ -1,4 +1,9 @@
1- var fmtnum = (n)=>n>=1000?(n/1000).toFixed(1)+'k':n; 1-
2 function fmtnum(n) {
3 return n >= 1e6 ? (n / 1e6).toFixed(1) + 'mil' :
4 n >= 1e3 ? (n / 1e3).toFixed(1) + 'k' :
5 n;
6 }
2- var fmttxt = (n,t)=>`${t}${n==1?'':'s'}` 7- var fmttxt = (n,t)=>`${t}${n==1?'':'s'}`
3- var stripPrefix = (s, p) => s.startsWith(p) ? s.slice(p.length) : s; 8- var stripPrefix = (s, p) => s.startsWith(p) ? s.slice(p.length) : s;
4- 9-
diff --git a/src/views/comments.pug b/src/views/comments.pug
index 1265609..b96953d 100644
--- a/src/views/comments.pug
+++ b/src/views/comments.pug
@@ -64,7 +64,7 @@ html
64 video(controls data-dashjs-player src=`${url}`).post-media 64 video(controls data-dashjs-player src=`${url}`).post-media
65 else if isPostLink(post) 65 else if isPostLink(post)
66 a(href=post.url) 66 a(href=post.url)
67 | #{post.domain} 67 | #{post.url}
68 68
69 if post.selftext_html 69 if post.selftext_html
70 div.self-text 70 div.self-text
diff --git a/src/views/index.pug b/src/views/index.pug
index a35837b..52b8753 100644
--- a/src/views/index.pug
+++ b/src/views/index.pug
@@ -33,6 +33,12 @@ html
33 | consider donating to  33 | consider donating to 
34 a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan 34 a(href="https://donate.stripe.com/dR62bTaZH1295Da4gg") oppiliappan
35 |, author of lurker 35 |, author of lurker
36 if about && !isMulti
37 div.info-container
38 p
39 | #{fmtnum(about.accounts_active)} active
40 |  · 
41 | #{fmtnum(about.subscribers)} subscribers
36 hr 42 hr
37 details.sort-details 43 details.sort-details
38 summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')} 44 summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')}