mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-18 01:08:51 +00:00
wip
This commit is contained in:
@ -293,6 +293,10 @@ HTTPResponse WebServer::generateReadResponse(lmdb::txn &txn, Decompressor &decom
|
||||
} else if (u.path[0] == "favicon.ico") {
|
||||
rawBody = std::string(oddbeanStatic__favicon_ico());
|
||||
contentType = "image/x-icon";
|
||||
} else if (u.path[0] == "login") {
|
||||
body = tmpl::login(0);
|
||||
} else if (u.path[0] == "about") {
|
||||
body = tmpl::about(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,12 +79,20 @@ h2 {
|
||||
.new-post {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.about {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.login {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.no-js {
|
||||
color: red;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: black;
|
||||
}
|
||||
@ -299,3 +307,20 @@ table.vert {
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.info-page {
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
|
||||
p {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
b {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,11 @@ document.addEventListener('alpine:init', () => {
|
||||
},
|
||||
|
||||
async login() {
|
||||
if (!window.nostr) {
|
||||
window.location = "/login";
|
||||
return;
|
||||
}
|
||||
|
||||
let pubkey = await nostr.getPublicKey();
|
||||
|
||||
let response = await fetch(`/u/${pubkey}/metadata.json`);
|
||||
|
25
src/apps/web/tmpls/about.tmpl
Normal file
25
src/apps/web/tmpls/about.tmpl
Normal file
@ -0,0 +1,25 @@
|
||||
<div class="info-page">
|
||||
<p>
|
||||
Hi, thanks for stopping by! Oddbean is a discussion site built on <a href="https://github.com/nostr-protocol/nostr">the nostr protocol</a>. You may notice that our design is heavily inspired by Hacker News and Reddit. This is on purpose. We want Oddbean to be a comfortable and familiar experience, with fast loading pages and minimal distractions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Why nostr?</b> Nostr is a protocol for building decentralised systems. Is it perfect? No, but it is the closest thing we have to an honest-to-goodness decentralised social media protocol. Oddbean is just one of many interfaces to the same network. Even though most of the posts don't originate here, Oddbean users can still interact with anyone else on the network, thanks to the interoperability of nostr. If you get tired of Oddbean, you can easily move to another client.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>No crap.</b> We just want to build a great distraction-free discussion site. No cookie pop-ups. In fact, no cookies, period. No elements bouncing around as the page loads. No "sign-up to our newsletter" modals that appear half way down. Javascript is optional (only needed for posting).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>No images.</b> The written word is one of the greatest achievements of civilisation. They say "a picture is worth a thousand words", but consider this: If you give me a picture, I can describe it in great detail using a thousand words. But if I give you a thousand words, can you draw a picture that conveys all this information?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>How do I login?</b> You don't. If you want to post or vote, I recommend using a browser extension such as nos2x (<a href="https://chrome.google.com/webstore/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp">chrome</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/nos2x-fox/">firefox</a>), or one of <a href="https://github.com/aljazceru/awesome-nostr#browser-extensions">several others.</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Is there an algorithm?</b> Yes, <a href="https://www.tbray.org/ongoing/When/202x/2022/11/28/On-Algorithms">computers don't work without algorithms</a>. The goal of Oddbean is to make the algorithms used for ranking and filtering posts and comments transparent. When communities are ready, you'll be able to click on "algo" at the top of a community page and see exactly how it works. If you don't like it, you can fork it to your own community. The homepage is just another community, except one that I control. Don't like it? Don't use it.
|
||||
</p>
|
||||
</div>
|
7
src/apps/web/tmpls/login.tmpl
Normal file
7
src/apps/web/tmpls/login.tmpl
Normal file
@ -0,0 +1,7 @@
|
||||
<div class="info-page">
|
||||
<p>Hi, welcome!</p>
|
||||
|
||||
<p>Oddbean does not use usernames or passwords. If you want to post on Oddbean, you'll need to generate a <a href="https://github.com/nostr-protocol/nostr">nostr private key</a>. But don't worry, this is easy and free. Best of all, if you get tired of Oddbean you can easily bring your key over to one of the many other nostr clients.</p>
|
||||
|
||||
<p>You should always keep your private key secret. That's why you'll never be asked to enter it into the Oddbean site. Instead, we recommend using a browser extension such as nos2x (<a href="https://chrome.google.com/webstore/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp">chrome</a>, <a href="https://addons.mozilla.org/en-US/firefox/addon/nos2x-fox/">firefox</a>), or one of <a href="https://github.com/aljazceru/awesome-nostr#browser-extensions">several others.</a></p>
|
||||
</div>
|
@ -23,6 +23,8 @@
|
||||
<a href="/algo" class="community-rules">(algo)</a> ?(ctx.communitySpec)
|
||||
|
||||
<a href="/post" class="new-post">new post</a>
|
||||
|
||||
<a href="/about" class="about">about</a>
|
||||
</span>
|
||||
|
||||
<span x-data="obLogin" class="login">
|
||||
@ -31,6 +33,9 @@
|
||||
<a x-text="username" class="username" :href="myProfile"></a>
|
||||
| <span @click="logout" class="logout-link">logout</span>
|
||||
</span>
|
||||
<noscript>
|
||||
<span class="no-js">needs JS</span>
|
||||
</noscript>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user