Browse Source

cleanup

graphics
Cailean Finn 6 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
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('/<type>/<title>')
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):

26
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;

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 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;

2
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;

4
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)
}

12
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>

8
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 %}</title>
<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>
</div>
<div class="list-details">
<div class="list-date">● {{ event.date }}</div>
<div class="list-date">● {{ event.time }}→{{ event.end_time }}</div>
{% if event.dates %}
<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>
</div>

Loading…
Cancel
Save