Compare commits

..

9 Commits

Author SHA1 Message Date
12a1cf386d Merge pull request 'Add additional features to readme' (#16) from readme-updates into main
Reviewed-on: #16
2025-05-24 01:42:50 +12:00
7f6994883e README.md (B -> b)
stunning
2025-05-24 01:39:46 +12:00
641121789f groundbreaking changes (slightly styled infobox) 2025-05-24 01:37:24 +12:00
026e456855 Merge branch 'main' into readme-updates 2025-05-24 01:09:50 +12:00
d8b547547b user flair with mixed RTL-LTR text, Fixes #23 2025-05-24 01:07:20 +12:00
28fd37e74b README.md updates (Laugh) 2025-01-16 00:10:17 +13:00
e13ad30fdf Update README.md 2025-01-13 15:30:56 +13:00
b3f0449d4d Update README.md 2025-01-11 15:41:48 +13:00
2286ef5a1f Add additional features to readme 2025-01-09 10:50:51 +13:00
5 changed files with 71 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<img align="left" width="128" height="128" src="https://git.stardust.wtf/attachments/842086e3-b718-4379-b718-c3a542842152" alt="logo">
# Redsunlib
> An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some <sup><sub>(minor)</sub></sup> function and cosmetic changes.
> An alternative private front-end to Reddit, a fork of [Redlib](https://github.com/redlib-org/redlib) with some <sup><sub>(minor)</sub></sup> function and cosmetic changes. [(See.)](#additional-features)
<br>
@ -27,6 +27,7 @@ There are rapid changes/features in this fork that can<sup>(will)</sup> change w
- [Teddit](#teddit)
- [Libreddit](#libreddit)
5. [Comparison](#comparison)
- [Additional features](#additional-features)
- [Speed](#speed)
- [Privacy](#privacy)
- [Reddit](#reddit)
@ -98,6 +99,19 @@ Several technical improvements have also been made, including:
# Comparison
## Additional features
|Quick Access Feeds<br>*<sup>(Beta)</sup>*|![screenshot](https://git.stardust.wtf/attachments/fa732ded-8618-440c-98b4-8e491456b538)<br>*Toolbar*<br>![screenshot](https://git.stardust.wtf/attachments/fb21a7fb-3944-407b-b8b7-c664a1538d66)<br>*Dropdown*
|:-:|---|
|**Video Downloads**<br>*using FFmpeg.wasm*|<img align="left" width="400" src="https://git.stardust.wtf/attachments/2d5356dc-ce99-4e5e-bb64-b6e7cc343862" alt="Video Downloads">
|**Mascot Overlays**<br>*A friendly companion while you browse*|<img align="left" width="400" src="https://git.stardust.wtf/attachments/d8e1507d-8fde-4bf1-9150-6ec08b843f85" alt="Mascot Overlays (Image of boymoder)">
|**Extra Themes**<br>*Well... One.*|***Catppuccin*** <img width="400" src="https://git.stardust.wtf/attachments/ccf81f52-e653-4722-94b9-b370c58d6359" alt="Catppuccin">
|**Extra Layouts**|<br>***Waterfall*** <img width="400" src="https://git.stardust.wtf/attachments/b4f9e41e-27a9-4bd0-bb1e-f7aa025ffd38" alt="Waterfall"><br>***Old <sup>(Beta)</sup>*** <img width="400" src="https://git.stardust.wtf/attachments/fa4d78b9-17dd-4b64-90c9-510a75b3bc8e" alt="Old">
|**Tweaked Interface Elements**|<img width="200" src="https://git.stardust.wtf/attachments/1148dd14-63cf-481e-99f0-a2236f9414cd"><img width="200" src="https://git.stardust.wtf/attachments/c2055e09-fa96-46c6-9724-41a0bad28bc6"><br><br><img width="200" src="https://git.stardust.wtf/attachments/e99365d5-64d2-458e-a572-90ef030a0cfa"><img width="200" src="https://git.stardust.wtf/attachments/9248dfaa-28c2-443b-98f9-ed736f663701">
|**QoL**<br>*Quality of life*| Option to skip gated/quarantined <br> Option to disable banners to save bandwidth <br> Display more information <br> Mute Users [?](## "Automaticly collapse content (A Weaker filter)") |
---
This section outlines how Redlib compares to Reddit in terms of speed and privacy.
## Speed

View File

@ -3,7 +3,7 @@
use crate::{config, utils};
// CRATES
use crate::utils::{
catch_random, error, filter_posts, format_num, format_url, get_filters, info, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences,
catch_random, error, filter_posts, format_num, format_url, get_filters, info, infobox, nsfw_landing, param, redirect, rewrite_urls, setting, template, val, Post, Preferences,
Subreddit,
};
use crate::{client::json, server::RequestExt, server::ResponseExt};
@ -85,7 +85,7 @@ pub async fn community(req: Request<Body>) -> Result<Response<Body>, String> {
if (sub_name == "popular" || sub_name == "all") && remove_default_feeds {
if subscribed.is_empty() {
return info(req, "Subscribe to some subreddits! (Default feeds disabled in settings)").await;
return infobox(req, "Subscribe to some subreddits!","Default feeds disabled in settings").await;
} else {
// If there are subscribed subs, but we get here, then the problem is that front_page pref is set to something besides default.
// Tell user to go to settings and change front page to default.

View File

@ -561,6 +561,15 @@ pub struct InfoTemplate {
pub url: String,
}
#[derive(Template)]
#[template(path = "infobox.html")]
pub struct InfoBoxTemplate {
pub msg: String,
pub sub_msg: String,
pub prefs: Preferences,
pub url: String,
}
/// Template for NSFW landing page. The landing page is displayed when a page's
/// content is wholly NSFW, but a user has not enabled the option to view NSFW
/// posts.
@ -1380,6 +1389,21 @@ pub async fn info(req: Request<Body>, msg: &str) -> Result<Response<Body>, Strin
Ok(Response::builder().status(200).header("content-type", "text/html").body(body.into()).unwrap_or_default())
}
/// Renders a styled info landing page.
pub async fn infobox(req: Request<Body>, msg: &str, sub_msg: &str) -> Result<Response<Body>, String> {
let url = req.uri().to_string();
let body = InfoBoxTemplate {
msg: msg.to_string(),
sub_msg: sub_msg.to_string(),
prefs: Preferences::new(&req),
url,
}
.render()
.unwrap_or_default();
Ok(Response::builder().status(200).header("content-type", "text/html").body(body.into()).unwrap_or_default())
}
/// Returns true if the config/env variable `REDLIB_SFW_ONLY` carries the
/// value `on`.
///

View File

@ -1460,6 +1460,7 @@ a.search_subreddit:hover {
border-radius: 5px;
font-size: 12px;
font-weight: bold;
unicode-bidi: isolate;
}
.comment_score {
@ -2004,6 +2005,15 @@ th {
#error a {
color: var(--accent);
}
#post_error {
text-align: center;
background: var(--post);
border-radius: 5px;
padding: 30px;
margin-top: 10px;
margin-bottom: 20px;
width: 60em;
}
#issue_warning {
color: var(--popup-toreddit-text);

20
templates/infobox.html Normal file
View File

@ -0,0 +1,20 @@
{% extends "base.html" %}
{% import "utils.html" as utils %}
{% block title %}Info: {{ msg }},{{ sub_msg }}{% endblock %}
{% block sortstyle %}{% endblock %}
{% block subscriptions %}
{% call utils::sub_list("") %}
{% endblock %}
{% block search %}
{% call utils::search("".to_owned(), "") %}
{% endblock %}
{% block content %}
<div id="post_error">
<h2>{{ msg }}</h2>
<h3><i>{{ sub_msg }}</i></h3>
</div>
{% endblock %}