Fix action/unaction buttons

FossilOrigin-Name: 8e5346c1bce0faf5423cfcedbc29f756747f30f0d4f99f47206de7cc1b46b1d0
This commit is contained in:
me@ow.nekobit.net 2022-04-01 17:36:18 +00:00
parent 28366b6f67
commit 8723021e83
6 changed files with 38 additions and 22 deletions

View file

@ -6,6 +6,7 @@ CFLAGS += -Wall -I $(MASTODONT_DIR)include/ -Wno-unused-variable -Wno-discarded-
LDFLAGS = -L$(MASTODONT_DIR) -lmastodont $(shell pkg-config --libs libcjson libcurl libpcre) -lfcgi
SRC = $(wildcard src/*.c)
OBJ = $(patsubst %.c,%.o,$(SRC))
HEADERS = $(wildcard src/*.h)
PAGES_DIR = static
PAGES = $(wildcard $(PAGES_DIR)/*.html)
PAGES_CMP = $(patsubst %.html,%.chtml,$(PAGES))
@ -15,16 +16,14 @@ TARGET = treebird.cgi
MASTODONT_URL = https://git.nekobit.net/repos/mastodont-c.git
all: $(MASTODONT_DIR) dep_build $(TARGET)
apache: all apache_start
$(TARGET): filec $(PAGES_CMP) $(OBJ)
$(TARGET): filec $(PAGES_CMP) $(OBJ) $(HEADERS)
$(CC) -o $(DIST)$(TARGET) $(OBJ) $(LDFLAGS)
filec: src/file-to-c/main.o
$(CC) -o filec $<
%.chtml: %.html
./filec $< $< > $@
# PAGES
$(PAGES_DIR)/index.chtml: $(PAGES_DIR)/index.html
./filec $< data_index_html > $@
@ -86,13 +85,16 @@ $(MASTODONT_DIR):
git clone $(MASTODONT_URL) || true
@echo -e "\033[38;5;13mRun 'make update' to update mastodont-c\033[0m"
apache_start:
./scripts/fcgistarter.sh
dep_build:
make -C $(MASTODONT_DIR)
update:
git -C $(MASTODONT_DIR) pull
%.o: %.c
%.o: %.c %.h $(PAGES)
$(CC) $(CFLAGS) -c $< -o $@
clean:

17
dist/treebird20.css vendored
View file

@ -1,5 +1,3 @@
/* Look, I tried my best to make this theme compatible with browsers like Netsurf and stuff, I HATE
the modern web and flexboxes and stuff, so as a result, you WILL see some fugly things in here
that you will probably want to cleanup or throw out completely, this CSS is a big hack.
@ -174,14 +172,14 @@ table.present th, table.present td
/*************************************************
* BUTTONS *
*************************************************/
input[type=button], input[type=submit], .sidebarbtn, .btn
.sidebarbtn, .btn
{
background: linear-gradient(#fff, #f7f7f7);
color: #000;
text-decoration: none;
}
input[type=button]:hover, input[type=submit]:hover, .sidebarbtn:hover, .btn:hover
.sidebarbtn:hover, .btn:hover
{
background: linear-gradient(#aa0000, #600000);
border-color: #400000;
@ -189,7 +187,7 @@ input[type=button]:hover, input[type=submit]:hover, .sidebarbtn:hover, .btn:hove
cursor: pointer;
}
input[type=button]:active, input[type=submit]:active, .sidebarbtn:active, .btn:active
.sidebarbtn:active, .btn:active
{
background: linear-gradient(#600000, #aa0000);
border-color: #400000;
@ -961,14 +959,19 @@ ul.large-list li a
list-style-type: none;
}
.menu .btn
.menu .btn-menu
{
background: unset;
background-color: unset;
display: block;
padding: 6px 12px;
width: 100%;
border: 0;
cursor: pointer;
text-align: left;
}
.menu .btn:hover
.menu .btn-menu:hover
{
background-color: #eaeaea;
color: #000;

View file

@ -152,6 +152,18 @@ char* construct_status(struct mstdnt_status* status,
status->account.acct,
status->account.acct, /* Account */
"Public", /* visibility */
config_url_prefix,
status->id,
status->muted ? "un" : "",
status->muted ? "Unmute thread" : "Mute thread",
config_url_prefix,
status->id,
status->pinned ? "un" : "",
status->pinned ? "Unpin" : "Pin",
config_url_prefix,
status->id,
status->bookmarked ? "un" : "",
status->bookmarked ? "Remove Bookmark" : "Bookmark",
status->content,
attachments ? attachments : "",
emoji_reactions ? emoji_reactions : "",

View file

@ -5,7 +5,6 @@
<title>%s</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="stylesheet" type="text/css" href="/%s.css">
<!-- <link rel="stylesheet" type="text/css" href="../dist/treebird.css"> -->
</head>
<body>
<div id="display">
@ -17,7 +16,7 @@
<!-- Searchbox -->
<form action="%s/search" method="get">
<input type="textbox" class="group group-left group-inputbox" placeholder="%s" id="searchbox" name="q"><!-- i hate HTML
--><input type="submit" class="group group-right" value="%s">
--><input type="submit" class="btn group group-right" value="%s">
</form>
</div>
</header>

View file

@ -1,6 +1,6 @@
<div class="simple-page">
<h1>%s</h1>
%s
<form action="%s/login" method="post">
@ -13,7 +13,7 @@
<input type="password" id="login-password" name="password"><br>
</div>
<div class="form-group">
<input type="submit" value="%s">
<input class="btn" type="submit" value="%s">
</div>
</form>
</div>

View file

@ -17,20 +17,20 @@
<ul>
<li>
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="mute">
<input type="submit" class="menu-btn" value="Mute">
<input type="hidden" name="itype" value="%smute">
<input type="submit" class="btn-menu" value="%s">
</form>
</li>
<li>
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="pin">
<input type="submit" class="menu-btn" value="Pin">
<input type="hidden" name="itype" value="%spin">
<input type="submit" class="btn-menu" value="%s">
</form>
</li>
<li>
<form action="%s/status/%s/interact" method="post">
<input type="hidden" name="itype" value="bookmark">
<input type="submit" class="menu-btn" value="Bookmark">
<input type="hidden" name="itype" value="%sbookmark">
<input type="submit" class="btn-menu" value="%s">
</form>
</li>
</ul>