diff --git a/app.py b/app.py index 34ea577..07ba560 100644 --- a/app.py +++ b/app.py @@ -2,7 +2,6 @@ from flask import Flask, render_template import contentful from dotenv import load_dotenv import os -import datetime load_dotenv() @@ -25,11 +24,13 @@ def events(): @app.route('/exhibitions') def exhibitions(): - return render_template('list.html', title='Exhibitions') + exhibitions = get_all_content('exhibition') + return render_template('list.html', title='Exhibitions', content=exhibitions) @app.route('/conferences') def conference(): - return render_template('list.html', title='Conferences') + conferences = get_all_content('conference') + return render_template('list.html', title='Conferences', content=conferences) @app.route('//') def event_article(type, title): @@ -38,51 +39,60 @@ def event_article(type, title): def get_all_content(type): - content_list = [] entries = client.entries({'content_type': type}) - for entry in entries: - - date_time_obj = getattr(entry, f'{type}_date_time') - date_str, time_str = format_datetime(date_time_obj) - end_time_str = getattr(entry, f'{type}_end_date_time') - end_time_str = end_time_str.strftime('%I%p').upper().lstrip('0') - content = { - 'title': getattr(entry, f'title_of_{type}'), - 'information': getattr(entry, f'{type}_information'), - 'image': 'https:{0}'.format(getattr(entry, f'{type}_reference_image').url()), - 'artists': getattr(entry, f'{type}_artists'), - 'date': date_str, - 'time': time_str, - 'end_time': end_time_str, - 'location': getattr(entry, f'{type}_location') - } - content_list.append(content) + content_list = process_content(entries, type) return content_list def get_content_by_title(title, pre_type): - print(title) - content_list = [] type = pre_type[:-1] entries = client.entries({'query': title, 'limit': 5}) exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] - for entry in exact_matches: - - date_time_obj = getattr(entry, f'{type}_date_time') - date_str, time_str = format_datetime(date_time_obj) - end_time_str = getattr(entry, f'{type}_end_date_time') - end_time_str = end_time_str.strftime('%I%p').upper().lstrip('0') + content_list = process_content(exact_matches, type) + return content_list + +def process_content(entries, type): + content_list = [] + times = [] + dates = [] + for entry in entries: + if type == 'event': + times = getattr(entry, f'{type}_times') + dates = getattr(entry, f'{type}_dates') + if type == 'conference': + date_time_obj = getattr(entry, f'{type}_start_date_time') + date_str, time_str = format_datetime(date_time_obj) + + try: + end_time_str = getattr(entry, f'{type}_end_date_time') + except: + end_time_str = None + + if end_time_str != None: + end_time_str = end_time_str.strftime('%I%p').upper().lstrip('0') + concat_time_str = time_str + '->' + end_time_str + else: + concat_time_str = time_str + dates.append(date_str) + times.append(concat_time_str) + + try: + bookUrl = getattr(entry, 'book_url') + print(bookUrl) + except: + bookUrl = None + content = { 'title': getattr(entry, f'title_of_{type}'), 'information': getattr(entry, f'{type}_information'), 'image': 'https:{0}'.format(getattr(entry, f'{type}_reference_image').url()), 'artists': getattr(entry, f'{type}_artists'), - 'date': date_str, - 'time': time_str, - 'end_time': end_time_str, - 'location': getattr(entry, f'{type}_location') + 'dates': dates, + 'times': times, + 'location': getattr(entry, f'{type}_location'), + 'bookUrl': bookUrl } + content_list.append(content) - print(content_list) return content_list def format_datetime(dt): diff --git a/public/css/styles.css b/public/css/styles.css index 9ec2dec..f62958c 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -7,7 +7,6 @@ html { body { font-family: 'Inter', sans-serif; - /* background-image: linear-gradient(rgb(255, 255, 255) 50%, #8fc3ff 100%); */ margin: 0; padding: 0; overflow-x: hidden; @@ -36,14 +35,6 @@ a { } hr { - /* border: 0; - clear:both; - display:block; - background-color:#0075FF; - width: 100%; - height: 2px; - z-index: -1000; - margin: 0; */ clear:both; display:block; width: 100%; @@ -111,16 +102,13 @@ hr { gap: 20px; width: fit-content; 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:repeat; border-radius: 30px; padding: 10px; padding-left: 25px; padding-right: 25px; font-family: 'Syne Mono', monospace; - } #hyperlink-container a{ @@ -238,11 +226,11 @@ hr { .page-info-title { font-size: 30px; - font-weight: 600; + font-weight: 500; } .page-info-entry { - font-family: 'Inter', sans-serif; + color: black; font-size: 30px; } @@ -311,10 +299,6 @@ hr { padding-bottom: 20px; } - .nav-element { - - } - #main-text { width: 70%; } @@ -413,11 +397,7 @@ hr { margin-right: 25px; text-align: center; } - - #container { - - } - + #list-container { padding-left: 20px; padding-right: 20px; diff --git a/public/images/test.png b/public/images/blue-and-white.png similarity index 100% rename from public/images/test.png rename to public/images/blue-and-white.png diff --git a/public/images/dither-txt.png b/public/images/dither-txt.png deleted file mode 100644 index ec8ef0b..0000000 Binary files a/public/images/dither-txt.png and /dev/null differ diff --git a/public/images/ditherbw.png b/public/images/ditherbw.png deleted file mode 100644 index 05bc65a..0000000 Binary files a/public/images/ditherbw.png and /dev/null differ diff --git a/public/images/fine.png b/public/images/main-txt.png similarity index 100% rename from public/images/fine.png rename to public/images/main-txt.png diff --git a/public/images/newdither.png b/public/images/newdither.png deleted file mode 100644 index da87491..0000000 Binary files a/public/images/newdither.png and /dev/null differ diff --git a/public/js/list.js b/public/js/list.js index d58c344..d8bda45 100644 --- a/public/js/list.js +++ b/public/js/list.js @@ -16,7 +16,7 @@ import { randFloat } from 'three/src/math/MathUtils.js'; let cubeGroup = [] let instancedMesh, dummy, count - const texture = new THREE.TextureLoader().load("public/images/test.png") + const texture = new THREE.TextureLoader().load("public/images/blue-and-white.png") texture.minFilter = THREE.NearestFilter texture.colorSpace = THREE.SRGBColorSpace; texture.wrapS = THREE.RepeatWrapping; diff --git a/public/js/main.js b/public/js/main.js index 6f77235..77dc6e3 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -12,7 +12,7 @@ let mesh let composer - const texture = new THREE.TextureLoader().load("public/images/fine.png") + const texture = new THREE.TextureLoader().load("public/images/main-txt.png") texture.minFilter = THREE.NearestFilter texture.colorSpace = THREE.SRGBColorSpace; texture.wrapS = THREE.RepeatWrapping; diff --git a/public/js/skybox.js b/public/js/skybox.js index bc306e8..848a43f 100644 --- a/public/js/skybox.js +++ b/public/js/skybox.js @@ -1,5 +1,4 @@ const box = document.getElementById('scroll') -// const hyperlinks = document.getElementsByClassName('hyperlink') let x, y, z function init(){ @@ -14,9 +13,6 @@ function AnimateSkybox(){ 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/article.html b/templates/article.html index 20ac6f4..15e71e9 100644 --- a/templates/article.html +++ b/templates/article.html @@ -12,7 +12,9 @@ <div id="article-title">{{ article.title }}</div> <div id="article-artists">{{ article.artists | join(', ') }}</div> <div id="article-information">{{ article.information }}</div> - <div id="article-book">BOOK ↗</div> + {% if article.bookUrl %} + <a href="{{ article.bookUrl }}" target="_blank"><div id="article-book">BOOK ↗</div></a> + {% endif %} </div> <div id="article-image"> <div id="container-article"></div> @@ -23,14 +25,18 @@ <hr> <div id="page-header"> {% for article in content %} + {% if article.dates %} <div class="page-info-cont"> <div class="page-info-title">/Date:</div> - <div class="page-info-entry">{{ article.date }}</div> + <div class="page-info-entry">{{ article.dates | join(', ') }}</div> </div> + {% endif %} + {% if article.times%} <div class="page-info-cont"> <div class="page-info-title">/Time:</div> - <div class="page-info-entry">{{ article.time }}</div> + <div class="page-info-entry">{{ article.times | join(', ') }}</div> </div> + {% endif %} <div class="page-info-cont"> <div class="page-info-title">/Location:</div> <div class="page-info-entry">{{ article.location[0] }}</div> diff --git a/templates/base.html b/templates/base.html index f75ddcc..e0be206 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,9 +3,13 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta name="description" content="Art and Technology Festival Ireland 2024" /> + <meta name="og:description" content="The Beta Festival 2024 catalogue showcasing and archiving all exhibitions, events, and conferences which will be on as part of this years festival." /> + <meta name="description" content="The Beta Festival 2024 catalogue showcasing and archiving all exhibitions, events, and conferences which will be on as part of this years festival." /> + <meta content="Beta Festival 2024" property="og:title"/> + <meta content="Beta Festival 2024" property="og:site_name"/> + <meta content="website" property="og:type"/> <meta name="keywords" content="beta festival, 2024, dublin, art and technology, digital art" /> - <meta name="robots" content="index,follow" /> + <meta name="robots" content="all" /> <meta name="language" content="en-ie" /> <title>Beta Festival 2024 {% block title %}{% endblock %} diff --git a/templates/list.html b/templates/list.html index 2ad2625..291aa91 100644 --- a/templates/list.html +++ b/templates/list.html @@ -23,8 +23,13 @@

[{{ event.artists | join(', ') }}]

-
● {{ event.date }}
-
● {{ event.time }}→{{ event.end_time }}
+ {% if event.dates %} +
● {{ event.dates | join(', ') }}
+ {% endif %} + {% if event.times %} +
● {{ event.times | join(', ')}}
+ {% endif %} +
● {{ event.location[0] }}