diff --git a/src/index.py b/src/index.py index cbd2598..afda2a2 100644 --- a/src/index.py +++ b/src/index.py @@ -31,11 +31,7 @@ def error(code): 503: 'Our website is experiencing some issues and will be back shortly.', 505: 'Your browser tried to use a HTTP version we don\'t support. Check it is up to date.' } - errorText = f''' -
-

{code}: {error_definitions.get(int(code))}

-

{error_desc.get(int(code))}

- Click here to return to our homepage -
- ''' - return render_template('error.html', post=errorText) \ No newline at end of file + + return render_template('error.html', code=code, + description=error_definitions.get(int(code)), + long_description=error_desc.get(int(code))) \ No newline at end of file diff --git a/src/projects.py b/src/projects.py index 18877c8..394d2ef 100644 --- a/src/projects.py +++ b/src/projects.py @@ -58,13 +58,13 @@ def projects(): with open(path.join(md_directory, 'categories.json')) as categories_file: categories = json.load(categories_file) - return render_template('projects.html', articles=articles_to_return, all_categories=categories) + return render_template('projects.html', articles=articles_to_return, all_categories=categories, title='Projects', description='A selection of projects I\'ve been involved in') @app.route('/projects/category//') def category(category): with open(path.join(md_directory, 'categories.json')) as categories_file: categories = json.load(categories_file) - + print(categories) the_category = categories.get(category) if the_category is None: diff --git a/src/static/js/filter_projects.js b/src/static/js/filter_projects.js index 1268f70..6d772e0 100644 --- a/src/static/js/filter_projects.js +++ b/src/static/js/filter_projects.js @@ -1,11 +1,10 @@ -window.onload = function () { +function update_filter() { var project_filter = document.getElementById("filter_category"); - project_filter.onchange = function () { - if (project_filter.value == 'all') { - window.location.href = '/projects'; - } - else { - window.location.href = '/projects/category/' + project_filter.value; - } + console.log(project_filter.value) + if (project_filter.value == 'all') { + window.location.href = '/projects'; } -} \ No newline at end of file + else { + window.location.href = '/projects/category/' + project_filter.value; + } +} diff --git a/src/static/js/update_copyright.js b/src/static/js/update_copyright.js new file mode 100644 index 0000000..1ee3772 --- /dev/null +++ b/src/static/js/update_copyright.js @@ -0,0 +1,5 @@ +window.onload = function () { + var current_year = new Date().getFullYear(); + var copyright = document.getElementById('cr-year'); + copyright.textContent = current_year; +} \ No newline at end of file diff --git a/src/static/style/desktop.css b/src/static/style/desktop.css index ed53e09..7e89217 100644 --- a/src/static/style/desktop.css +++ b/src/static/style/desktop.css @@ -48,4 +48,11 @@ width: 20vw; height: 25vw; } + + #top-nav{ + float: right; + width: fit-content; + padding-top: 20px; + padding-right: 20px; + } } \ No newline at end of file diff --git a/src/static/style/mobile.css b/src/static/style/mobile.css index 05e0cbd..7c5ea9a 100644 --- a/src/static/style/mobile.css +++ b/src/static/style/mobile.css @@ -5,10 +5,6 @@ body{ background-color: rgba(23, 22, 20, 1); } -main{ - padding: 0 10px 0 10px; -} - h1, h2, h3{ font-family: "Orbitron", sans-serif; font-optical-sizing: auto; @@ -17,17 +13,23 @@ h1, h2, h3{ } header{ - width: 100%; - height: 25vh; - display: flex; - align-items: center; background-color: 4c4c4c; + height: 25vh; + width: 100%; } footer{ background-color: 4c4c4c; - padding: 30px; - text-align: center; + display: flex; + justify-content: center; + align-items: center; + height: 10vh; +} + +#logo-container{ + width: 100%; + justify-content: center; + display: flex; } #logo{ @@ -111,4 +113,40 @@ a{ width: 80vw; border: 2px solid #e5e5e5; margin: 10px; +} + +.project-thumb{ + max-width: 100%; + max-height: 100%; +} + +#filter { + float: right; +} + +#top-nav{ + width: 100%; + text-align: center; + padding-bottom: 30px; +} + +#top-nav>a{ + text-decoration: none; + padding: 0 10px 0 10px; + font-weight: bold; +} + +#top-nav>a:hover{ + text-decoration: underline; +} + +#error-container{ + display: flex; + align-items: center; + justify-content: center; + height: 65vh; +} + +#error{ + text-align: center; } \ No newline at end of file diff --git a/src/templates/error.html b/src/templates/error.html index c47ef22..4c405c0 100644 --- a/src/templates/error.html +++ b/src/templates/error.html @@ -1,5 +1,11 @@ {% include 'header.html' %} -
- {{ post | safe }} -
+
+
+
+

{{ code }}: {{ description }}

+

{{ long_description }}

+ Click here to return to our homepage +
+
+
{% include 'footer.html' %} \ No newline at end of file diff --git a/src/templates/footer.html b/src/templates/footer.html index 56cdd8e..4fb12d8 100644 --- a/src/templates/footer.html +++ b/src/templates/footer.html @@ -1,5 +1,5 @@ diff --git a/src/templates/header.html b/src/templates/header.html index b32347b..3939e7f 100644 --- a/src/templates/header.html +++ b/src/templates/header.html @@ -11,10 +11,17 @@ +
-
diff --git a/src/templates/projects.html b/src/templates/projects.html index cb1709c..001b5ed 100644 --- a/src/templates/projects.html +++ b/src/templates/projects.html @@ -2,7 +2,7 @@