From 05e5cd3e51672800909737cde41dee3db3e31169 Mon Sep 17 00:00:00 2001 From: ktyl Date: Mon, 13 Sep 2021 00:06:53 +0100 Subject: [PATCH] initial commit --- .gitignore | 2 + makefile | 24 ++++++ ppp.py | 66 ++++++++++++++++ readme.md | 11 +++ src/include/header.html | 13 ++++ src/include/planets.html | 1 + src/include/sidebar.html | 20 +++++ src/root/about.html | 15 ++++ src/root/blog.html | 15 ++++ src/root/colors.css | 14 ++++ src/root/contact | 15 ++++ src/root/contact.html | 15 ++++ src/root/gallery.html | 15 ++++ src/root/index.html | 23 ++++++ src/root/main.css | 164 +++++++++++++++++++++++++++++++++++++++ src/root/portfolio.html | 15 ++++ 16 files changed, 428 insertions(+) create mode 100644 .gitignore create mode 100644 makefile create mode 100644 ppp.py create mode 100644 readme.md create mode 100644 src/include/header.html create mode 100644 src/include/planets.html create mode 100644 src/include/sidebar.html create mode 100644 src/root/about.html create mode 100644 src/root/blog.html create mode 100644 src/root/colors.css create mode 100644 src/root/contact create mode 100644 src/root/contact.html create mode 100644 src/root/gallery.html create mode 100644 src/root/index.html create mode 100644 src/root/main.css create mode 100644 src/root/portfolio.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aebb415 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +html/ +site/ diff --git a/makefile b/makefile new file mode 100644 index 0000000..d37c3fb --- /dev/null +++ b/makefile @@ -0,0 +1,24 @@ +SRC_DIR = src +OUT_DIR = site + +ROOT_DIR = $(SRC_DIR)/root +INCLUDE_DIR = $(SRC_DIR)/include + +PAGES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.html") +HTML_INCLUDES = $(shell find $(INCLUDE_DIR) -name *.html) +HTML_TARGETS = $(PAGES:$(ROOT_DIR)/%.html=$(OUT_DIR)/%.html) + +STYLES = $(shell find $(ROOT_DIR) -wholename "$(ROOT_DIR)*.css") +CSS_TARGETS = $(STYLES:$(ROOT_DIR)/%.css=$(OUT_DIR)/%.css) + +run: $(HTML_TARGETS) $(CSS_TARGETS) + +$(OUT_DIR)/%.html: $(ROOT_DIR)/%.html $(HTML_INCLUDES) + mkdir -p $(OUT_DIR) + python ppp.py $< $(HTML_INCLUDES) > $@ + +$(OUT_DIR)/%.css: $(ROOT_DIR)/%.css + cp $< $@ + +clean: + rm -r $(OUT_DIR) diff --git a/ppp.py b/ppp.py new file mode 100644 index 0000000..4c47592 --- /dev/null +++ b/ppp.py @@ -0,0 +1,66 @@ +import sys +import os.path + +err = False +paths = [] + +def print_usage(): + print("\nusage: python ppp.py ROOT TEMPLATES [...]") + +# check arguments +argc = len(sys.argv) +if argc < 3: + print_usage() + sys.exit(1) + +# figure out src dir from first include shader path root argument +sep="/" +inc_start_idx = 2 +inc_end_idx = argc - 1 +src_dir = sep.join(sys.argv[2].split(sep)[:-1]) + +def preprocess_file(path): + lines=0 + + with open(path) as f: + content = f.readlines() + content = [x.strip() for x in content] + lines=len(content) + + for line in content: + + directive = "#include" + if line.startswith(directive): + include_path = line.split(" ")[1] + + # prepend directory + include_path = "/".join([src_dir, include_path]) + + preprocess_file(include_path) + continue + + print(line) + + +for i in range(1,argc): + path = sys.argv[i] + + if not os.path.isfile(path): + + print(path + " is not a file") + err = True + continue + + if path in paths: + # ignore duplicates + continue + + paths.append(path) + +if err: + print_usage() + sys.exit(1) + +preprocess_file(sys.argv[1]) + +sys.exit(0) diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f8e57cc --- /dev/null +++ b/readme.md @@ -0,0 +1,11 @@ +# ideas + +* [ ] software +* [ ] blog +* [ ] gallery + * [ ] images + * [ ] captions + +* [ ] graphics + * [ ] a few planets orbit the cursor, or flat color otherwise + when you click on the planets they turn into a context menu ! diff --git a/src/include/header.html b/src/include/header.html new file mode 100644 index 0000000..f99219d --- /dev/null +++ b/src/include/header.html @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/include/planets.html b/src/include/planets.html new file mode 100644 index 0000000..898a143 --- /dev/null +++ b/src/include/planets.html @@ -0,0 +1 @@ +
diff --git a/src/include/sidebar.html b/src/include/sidebar.html new file mode 100644 index 0000000..700addc --- /dev/null +++ b/src/include/sidebar.html @@ -0,0 +1,20 @@ + diff --git a/src/root/about.html b/src/root/about.html new file mode 100644 index 0000000..a4e3503 --- /dev/null +++ b/src/root/about.html @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/about

