From f80e4bda5263e3428537ecb7d49b18ffd3c0e4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sat, 16 Apr 2022 19:50:39 +0200 Subject: separated css and html, removed php-cli dependency --- src/css.css | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/hp.html | 35 +++++++++++++++++ src/hp.php | 91 ------------------------------------------ src/httpd.c | 5 +++ src/main.c | 3 ++ 5 files changed, 172 insertions(+), 91 deletions(-) create mode 100644 src/css.css create mode 100644 src/hp.html delete mode 100644 src/hp.php (limited to 'src') diff --git a/src/css.css b/src/css.css new file mode 100644 index 0000000..0293e79 --- /dev/null +++ b/src/css.css @@ -0,0 +1,129 @@ +:root { /* most of the styles are used on http://sijanec.eu, so there are some excess colours */ + --bgc1: black; + --bgc2: #111; + --bgc3: #222; + --fgc1: white; + --fgc2: lightgray; + --fgc3: lightblue; + --fglinkc: #ae5; + --fglinkvisitedc: #0cd; + --fglinkhoverc: cyan; + --fglinkactivec: #eff; + --fgchilite: red; + --fgdecorc: yellow; + --fgcodec: #aed; + --bgcodec: var(--bgc2); + --bgclight: darkgray; + --scheme-name: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --bgc1: white; + --bgc2: lightgray; + --bgc3: darkgray; + --fgc1: black; + --fgc2: gray; + --fgc3: darkred; + --fglinkc: blue; + --fglinkvisitedc: purple; + --fglinkhoverc: darkblue; + --fglinkactivec: cyan; + --fgchilite: red; + --fgdecorc: darkmagenta; + --fgcodec: var(--bgc1); + --bgcodec: var(--fgc1); + --bgclight: darkgray; + --scheme-name: light; + } +} + +input, textarea { + background: var(--bgc2); + color: var(--fgc1); +} + +a { + text-decoration: underline; + cursor: pointer; + color: var(--fglinkc); +} + +a:visited { + color: var(--fglinkvisitedc); +} + +a:hover { + color: var(--fglinkhoverc); +} + +a:active { + color: var(--fglinkactivec); +} + + +@media screen and (min-width: 1000px) { + body { + margin-left: 10%; + margin-right: 10%; + } +} + +body { + background-color: var(--bgc1); + color: var(--fgc1); + scrollbar-color: var(--scheme-name); +} + +code { + color: var(--fgcodec); + background-color: var(--bgcodec); +} +input[type=password], input[type=text], input[type=submit], input[type=button] { + height: 1cm; + font-size: large; +} +.result:hover { + background: var(--bgc2); +} +.container { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: center; + align-items: stretch; +} +input[name=q] { + flex-grow: 4; +} +input[type=submit] { + flex-basis: 12.5%; +} +.SC_LOG_ERROR { + color: red; +} +.SC_LOG_WARNING { + color: orange; +} +.SC_LOG_INFO { + color: lightgreen; +} +.SC_LOG_DEBUG { + color: magenta; +} +.breadcrumb { + color: var(--fgc2); + font-size: small; /* small is relative to parent (h4) size */ +} +.result h4 { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin-bottom: 0.314159265358em; +} +.result p { + margin-top: 0.314159265358em; +} +.result img { + height: 10em; +} diff --git a/src/hp.html b/src/hp.html new file mode 100644 index 0000000..dcde692 --- /dev/null +++ b/src/hp.html @@ -0,0 +1,35 @@ + + + + + + + + %s :: sear.c + + + + + + + + +
+ + + + + + %s +
+

+ %s +

+ %s +
+

+ sear.c + +

+ + diff --git a/src/hp.php b/src/hp.php deleted file mode 100644 index cffa469..0000000 --- a/src/hp.php +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - %s :: sear.c - - - - - - - - - -
- - - - - - %s -
-

- %s -

- %s -
-

- sear.c - -

- - diff --git a/src/httpd.c b/src/httpd.c index 23f4b60..efebd75 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -153,6 +153,11 @@ enum MHD_Result sc_httpd (void * cls, sprintf(response, sc_osdd, host); content_type = "application/opensearchdescription+xml"; break; + case 'c': /* css.css - stylesheets */ + mhdrmm = MHD_RESPMEM_PERSISTENT; + response = sc_css; + content_type = "text/css"; + break; case 'l': /* logs.html */ { #ifdef SC_LOGMEM diff --git a/src/main.c b/src/main.c index f57e398..0b18c0e 100644 --- a/src/main.c +++ b/src/main.c @@ -58,6 +58,9 @@ unsigned char sc_hp[] = { /* html page null terminated format string, from file char sc_osdd[] = { /* xml document for opensearch */ #include }; +char sc_css[] = { /* css */ +#include +}; char sc_robotstxt[] = "User-Agent: *\nDisallow: /\n"; char sc_securitytxt[] = "# This content information is provided by the developer of this opensource application.\n" "# The developer is not responsible for the actions of his software\n" -- cgit v1.2.3