Use SVG icons for statuses, doc fixes

FossilOrigin-Name: e82fa8b0f5dc04c182040a869a273abbc6607ad89faec8477a6f2c0d36f81756
This commit is contained in:
me@ow.nekobit.net 2022-03-22 15:34:05 +00:00
parent 98989c69fa
commit e70adb695b
6 changed files with 87 additions and 48 deletions

12
CREDITS
View file

@ -14,9 +14,17 @@
[ Camera support ]
* SamTherapy <@sam@froth.zone>
Documentation and cleanup, bugs
Documentation and cleanup, fixed bugs
[ Support ]
* Khan <@Khan@sleepy.cafe>
Helped with the old Treebird Husky fork (history lesson required)
[ Executive producer ]
[ Executive producer ]
OTHER
* libcurl developers
* ICONSVG Project
* cJSON developers
* Pleroma developers
* You! :)

78
dist/treebird20.css vendored
View file

@ -13,6 +13,16 @@ body
background-color: #f6f6f6;
}
.hidden
{
display: none;
}
.pointer
{
cursor: pointer;
}
/* Cleans up most of the tables */
table.ui-table td
{
@ -536,39 +546,47 @@ ul li:first-child a.sidebarbtn
flex: 1;
}
/* Special cases */
.nobutton
.status-interact label
{
display: block;
padding: 3px 8px;
}
.status-interact svg.repeat.active
{
stroke: #08d345;
}
.status-interact svg.like.active
{
fill: #fcd202;
stroke: #fcd202;
}
.status-interact svg.like:hover,
.status-interact svg.like:active,
.statis-interact svg.like:focus
{
stroke: #fcd202;
pointer: select;
}
.status-interact svg.repeat:hover,
.status-interact svg.repeat:active,
.statis-interact svg.repeat:focus
{
stroke: #08d345;
}
.status-interact .count
{
display: block !important;
background: none !important;
background-color: transparent !important;
color: #aa0000 !important;
padding: 4px 9px !important;
margin: 0 !important;
text-decoration: none;
cursor: pointer !important;
outline: inherit !important;
font-size: 14px;
border: 0 !important;
}
padding-bottom: 3px;
.status-interact tr td:not(:last-child) .nobutton
{
border-right: 1px solid #cacaca !important;
}
.status-interact .nobutton-active,
.nobutton:hover,
.nobutton:active,
.nobutton:focus
{
background: linear-gradient(#fff, #aa3333, #aa2222, #aa0000) !important;
border: 0 !important;
border-right: 1px solid #cacaca !important;
color: #fff !important;
text-shadow: 0px 0px 5px #cc4444cc !important;
/* Move up */
position: relative;
top: -5px;
margin-bottom: -5px;
}
/* Emoji reacts */

View file

@ -11,8 +11,9 @@
# Intercept meta files to be loaded before proxy
RewriteEngine on
RewriteRule ^/(.*).css /$1.css [L]
RewriteRule ^/(treebird\_logo|favicon).png /$1.png [L]
RewriteRule ^/(.*).css$ /$1.css [L]
RewriteRule ^/svg/(.*).svg$ /svg/$1.svg [L]
RewriteRule ^/(treebird\_logo|favicon).png$ /$1.png [L]
# Set PATH_INFO variable
SetEnvIf Request_URI . proxy-fcgi-pathinfo=1

3
scripts/fcgistarter.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
kill -9 $(pgrep treebird.cgi) > /dev/null 2>&1
fcgistarter -c $PWD/../dist/treebird.cgi -p 4000 -N 1

View file

@ -32,7 +32,7 @@
// Pages
#include "../static/status.chtml"
#define NUM_STR " (%u)"
#define NUM_STR "%u"
int try_post_status(mastodont_t* api)
{
@ -121,11 +121,11 @@ char* construct_status(struct mstdnt_status* status, int* size)
reply_count ? reply_count : "",
config_url_prefix,
status->id,
status->reblogged ? "nobutton-active" : "",
status->reblogged ? "active" : "",
repeat_count ? repeat_count : "",
config_url_prefix,
status->id,
status->favourited ? "nobutton-active" : "",
status->favourited ? "active" : "",
favourites_count ? favourites_count : "",
config_url_prefix,
status->id,

View file

@ -24,32 +24,41 @@
<tr>
<td>
<form action="%s/status/%s/reply" method="post">
<input class="nobutton" type="submit" value="Reply%s">
<label class="pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9l6 6-6 6"/><path d="M4 4v7a4 4 0 0 0 4 4h11"/></svg>
<span class="count">%s</span>
<input class="hidden" type="submit">
</label>
</form>
</td>
<td>
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="repeat">
<input class="nobutton %s" type="submit" value="Repeat%s">
<label class="pointer">
<svg class="repeat %s" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 2.1l4 4-4 4"/><path d="M3 12.2v-2a4 4 0 0 1 4-4h12.8M7 21.9l-4-4 4-4"/><path d="M21 11.8v2a4 4 0 0 1-4 4H4.2"/></svg>
<span class="count">%s</span>
<input class="hidden" type="submit">
</label>
</form>
</td>
<td>
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="like">
<input class="nobutton %s" type="submit" value="Yeah!%s">
<label class="pointer">
<svg class="like %s" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>
<span class="count">%s</span>
<input class="hidden" type="submit">
</label>
</form>
</td>
<td>
<form action="%s/status/%s/quick" method="post">
<input class="nobutton" type="submit" value="Quick">
<form action="%s/status/%s" method="get">
<label class="pointer">
<svg class="%s" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6M14 10l6.1-6.1M9 21H3v-6M10 14l-6.1 6.1"/></svg>
<input class="hidden" type="submit">
</label>
</form>
</td>
<td>
<a class="nobutton" href="%s/status/%s">View</a>
</td>
<td>
<a class="nobutton" onclick="alert('hi');" href="#">Emoji</a>
</td>
</tr>
</table>
</div>