From a8435d3bcb0c9a903ac47e73e55d3a29c927c2f4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 Nov 2024 12:53:11 +0300 Subject: [PATCH] fixed --- config.h | 2 +- img.c | 27 ++++++++++++++------------- style.css | 44 +++++++++++++++++++++++++++----------------- 3 files changed, 42 insertions(+), 31 deletions(-) diff --git a/config.h b/config.h index 21a764f..e72f698 100644 --- a/config.h +++ b/config.h @@ -6,6 +6,6 @@ #define CSS "style.css" #define LOGO "logo.png" -#define DESC "+100500 photos of windowmaker" +#define DESC "from outer space" #define TITLE "8img gallery" #define POST_PER_PAGE 5 diff --git a/img.c b/img.c index 9d20d0a..0aa8349 100644 --- a/img.c +++ b/img.c @@ -22,7 +22,7 @@ struct UNIQ_TAGS { }; char *gen_id(const char *filename) { - const char *alf = "qwertyUIOPasdfghjklQWERTASDFGHJKLZXCVBNMzxcvbnm1234567890"; + const char *alf = "qwertyuiopasdfghjklzxcvbnmZXCVBNMASDFGHJKLQWERTYUIOP1234567890"; char *ext = strrchr(filename, '.'); if (ext == NULL) @@ -256,13 +256,13 @@ RDB_CLOSE: } struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, struct DB_STR *db, const size_t page, const size_t pages) { - fprintf(fp, "\n\n\n%s\n\n\n

%s

Page %zu

", CSS, TITLE, LOGO, DESC, page); + fprintf(fp, "\n\n\n%s\n\n\n

%s
%s/p%zu

", CSS, TITLE, LOGO, DESC, file, page); /* Tags */ - fputs("\n [all] ", fp); + fputs("\nall", fp); for (size_t i = 0; i < ut.size; i++) - fprintf(fp, " [%s] ", ut.tags[i], ut.tags[i]); - fputs("\n


\n", fp); + fprintf(fp, " %s", ut.tags[i], ut.tags[i]); + fputs("\n


\n", fp); /* Images */ size_t images = 0; @@ -283,9 +283,9 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, fprintf(fp, "%s
", p->filename, p->filename, p->filename); for (size_t i = 0; i < p->size; i++) - fprintf(fp, " %s", p->tags[i], p->tags[i]); + fprintf(fp, " %s", p->tags[i], p->tags[i]); - fputs("\n


\n", fp); + fputs("\n


\n", fp); p = i; images++; @@ -293,13 +293,14 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, break; } + fputs("
\n", fp); for (size_t i = 0; i <= pages; i++) { if (i == 0) { if (i == page) - fprintf(fp, "(0) ", file); + fprintf(fp, "0 ", file); else - fprintf(fp, "[0] ", file); + fprintf(fp, "0 ", file); } else { @@ -307,15 +308,15 @@ struct DB_STR *build_html(FILE *fp, const char *file, const struct UNIQ_TAGS ut, snprintf(new_path, sizeof(new_path), "%s-%zu.html", file, i); if (i == page) - fprintf(fp, "(%zu) ", new_path, i); + fprintf(fp, "%zu", new_path, i); else - fprintf(fp, "[%zu] ", new_path, i); + fprintf(fp, " %zu ", new_path, i); } } - fprintf(fp, "\n
\n\n\n"); + fprintf(fp, "\n\n
\n\n\n"); return p; } @@ -462,7 +463,7 @@ int main(int argc, char **argv) { else if (!strcmp(argv[0], "rebuild")) rebuild(); - else if (!strcmp(argv[0], "rebuild")) + else if (!strcmp(argv[0], "version")) puts("8img version: 1.0\nWritten under WTFPL License."); else diff --git a/style.css b/style.css index f5f9159..a438973 100644 --- a/style.css +++ b/style.css @@ -1,22 +1,32 @@ -body { background-color: #1d2021; } - -/* Links */ -a { text-decoration: none; } -#tags { color: 8ec07c;} -#pager { color: #b16286; } -#alltags { color: #83a598; } - -#bar { - width: 100%; - height: 10px; - background-color: #ebdbb2; +body { + margin: auto; + padding: 2em; } -#text { color: #ebdbb2; } +a { + text-decoration: none; + color: #000000; +} + +.pager #curr { + color: #ffffff; + background-color: #000000; +} + +.bar { + width: 100%; + height: 5px; + background-color: #000000; +} img { - height: auto; - width: auto; - max-width: 50%; - max-height: 50%; + display: block; + max-width: 80%; } + +/* +#desc { color: #000000; } +.tags { color: #000000; } +.pager {} +.pager a { text-decoration: underline; } +*/