From 3fb55703314e16cece845f7e5481d21e390a8520 Mon Sep 17 00:00:00 2001 From: veclav talica Date: Fri, 26 May 2023 14:00:48 +0500 Subject: [PATCH] mobile friendly layout --- articles/oscillators/waveforms.c | 2 +- html/style.css | 16 +++++++------- tools/article_wrapper.py | 2 +- tools/main_page_generator.py | 2 -- tools/page_shares.py | 36 ++++++++++++++++---------------- tools/track_listing_generator.py | 23 +++++++------------- 6 files changed, 36 insertions(+), 45 deletions(-) diff --git a/articles/oscillators/waveforms.c b/articles/oscillators/waveforms.c index ea6f7e6..da3a8a1 100644 --- a/articles/oscillators/waveforms.c +++ b/articles/oscillators/waveforms.c @@ -15,7 +15,7 @@ #define RED 0 #define GREEN 0 -#define BLUE 0 +#define BLUE 255 static struct sinewave { float f, s, c; diff --git a/html/style.css b/html/style.css index f864694..a9c7238 100644 --- a/html/style.css +++ b/html/style.css @@ -38,7 +38,7 @@ html { padding: 0.5em 0.5em; border-radius: 4px; } - .nav ul { + nav ul { padding-left: 0; border-radius: 4px; list-style: none; @@ -49,29 +49,29 @@ html { background-color: #f0f0f0; border: 1px solid #bbbbdd; } - .nav li:first-child { + nav li:first-child { border-left: none; } - .nav li { + nav li { border-right: 1px solid #bbbbdd; border-left: 1px solid #ffffff; } - .nav a { + nav a { padding: 0.4em 1em; display: inline-block; text-decoration: none; font-family: arial, sans; } - .nav a:hover { + nav a:hover { background-color: #e0e0e0; } - .nav a:link { + nav a:link { color: #44d; } - .nav a:visited { + nav a:visited { color: #44d; } - .nav a.here { + nav a.here { background-color: #e0e0e0; } @media only screen and (max-device-width: 480px) { diff --git a/tools/article_wrapper.py b/tools/article_wrapper.py index 962ca34..91a179f 100755 --- a/tools/article_wrapper.py +++ b/tools/article_wrapper.py @@ -23,7 +23,7 @@ with open(argv[1], "r") as f: metadata = parse_metadata(argv[1]) title = metadata.get("Title", "Oopsie, somebody forgot to name the article!") -article_head = "\n# " + title + "\n---\n" +article_head = "\n# " + title + "\n" brief = metadata.get("Brief") if not brief is None: diff --git a/tools/main_page_generator.py b/tools/main_page_generator.py index 6746554..14fb22b 100755 --- a/tools/main_page_generator.py +++ b/tools/main_page_generator.py @@ -21,8 +21,6 @@ CSS: /style.css page = f"""Personal blog of one {choice(ADJECTIVES)} Veclav Talica. ---- - ### Articles ### """ diff --git a/tools/page_shares.py b/tools/page_shares.py index f4b0fe6..ecead45 100644 --- a/tools/page_shares.py +++ b/tools/page_shares.py @@ -1,28 +1,28 @@ HEAD_EMBED = """ -
- -
- -## mjestečko ## - - - -
+
+ +
+ +""" + +NOTICE = """ +--- +*Remember, - all you see here is free for use for any purpose whatsoever.* """ TAIL_EMBED = """ ---- -*Remember, - all you see here is free for use for any purpose whatsoever.*
@@ -56,4 +56,4 @@ WEEKDAYS = { } def wrap_page(page: str) -> str: - return HEAD_EMBED + page + TAIL_EMBED + return HEAD_EMBED + page + NOTICE + TAIL_EMBED diff --git a/tools/track_listing_generator.py b/tools/track_listing_generator.py index 5d17cdd..b10a5db 100755 --- a/tools/track_listing_generator.py +++ b/tools/track_listing_generator.py @@ -3,6 +3,8 @@ from sys import argv, exit from os import walk, path +from page_shares import HEAD_EMBED, TAIL_EMBED + if len(argv) <= 1: print("No directory was supplied") exit(-1) @@ -58,20 +60,10 @@ page = """ +""" +page += HEAD_EMBED -
-
-

mjestečko

- -
- -
+page += """

Tracks

.xm module tracks of my own. Btw, they're playable in browser :3

Note that some files are rendered incorrectly.

@@ -90,8 +82,9 @@ for _, _, files in walk(argv[1]): ) break -page += """
-
+page += TAIL_EMBED + +page += """
"""