From 3f4676c3488e7fb065629029ad880f7d8a568200 Mon Sep 17 00:00:00 2001 From: the little girl Date: Fri, 6 Jun 2014 14:41:19 +0200 Subject: oh oh oh pages og css --- config.def.h | 1 + wiki.c | 4 ++-- wiki.css | 21 ++++++++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index f2c5857..bd0acda 100644 --- a/config.def.h +++ b/config.def.h @@ -2,6 +2,7 @@ static char *title = "a wiki"; static char *id = "anonymous"; static char *home = "home"; +static char *pages = "pages"; static char *loft = ".loft"; static char *links[][2] = { diff --git a/wiki.c b/wiki.c index 5f3af7e..cd92564 100644 --- a/wiki.c +++ b/wiki.c @@ -138,7 +138,7 @@ int store(char *raw, int len) { int pos = 0; unsigned int decoded; - char buffer[3]; + char buffer[3] = { 0 }; for(int i = 0; i < len; i++) { buffer[pos] = getchar(); if(buffer[pos] == '+') buffer[pos] = ' '; @@ -281,7 +281,7 @@ int main(int argc, char **argv) { setenv("MARXUP_PREFIX", base, 1); setenv("MARXUP_WIKI", "1", 1); - if(chdir("pages")) + if(chdir(pages)) return problem(503, "Service unavailable"); if(!strncmp(verb, "POST", 4)) return post(page); diff --git a/wiki.css b/wiki.css index 4c6ff72..d1d17dc 100644 --- a/wiki.css +++ b/wiki.css @@ -1,4 +1,4 @@ -body { font: 16px/1.2 sans-serif; width: 64em; margin: 0 auto; } +body { font: 16px/1.2 sans-serif; width: 90%; margin: 0 auto; max-width: 64em; background: white; } textarea { font: inherit; width: 100%; } h1 { text-transform: uppercase; } hr { clear: both; } @@ -8,9 +8,24 @@ img[align=right] { margin: 0 0 1em 1em; } ul { list-style: inside square; } ul.glob { list-style: inside circle; padding: 0; text-transform: uppercase; } table { text-align: left; border-collapse: collapse; background: #eee; } -th, td { padding: 4px 8px 4px 0; } +th, td { padding: 4px 8px 4px 8px; } tr:nth-child(2n) { background: #fff; } -a { text-decoration: none; color: DeepPink; } +a { text-decoration: none; color: red; } a:hover, a:visited { color: Crimson; } h1 a:hover:after { content: " ยป" attr(data-text); color: #aaa; } +pre { border: 1px dotted gray; padding: 0.5em; background: GhostWhite; } +textarea { font-family: monospace; } tt { font-weight: bold; } +.edit a { margin-right: 1em; } +.meny { float: right; padding: 1em; clear: right; margin: 0 1em 1em 1em; width: 240px; background: #ddd; border-left: 4px solid #000; box-shadow: 5px 5px 10px #777; } +.meny h2, .meny h3 { font-size: large; margin-top: 0; text-transform: uppercase; } +.meny ul { padding: 0; margin: 0; } +.marxuplol { padding: 1em; background: #ddd; } +.rosa { color: DeepPink; }pre { overflow: hidden; } +@media screen and (max-width: 640px) { + .meny { float: none; margin: 0; } + .magisk { display: none; } +} + +img { image-rendering: optimizeSpeed; image-rendering: -moz-crisp-edges; image-rendering: -o-crisp-edges; image-rendering: -webkit-optimize-contrast; image-rendering: optimize-contrast; image-rendering: crisp-edges; image-rendering: pixelated; -ms-interpolation-mdoe: nearest-neighbor; max-width: 100%; } + -- cgit v1.0