Browse Source

cleanup

graphics
Cailean Finn 4 months ago
parent
commit
5035ea5b9d
  1. 78
      app.py
  2. 26
      public/css/styles.css
  3. 0
      public/images/blue-and-white.png
  4. BIN
      public/images/dither-txt.png
  5. BIN
      public/images/ditherbw.png
  6. 0
      public/images/main-txt.png
  7. BIN
      public/images/newdither.png
  8. 2
      public/js/list.js
  9. 2
      public/js/main.js
  10. 4
      public/js/skybox.js
  11. 12
      templates/article.html
  12. 8
      templates/base.html
  13. 9
      templates/list.html

78
app.py

@ -2,7 +2,6 @@ from flask import Flask, render_template
import contentful import contentful
from dotenv import load_dotenv from dotenv import load_dotenv
import os import os
import datetime
load_dotenv() load_dotenv()
@ -25,11 +24,13 @@ def events():
@app.route('/exhibitions') @app.route('/exhibitions')
def 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') @app.route('/conferences')
def conference(): 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('/<type>/<title>') @app.route('/<type>/<title>')
def event_article(type, title): def event_article(type, title):
@ -38,51 +39,60 @@ def event_article(type, title):
def get_all_content(type): def get_all_content(type):
content_list = []
entries = client.entries({'content_type': type}) entries = client.entries({'content_type': type})
for entry in entries: content_list = process_content(entries, type)
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)
return content_list return content_list
def get_content_by_title(title, pre_type): def get_content_by_title(title, pre_type):
print(title)
content_list = []
type = pre_type[:-1] type = pre_type[:-1]
entries = client.entries({'query': title, 'limit': 5}) entries = client.entries({'query': title, 'limit': 5})
exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title]
for entry in exact_matches: content_list = process_content(exact_matches, type)
return content_list
date_time_obj = getattr(entry, f'{type}_date_time')
date_str, time_str = format_datetime(date_time_obj) def process_content(entries, type):
end_time_str = getattr(entry, f'{type}_end_date_time') content_list = []
end_time_str = end_time_str.strftime('%I%p').upper().lstrip('0') 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 = { content = {
'title': getattr(entry, f'title_of_{type}'), 'title': getattr(entry, f'title_of_{type}'),
'information': getattr(entry, f'{type}_information'), 'information': getattr(entry, f'{type}_information'),
'image': 'https:{0}'.format(getattr(entry, f'{type}_reference_image').url()), 'image': 'https:{0}'.format(getattr(entry, f'{type}_reference_image').url()),
'artists': getattr(entry, f'{type}_artists'), 'artists': getattr(entry, f'{type}_artists'),
'date': date_str, 'dates': dates,
'time': time_str, 'times': times,
'end_time': end_time_str, 'location': getattr(entry, f'{type}_location'),
'location': getattr(entry, f'{type}_location') 'bookUrl': bookUrl
} }
content_list.append(content) content_list.append(content)
print(content_list)
return content_list return content_list
def format_datetime(dt): def format_datetime(dt):

26
public/css/styles.css

@ -7,7 +7,6 @@ html {
body { body {
font-family: 'Inter', sans-serif; font-family: 'Inter', sans-serif;
/* background-image: linear-gradient(rgb(255, 255, 255) 50%, #8fc3ff 100%); */
margin: 0; margin: 0;
padding: 0; padding: 0;
overflow-x: hidden; overflow-x: hidden;
@ -36,14 +35,6 @@ a {
} }
hr { hr {
/* border: 0;
clear:both;
display:block;
background-color:#0075FF;
width: 100%;
height: 2px;
z-index: -1000;
margin: 0; */
clear:both; clear:both;
display:block; display:block;
width: 100%; width: 100%;
@ -111,16 +102,13 @@ hr {
gap: 20px; gap: 20px;
width: fit-content; width: fit-content;
background-color: #0075FF; background-color: #0075FF;
/* background-image: url('/public/images/dither-txt.png'); */
background-size: cover; /* or contain, depending on your preference */ background-size: cover; /* or contain, depending on your preference */
/* background-position: center; */
background-repeat:repeat; background-repeat:repeat;
border-radius: 30px; border-radius: 30px;
padding: 10px; padding: 10px;
padding-left: 25px; padding-left: 25px;
padding-right: 25px; padding-right: 25px;
font-family: 'Syne Mono', monospace; font-family: 'Syne Mono', monospace;
} }
#hyperlink-container a{ #hyperlink-container a{
@ -238,11 +226,11 @@ hr {
.page-info-title { .page-info-title {
font-size: 30px; font-size: 30px;
font-weight: 600; font-weight: 500;
} }
.page-info-entry { .page-info-entry {
font-family: 'Inter', sans-serif;
color: black; color: black;
font-size: 30px; font-size: 30px;
} }
@ -311,10 +299,6 @@ hr {
padding-bottom: 20px; padding-bottom: 20px;
} }
.nav-element {
}
#main-text { #main-text {
width: 70%; width: 70%;
} }
@ -413,11 +397,7 @@ hr {
margin-right: 25px; margin-right: 25px;
text-align: center; text-align: center;
} }
#container {
}
#list-container { #list-container {
padding-left: 20px; padding-left: 20px;
padding-right: 20px; padding-right: 20px;

