Dark theme by Grumbulon + other fixes

FossilOrigin-Name: c717ce40e921648165295897c407af7d7a82c7c3ab74ef6ff7ef27b94fa17912
This commit is contained in:
me@ow.nekobit.net 2022-04-14 03:51:26 +00:00
parent e8e765ed81
commit 2ab63c3398
10 changed files with 1241 additions and 8 deletions

1209
dist/treebird20-dark.css vendored Normal file

File diff suppressed because it is too large Load diff

4
dist/treebird20.css vendored
View file

@ -49,7 +49,6 @@ ul
{
padding: 8px;
}
#main-page
{
margin: 8px;
@ -63,6 +62,7 @@ ul
border-radius: 5px;
}
.hidden
{
display: none;
@ -420,7 +420,7 @@ ul li:first-child a.sidebarbtn
}
svg.like, svg.repeat, svg.follow, svg.reply, svg.in-reply-to-icon
svg.like, svg.repeat, svg.follow, svg.reply, svg.in-reply-to-icon, svg.one-click-software, svg.expand
{
vertical-align: middle;
}

View file

@ -49,6 +49,8 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t*
ssn->config.theme = ssn->cookies.theme;
if (ssn->cookies.logged_in)
login_string = "";
if (ssn->cookies.themeclr)
ssn->config.themeclr = ssn->cookies.themeclr;
if (ssn->cookies.background_url)
ssn->config.background_url = ssn->cookies.background_url;
}

View file

@ -55,6 +55,7 @@ char* read_cookies_env(struct cookie_values* cookies)
{ "theme", &(cookies->theme), key_string },
{ "instance_url", &(cookies->instance_url), key_string },
{ "background_url", &(cookies->background_url), key_string },
{ "themeclr", &(cookies->themeclr), key_int },
};
do

View file

@ -27,6 +27,7 @@ struct cookie_values
char* theme;
char* instance_url;
char* background_url;
int themeclr;
};
struct http_cookie_info

View file

@ -16,6 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <limits.h>
#include "key.h"
void key_string(char* val, struct form_props* props, void* _arg)
@ -23,3 +25,20 @@ void key_string(char* val, struct form_props* props, void* _arg)
char** arg = _arg;
*arg = val;
}
void key_int(char* val, struct form_props* form, void* _arg)
{
char* err;
int* arg = _arg;
// Convert
long result = strtol(val, &err, 10);
if (err == val ||
// Overflow
result == LONG_MIN || result == LONG_MAX)
{
*arg = 0;
return;
}
*arg = result;
}

View file

@ -35,5 +35,6 @@ struct key_value_refs
};
void key_string(char* val, struct form_props* form, void* arg);
void key_int(char* val, struct form_props* form, void* arg);
#endif // KEY_H

View file

@ -15,11 +15,11 @@
<h3>Color Scheme</h3>
<ul>
<li>
<input type="radio" id="cfglight" name="themeclr" value="1" checked>
<input type="radio" id="cfglight" name="themeclr" value="0" checked>
<label for="cfglight">Light</label>
</li>
<li>
<input type="radio" id="cfgdark" name="themeclr" value="2">
<input type="radio" id="cfgdark" name="themeclr" value="1">
<label for="cfgdark">Dark</label>
</li>
</ul>

View file

@ -8,7 +8,7 @@
<!-- Put text here -->
</div>
<div class="statusfooter-right">
<input type="submit" value="Post" tabindex="2">
<input type="submit" value="Post" tabindex="2" class="btn">
</div>
</div>
</div>

View file

@ -79,15 +79,15 @@
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="likeboost">
<label class="pointer">
<svg width="20" height="20" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g><g stroke-width="1.98"><path d="m19.15 8.5061 2.7598 2.7598-2.7598 2.7598"/><path d="m14.756 11.325s2.5484-0.05032 6.3258 0.01026m-15.639 10.807-2.7598-2.7598 2.7598-2.7598"/><path d="m22.4 15.327v1.2259c0 1.156-1.2356 2.7598-2.7598 2.7598h-16.664"/></g><polygon transform="matrix(.60736 0 0 .60736 .60106 .63577)" points="18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2 15.09 8.26 22 9.27 17 14.14" stroke-width="2.9656"/></g></svg>
<input class="hidden" type="submit" value="Like">
<svg class="one-click-software" width="20" height="20" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g><g stroke-width="1.98"><path d="m19.15 8.5061 2.7598 2.7598-2.7598 2.7598"/><path d="m14.756 11.325s2.5484-0.05032 6.3258 0.01026m-15.639 10.807-2.7598-2.7598 2.7598-2.7598"/><path d="m22.4 15.327v1.2259c0 1.156-1.2356 2.7598-2.7598 2.7598h-16.664"/></g><polygon transform="matrix(.60736 0 0 .60736 .60106 .63577)" points="18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2 15.09 8.26 22 9.27 17 14.14" stroke-width="2.9656"/></g></svg>
<input class="hidden" type="submit" value="L+R">
</label>
</form>
</td>
<td>
<form action="%s/status/%s#id-%s" method="post">
<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="M15 3h6v6M14 10l6.1-6.1M9 21H3v-6M10 14l-6.1 6.1"/></svg>
<svg class="expand" 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>