From 910f395e6aee59afe942e628ac8ab3b141286c39 Mon Sep 17 00:00:00 2001 From: ditaajipratama Date: Wed, 5 Jun 2024 23:18:20 +0700 Subject: [PATCH] add template --- html/footer.html | 3 +++ html/index.html | 20 +++++++++++++++ html/navbar.html | 9 +++++++ main.py | 18 ++++++++++++++ static/css/style.css | 54 ++++++++++++++++++++++++++++++++++++++++ static/css/style.css.map | 1 + static/css/style.scss | 49 ++++++++++++++++++++++++++++++++++++ 7 files changed, 154 insertions(+) create mode 100644 html/footer.html create mode 100644 html/index.html create mode 100644 html/navbar.html create mode 100644 main.py create mode 100644 static/css/style.css create mode 100644 static/css/style.css.map create mode 100644 static/css/style.scss diff --git a/html/footer.html b/html/footer.html new file mode 100644 index 0000000..02a22e3 --- /dev/null +++ b/html/footer.html @@ -0,0 +1,3 @@ + diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..6e47ce5 --- /dev/null +++ b/html/index.html @@ -0,0 +1,20 @@ + + + + + + + ${title} + + + +
+

${header}

+
+ ${navbar} +
+ ${container} +
+ ${footer} + + diff --git a/html/navbar.html b/html/navbar.html new file mode 100644 index 0000000..87d0c05 --- /dev/null +++ b/html/navbar.html @@ -0,0 +1,9 @@ + diff --git a/main.py b/main.py new file mode 100644 index 0000000..3f6d339 --- /dev/null +++ b/main.py @@ -0,0 +1,18 @@ +from core import html + +static = [ + { + "route" : "/templates/plain/css/", + "root" : "./templates/plain/static/css" + } +] + +def main(dir, page): + html_template = html.main.get_html("templates/plain/html") + html_page = html.main.get_html(dir) + return { + "index" : html_template [ "index.html" ], + "navbar" : html_template [ "navbar.html" ], + "footer" : html_template [ "footer.html" ], + "container" : html_page [f"{page}.html" ] + } diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..29b881f --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,54 @@ +body { + font-family: "Arial", sans-serif; + margin: 0; + padding: 0; + color: #333; + background-color: #f4f4f4; +} + +header { + background-color: #4CAF50; + padding: 20px; + text-align: center; + color: #fff; +} + +.navbar { + display: flex; + background-color: #333; + justify-content: center; + padding: 10px; +} + +.navbar a { + color: #fff; + padding: 14px 20px; + text-decoration: none; + text-align: center; +} + +.navbar a:hover { + background-color: #ddd; + color: #000; +} + +.navbar a.active { + background-color: #4CAF50; + color: #fff; +} + +main { + padding: 20px; +} + +footer { + background-color: #333; + color: #fff; + text-align: center; + padding: 10px; + position: fixed; + width: 100%; + bottom: 0; +} + +/*# sourceMappingURL=style.css.map */ diff --git a/static/css/style.css.map b/static/css/style.css.map new file mode 100644 index 0000000..e9185fd --- /dev/null +++ b/static/css/style.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["style.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA","file":"style.css"} \ No newline at end of file diff --git a/static/css/style.scss b/static/css/style.scss new file mode 100644 index 0000000..5f30cb4 --- /dev/null +++ b/static/css/style.scss @@ -0,0 +1,49 @@ +body { + font-family: 'Arial', sans-serif; + margin: 0; + padding: 0; + color: #333; + background-color: #f4f4f4; +} + +header { + background-color: #4CAF50; + padding: 20px; + text-align: center; + color: #fff; +} + +.navbar { + display: flex; + background-color: #333; + justify-content: center; + padding: 10px; +} +.navbar a { + color: #fff; + padding: 14px 20px; + text-decoration: none; + text-align: center; +} +.navbar a:hover { + background-color: #ddd; + color: #000; +} +.navbar a.active { + background-color: #4CAF50; + color: #fff; +} + +main { + padding: 20px; +} + +footer { + background-color: #333; + color: #fff; + text-align: center; + padding: 10px; + position: fixed; + width: 100%; + bottom: 0; +}