0
public/images/test.png → public/images/blue-and-white.png

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

BIN
public/images/dither-txt.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

BIN
public/images/ditherbw.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

0
public/images/fine.png → public/images/main-txt.png

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

BIN
public/images/newdither.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

2
public/js/list.js

@ -16,7 +16,7 @@ import { randFloat } from 'three/src/math/MathUtils.js';
let cubeGroup = [] let cubeGroup = []
let instancedMesh, dummy, count 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.minFilter = THREE.NearestFilter
texture.colorSpace = THREE.SRGBColorSpace; texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping; texture.wrapS = THREE.RepeatWrapping;

2
public/js/main.js

@ -12,7 +12,7 @@
let mesh let mesh
let composer 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.minFilter = THREE.NearestFilter
texture.colorSpace = THREE.SRGBColorSpace; texture.colorSpace = THREE.SRGBColorSpace;
texture.wrapS = THREE.RepeatWrapping; texture.wrapS = THREE.RepeatWrapping;

4
public/js/skybox.js

@ -1,5 +1,4 @@
const box = document.getElementById('scroll') const box = document.getElementById('scroll')
// const hyperlinks = document.getElementsByClassName('hyperlink')
let x, y, z let x, y, z
function init(){ function init(){
@ -14,9 +13,6 @@ function AnimateSkybox(){
y = window.innerHeight / 2.2 y = window.innerHeight / 2.2
z += 0.2 z += 0.2
box.style.backgroundPosition = x + "px " + y + "px" 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) requestAnimationFrame(AnimateSkybox)
} }

12
templates/article.html

@ -12,7 +12,9 @@
<div id="article-title">{{ article.title }}</div> <div id="article-title">{{ article.title }}</div>
<div id="article-artists">{{ article.artists | join(', ') }}</div> <div id="article-artists">{{ article.artists | join(', ') }}</div>
<div id="article-information">{{ article.information }}</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>
<div id="article-image"> <div id="article-image">
<div id="container-article"></div> <div id="container-article"></div>
@ -23,14 +25,18 @@
<hr> <hr>
<div id="page-header"> <div id="page-header">
{% for article in content %} {% for article in content %}
{% if article.dates %}
<div class="page-info-cont"> <div class="page-info-cont">
<div class="page-info-title">/Date:</div> <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> </div>
{% endif %}
{% if article.times%}
<div class="page-info-cont"> <div class="page-info-cont">
<div class="page-info-title">/Time:</div> <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> </div>
{% endif %}
<div class="page-info-cont"> <div class="page-info-cont">
<div class="page-info-title">/Location:</div> <div class="page-info-title">/Location:</div>
<div class="page-info-entry">{{ article.location[0] }}</div> <div class="page-info-entry">{{ article.location[0] }}</div>

8
templates/base.html

@ -3,9 +3,13 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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="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" /> <meta name="language" content="en-ie" />
<title>Beta Festival 2024 {% block title %}{% endblock %}</title> <title>Beta Festival 2024 {% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">

9
templates/list.html

@ -23,8 +23,13 @@
<p>[{{ event.artists | join(', ') }}]</p> <p>[{{ event.artists | join(', ') }}]</p>
</div> </div>
<div class="list-details"> <div class="list-details">
<div class="list-date">● {{ event.date }}</div> {% if event.dates %}
<div class="list-date">● {{ event.time }}→{{ event.end_time }}</div> <div class="list-date">● {{ event.dates | join(', ') }}</div>
{% endif %}
{% if event.times %}
<div class="list-date">● {{ event.times | join(', ')}}</div>
{% endif %}
<div class="list-date">● {{ event.location[0] }}</div> <div class="list-date">● {{ event.location[0] }}</div>
</div> </div>
</div> </div>

Loading…
Cancel
Save