+
+ + #include sidebar.html + + + + diff --git a/src/root/blog.html b/src/root/blog.html new file mode 100644 index 0000000..b757e01 --- /dev/null +++ b/src/root/blog.html @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/blog

+
+ + #include sidebar.html + + + + diff --git a/src/root/colors.css b/src/root/colors.css new file mode 100644 index 0000000..c7d9035 --- /dev/null +++ b/src/root/colors.css @@ -0,0 +1,14 @@ +:root { + /* Special */ + --background: #eee; + --foreground: #222; + --foreground-inactive: #777; + + /* Colors */ + --color0: #0000ff; + --color1: #00ff00; + --color2: #ff0000; + --color3: #ff00ff; + --color4: #ffff00; + --color5: #00ffff; +} diff --git a/src/root/contact b/src/root/contact new file mode 100644 index 0000000..667b8b5 --- /dev/null +++ b/src/root/contact @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/contact

+
+ + #include sidebar.html + + + + diff --git a/src/root/contact.html b/src/root/contact.html new file mode 100644 index 0000000..667b8b5 --- /dev/null +++ b/src/root/contact.html @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/contact

+
+ + #include sidebar.html + + + + diff --git a/src/root/gallery.html b/src/root/gallery.html new file mode 100644 index 0000000..81c938a --- /dev/null +++ b/src/root/gallery.html @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/gallery

+
+ + #include sidebar.html + + + + diff --git a/src/root/index.html b/src/root/index.html new file mode 100644 index 0000000..5e895af --- /dev/null +++ b/src/root/index.html @@ -0,0 +1,23 @@ + + + + #include header.html + + + ktyl ~ home +
+

ktyl@website

+
+ + #include sidebar.html + +
+

cats stuff

+ +

hi, im cat and i do things and stuff. eventually i want to make this an actual, useful landing page for people interested in me and what i do. unfortunately, im very scatterbrained and not very organised! as a result, this is just one of myriad ongoing projects that i constantly try to chip away at, to varying degrees of success.

+
+ + #include planets.html + + + diff --git a/src/root/main.css b/src/root/main.css new file mode 100644 index 0000000..dcc0f73 --- /dev/null +++ b/src/root/main.css @@ -0,0 +1,164 @@ +@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300&display=swap'); +@import 'colors.css'; + +:root { + --title-height: min(20vmin, 90px); +} + +body { + font-family: 'Ubuntu', sans-serif; + + background-color: var(--background); +} + +.title { + margin-left: 80px; + font-size: 1.4em; +} + +h1 { + font-size: var(--font-size); + color: var(--color1); + padding-bottom: 0; + margin-bottom:0; +} + +ul { + margin-top: 0; + list-style-type: none; +} + +li { + display:inline; + /*padding-left: 1em;*/ + transition: transform 0.2s; +} + +li:hover { + transform: translate(10px); +} + +a.fsText { + position:relative; + text-decoration: none; + background-color: var(--background); + color: var(--foreground-inactive); + + padding: 0 6px; + + transform: scale(1); + transition: background-color 0.2s, color 0.2s, transform 0.2s; +} + +.fsText a { + text-decoration: none; + color: var(--foreground); +} + +a.fsText:hover { + background-color: var(--background); + color: var(--foreground); + + transform: scale(1.1, 1); +} + +.fsText { + --font-size: 1.6em; + font-size: var(--font-size); + color: var(--foreground); +} + +.column { + position: absolute; + width: max(30vmax,500px); + left:50%; + top:var(--title-height); + bottom:0; + padding: 10px 0 0; + background-color: var(--color0); + opacity: 0.7; + + transform: translate(-50%, 0); +} + +.column p { + margin: 0 40px; + padding-top: 20px; + color: #ffffff; +} + +.column h1 { + padding-left: 30px; + padding-top: 10px; + left: 50%; + font-size: 1.3em; +} + +.sidebar { + position: absolute; + left: 15px; + width: max(11vmax, 180px); + top:var(--title-height); + bottom:0; + + background-color: var(--background); + color: var(--foreground); +} + +.sidebarContent { + position: relative; + background-color: var(--background); + top: 50%; + transform: translate(0, -50%); +} + +.sidebar ul { + position: relative; + background-color: var(--background); + padding-left: 30px; +} + +.sidebar li { + display: block; + margin: 5px 0 0 0; +} + +.sidebar li a { + padding: 0 0; + margin-left: -20px; +} + +.socials { + margin-top: 16px; + margin-left: 10px; + background-color:var(--background); +} + +.socials i { + font-size: 2em; + margin-left: 4px; +} + +.socials a { + color: var(--foreground-inactive); + text-decoration: none; + + transition: color 0.3s; +} + +.socials a:hover { + color: var(--foreground); +} + +.planets { + position: absolute; + height: 60vmax; + width: 60vmax; + right: 0; + bottom: 0; + z-index: -1; + + background-color: var(--color2); + + +} diff --git a/src/root/portfolio.html b/src/root/portfolio.html new file mode 100644 index 0000000..06e742b --- /dev/null +++ b/src/root/portfolio.html @@ -0,0 +1,15 @@ + + + +#include header.html + + +
+

ktyl@website/portfolio

+
+ + #include sidebar.html + + + +