From 96d354190fa11c3afba3c2fc5e327ef43f02e0dd Mon Sep 17 00:00:00 2001 From: Cailean Finn Date: Wed, 26 Jun 2024 13:26:17 +0100 Subject: [PATCH] created templates --- app.py | 14 +++++++++++++- public/css/styles.css | 32 ++++++++++++++++++++------------ public/js/skybox.js | 8 +++++++- templates/_nav.html | 5 +++++ templates/base.html | 23 +++++++++++++++++++++++ templates/index.html | 39 ++++++++++----------------------------- templates/list.html | 14 ++++++++++++++ 7 files changed, 92 insertions(+), 43 deletions(-) create mode 100644 templates/_nav.html create mode 100644 templates/base.html create mode 100644 templates/list.html diff --git a/app.py b/app.py index b69fdbc..84590ae 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,19 @@ client = contentful.Client(SPACE_ID, ACCESS_TOKEN) @app.route('/') def index(): - return render_template('index.html') + return render_template('index.html', title='Homepage') + +@app.route('/events') +def events(): + return render_template('list.html', title='Events') + +@app.route('/exhibitions') +def exhibitions(): + return render_template('list.html', title='Exhibitions') + +@app.route('/conferences') +def conference(): + return render_template('list.html', title='Conferences') def get_all_content(type): content_list = [] diff --git a/public/css/styles.css b/public/css/styles.css index 301daea..c7529ae 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -11,6 +11,7 @@ body { margin: 0; padding: 0; overflow-x: hidden; + overflow-y: hidden; } #scroll { @@ -41,12 +42,14 @@ hr { width: 100%; height: 2px; z-index: -1000; + margin: 0; } #main-wrapper { display: flex; flex-direction: column; - min-height: 100vh; + height: 100vh; + overflow-y: hidden; } #nav-bar { @@ -66,13 +69,15 @@ hr { } #main-container { - margin-top: 25px; + padding-top: 25px; display: flex; flex-direction: column; gap: 50px; - margin-bottom: 50px; - margin-left: 50px; - margin-right: 50px; + padding-bottom: 50px; + padding-left: 50px; + padding-right: 50px; + overflow-y: scroll; + box-sizing: border-box; /* Include padding in the height calculation */ } #main-text { @@ -96,11 +101,11 @@ hr { flex-direction: row; gap: 20px; width: fit-content; - /* background-color: #0075FF; */ - background-image: url('/public/images/dither-txt.png'); + background-color: #0075FF; + /* background-image: url('/public/images/dither-txt.png'); */ background-size: cover; /* or contain, depending on your preference */ - background-position: center; - background-repeat: no-repeat; + /* background-position: center; */ + background-repeat:repeat; border-radius: 30px; padding: 10px; padding-left: 25px; @@ -159,6 +164,7 @@ hr { flex-direction: column; text-align: center; gap: 5px; + height: 75px; } .nav-element { @@ -166,9 +172,9 @@ hr { } #main-container { - flex-direction: column-reverse; - margin-left: 10px; - margin-right: 10px; + /* flex-direction: column-reverse; */ + padding-left: 10px; + padding-right: 10px; } #main-text { font-size: 18px; @@ -179,6 +185,7 @@ hr { margin-left: auto; margin-right: auto; mix-blend-mode:multiply; + order: 2; } @@ -188,6 +195,7 @@ hr { width: 100%; padding-left: 0px; align-items: normal; + order: 1; } .hyperlink { diff --git a/public/js/skybox.js b/public/js/skybox.js index ad7beab..bc306e8 100644 --- a/public/js/skybox.js +++ b/public/js/skybox.js @@ -1,16 +1,22 @@ const box = document.getElementById('scroll') -let x, y +// const hyperlinks = document.getElementsByClassName('hyperlink') +let x, y, z function init(){ x = 0 y = 0 + z = 0 AnimateSkybox() } function AnimateSkybox(){ x += 0.2 y = window.innerHeight / 2.2 + z += 0.2 box.style.backgroundPosition = x + "px " + y + "px" + // for (let i = 0; i < hyperlinks.length; i++) { + // hyperlinks[i].style.backgroundPosition = x / 4 + "px " + z + "px"; + // } requestAnimationFrame(AnimateSkybox) } diff --git a/templates/_nav.html b/templates/_nav.html new file mode 100644 index 0000000..7567ca5 --- /dev/null +++ b/templates/_nav.html @@ -0,0 +1,5 @@ + +
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..159990f --- /dev/null +++ b/templates/base.html @@ -0,0 +1,23 @@ + + + + + + Beta Festival 2024 | {% block title %}{% endblock %} + + + + + {% block content %} + {% endblock %} + + diff --git a/templates/index.html b/templates/index.html index a52cf9e..3e49fa3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,28 +1,10 @@ - - - - - - Beta Festival 2024 - - - - +{% extends "base.html" %} + +{% block title %}{{ title }}{% endblock %} + +{% block content %}
- -
+ {% include '_nav.html' %}

@@ -30,15 +12,15 @@