diff --git a/gesture/.env b/gesture/.env new file mode 100644 index 0000000..a516326 --- /dev/null +++ b/gesture/.env @@ -0,0 +1,2 @@ +GESTURE_APPLICATION_ROOT=/breadcube/gesture +GESTURE_PORTNUMBER=5002 diff --git a/gesture/Makefile b/gesture/Makefile new file mode 100644 index 0000000..eb2ac03 --- /dev/null +++ b/gesture/Makefile @@ -0,0 +1,10 @@ +include .env +export + +default: local + +local: + @flask run --debug + +breadcube: + @SCRIPT_NAME=${GESTURE_APPLICATION_ROOT} gunicorn -b localhost:${GESTURE_PORTNUMBER} --reload app:app diff --git a/gesture/__pycache__/app.cpython-310.pyc b/gesture/__pycache__/app.cpython-310.pyc index f9b6d1e..d914c6a 100644 Binary files a/gesture/__pycache__/app.cpython-310.pyc and b/gesture/__pycache__/app.cpython-310.pyc differ diff --git a/gesture/app.py b/gesture/app.py index 05db0a9..09619ec 100644 --- a/gesture/app.py +++ b/gesture/app.py @@ -2,15 +2,17 @@ from flask import Flask, request, redirect, render_template import os app = Flask(__name__) +app.config.from_pyfile('settings.py') + UPLOAD_FOLDER = os.path.join("static", "media") media = { "beer.gif": ["beer"], "bell.gif": ["beer", "cafe de bel", "bell"], "box.gif": ["box"], - "cafe-de-bel": ["coffee", "bell", "beer", "cafe de bel"], + "cafe-de-bel.gif": ["coffee", "bell", "beer", "cafe de bel"], "cloud-storm.gif": ["cloud", "storm"], "cloud.gif": ["cloud"], - "coffee.gif": ["coffee", "cafe fe bel"], + "coffee.gif": ["coffee", "cafe de bel"], "er-beer.gif": ["emergency beer"], "hands.gif": ["joking", "okay", "sure"], "hurry.gif": ["time", "hurry", "pebbles"], @@ -20,13 +22,20 @@ media = { "pdf-impose.gif": ["pdf impose", "makarena"], "pebbles.gif": ["time", "clockwise", "anticlockwise"], "strike.gif": ["strike", "worker", "woman", "operator"] - } -# media = ["operator", "worker", "woman"] @app.route("/") def home(): - text = ["operator", "worker", "operator strike", "strike", "(k)not","pebbles","time","hurry","clockwise","anticlockwise","cloud","teletype","box","emergency beer","beer","cafe de bel","coffee","bell","food","breakfast","I love you"] + text = [] + for x in media: + for y in media[x]: + print(y) + if y not in text: + text.append(y) + # print("added") + # print(text) + else: + print("already there") return render_template("template-index.html", text=text) @app.route("/") @@ -37,4 +46,4 @@ def word(word): wordmedia.append(item) print("wordmedia: ") print(wordmedia) - return render_template("template-word.html", word=word, wordmedia=wordmedia, media=media, path=UPLOAD_FOLDER) \ No newline at end of file + return render_template("template-word.html", word=word, wordmedia=wordmedia, media=media, path=UPLOAD_FOLDER) diff --git a/gesture/settings.py b/gesture/settings.py new file mode 100644 index 0000000..695ea4e --- /dev/null +++ b/gesture/settings.py @@ -0,0 +1,10 @@ +import os +from dotenv import main + +# Load environment variables from the .env file +main.load_dotenv() + +# Bind them to Python variables +APPLICATION_ROOT = os.environ.get('GESTURE_APPLICATION_ROOT', '/') +PORTNUMBER = int(os.environ.get('GESTURE_PORTNUMBER', 5001)) + diff --git a/gesture/static/media/img1.png b/gesture/static/img1.png similarity index 100% rename from gesture/static/media/img1.png rename to gesture/static/img1.png diff --git a/gesture/static/media/img2.png b/gesture/static/img2.png similarity index 100% rename from gesture/static/media/img2.png rename to gesture/static/img2.png diff --git a/gesture/static/media/img3.png b/gesture/static/img3.png similarity index 100% rename from gesture/static/media/img3.png rename to gesture/static/img3.png diff --git a/gesture/static/media/pebbels.gif b/gesture/static/media/pebbles.gif similarity index 100% rename from gesture/static/media/pebbels.gif rename to gesture/static/media/pebbles.gif diff --git a/gesture/static/style.css b/gesture/static/style.css index 00ffaa5..17c531c 100644 --- a/gesture/static/style.css +++ b/gesture/static/style.css @@ -12,6 +12,7 @@ body{ font-size: 1.5rem; margin: 2rem auto; max-width: 60rem; + padding: 1rem; } .button{ font-family: monospace; @@ -19,15 +20,18 @@ body{ border-radius: 2em; background: var(--color2); color: var(--color1); + border: none; + margin: 0 0.25rem 0.25rem 0; } button:after{ content: " →"; break-before: avoid; } +h1.button{font-size: 1.4rem;} .button:hover{opacity: 0.7; cursor: pointer;} .close{float: right; text-decoration: none;} .close:hover{opacity: 0.7} -img{max-width: 100%; margin-bottom: 1rem;} +img{width: 100%; margin-bottom: 1rem;} input{ margin: 0 0 0.5rem; } @@ -61,6 +65,7 @@ textarea{ max-width: calc(50% - 4rem); float: left; padding-right: 2rem; + margin: 1rem 0; } - +p{font-size: 1rem;} diff --git a/gesture/templates/template-index.html b/gesture/templates/template-index.html index 0bc7735..5552f58 100644 --- a/gesture/templates/template-index.html +++ b/gesture/templates/template-index.html @@ -5,7 +5,8 @@

gesture glossary ✌️

-

This is the home page for the gesture glossary. It has every word in the glossary to the right. Click a word to visit its page. This is the introduction.

+

This is the the gesture glossary. Click a word to the right to see the gestures related to it.

+

The aim is to see if a gesture glossary works and how it will work best. Also to see what kind of different interpretations there will be on gestures of our memory. To test the gesture glossary idea, and see what different meanings appear or already exist in the current vocabulary. Putting next to each other different agreements on linguistic and body units, testing what makes sense. Investigating and playing with communicational channel in between us, how a body language is documented, how it expands, how it is capable of creating or enhancing identities. To be an xpub means to speak/perform the xpub language?

{% for word in text diff --git a/gesture/templates/template-word.html b/gesture/templates/template-word.html index c3ae93e..340b47a 100644 --- a/gesture/templates/template-word.html +++ b/gesture/templates/template-word.html @@ -6,7 +6,7 @@

{{word}} x

{% for file in wordmedia %}
-

Video {{file}}

+ {% for tag in media[file]