From 0d70c65a49804f1210554a2fe08dd94631bb9bd1 Mon Sep 17 00:00:00 2001 From: Stephen Kerr Date: Tue, 20 Jun 2023 16:19:58 +0200 Subject: [PATCH] a gesture --- gesture/__pycache__/app.cpython-310.pyc | Bin 0 -> 1185 bytes gesture/app.py | 27 ++++++++++ gesture/static/media/img1.png | Bin 0 -> 2156 bytes gesture/static/media/img2.png | Bin 0 -> 2418 bytes gesture/static/media/img3.png | Bin 0 -> 2420 bytes gesture/static/style.css | 66 ++++++++++++++++++++++++ gesture/templates/template-index.html | 16 ++++++ gesture/templates/template-word.html | 18 +++++++ 8 files changed, 127 insertions(+) create mode 100644 gesture/__pycache__/app.cpython-310.pyc create mode 100644 gesture/app.py create mode 100644 gesture/static/media/img1.png create mode 100644 gesture/static/media/img2.png create mode 100644 gesture/static/media/img3.png create mode 100644 gesture/static/style.css create mode 100644 gesture/templates/template-index.html create mode 100644 gesture/templates/template-word.html diff --git a/gesture/__pycache__/app.cpython-310.pyc b/gesture/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9b6d1e3ff298f2463ad4a2447050ec40ffae64f GIT binary patch literal 1185 zcmZ8g&5qkP5GEx`mc9N-lcr4y6!5V+#6h-24?&P7&1QoDK@xPaKtQN4WN~aOmPCc3 zcGrd%D3D%z=skzsz2yP=GQ8&0S1@|$Q0^{@5a95e84hRk%}Dlo9fIrGUw?`bBjl4+ z{=Ym_9^tN5CS31^dV!Ryh#2AbQl`g;pvIG@tsWyX4H2lxy z)kP|ckZt;qgPK8+EQb>SWtf$log|*ZPypI8Ysxat7KPNItJ+wg@sFiifa2b<%wv3J z6{Pv>-l!~Q4ccu`-$vXyN(IPKUjEQ{zPFwYy_?wYyj&Ckc7;5_U44lHxuX~KlxSpp zO@#Z0<%YcsZ#LQ0HN2v1Lsfuc<$t#bF%xfQAiKtl$4Sps(_@aaoSarD1cKgDtYM9YNnC($0E& zy0#x{jMEIe;x%1a?bvM1?A;%(u3xcWtqln{k<2QleRWaUQVc6&JrBLD;^SB0WE-zk zX`vgsOz-gZi&u~L#`~{c>^=Pjhwm1KsoPC#iisK`x8f`7v2IIoWhaC=0qxQbb$$zI zK(Eur8xD*&wZE2fY=C7&S@yR199fxQJTBrK#$)4RMd}-L8unJEh5FXsYYO+2tTi-j rZ%eWb{j3-hJjkV}Gk9p*P}z5G5v;`NQ{V9^qdxWj34#s{SfBn2;ioX@ literal 0 HcmV?d00001 diff --git a/gesture/app.py b/gesture/app.py new file mode 100644 index 0000000..a9cd8d9 --- /dev/null +++ b/gesture/app.py @@ -0,0 +1,27 @@ +from flask import Flask, request, redirect, render_template +import os + +app = Flask(__name__) +UPLOAD_FOLDER = os.path.join("static", "media") +media = { + "img1.png": ["strike", "operator", "operator strike", "union"], + "img2.png": ["emergency beer", "beer", "cafe de bel", "bell"], + "knot-video.mp4": ["knot"], + "img3.png": ["operator", "worker", "woman"] +} +# 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"] + return render_template("template-index.html", text=text) + +@app.route("/") +def word(word): + wordmedia = [] + for item in media: + if word in media[item]: + 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 diff --git a/gesture/static/media/img1.png b/gesture/static/media/img1.png new file mode 100644 index 0000000000000000000000000000000000000000..fee4b451f329a98e3cee7592512890f7c684785d GIT binary patch literal 2156 zcmeAS@N?(olHy`uVBq!ia0y~yV0sF~oE%I*k=}b(0)P}_age(c!@6@aFM%AEbVpxD z28NCO+G+x5o{6859^;4F8;VkTtpy ze~{OA*OxiJ85k~oV_-0?W@wmY%iwTUj$uI>KSRJ~c7_!h($ literal 0 HcmV?d00001 diff --git a/gesture/static/media/img2.png b/gesture/static/media/img2.png new file mode 100644 index 0000000000000000000000000000000000000000..59929fd2423ffdea462bedc8fb16676fd741eeb2 GIT binary patch literal 2418 zcmeAS@N?(olHy`uVBq!ia0y~yV0sF~oE%I*k=}b(0)P}_age(c!@6@aFM%AEbVpxD z28NCO+zhkFfwrbj$>q4^@ocg;CVPhgVlZ}hATfs85W#d&%jVx$I7tcvo?dn+;~QY zSEEWs!(}uvjAoM2l3}zs9IYls>&79}Ah>;ozp#pR`Bc!NJZS+Yle&m6a)?&SZ?=WJ%jg) z7fl^J<=#3eb9b{dD7>j=Wmxe^o55jjJR`%aKU@p}&%+rStoAc8T=^-=u;AQ!28Pl) zppws{N=CzFG%<{3lF^c3v^X5CCPwSVq0=D9HMTDbVLdg!;^-$}ONqhL)z4*}Q$iB} DJKuGv literal 0 HcmV?d00001 diff --git a/gesture/static/style.css b/gesture/static/style.css new file mode 100644 index 0000000..00ffaa5 --- /dev/null +++ b/gesture/static/style.css @@ -0,0 +1,66 @@ +:root{ + --color1: #418; + --color2: #ff0; +} + +a{text-decoration: none;} + +body{ + font-family: monospace; + background-color: var(--color1); + color: var(--color2); + font-size: 1.5rem; + margin: 2rem auto; + max-width: 60rem; +} +.button{ + font-family: monospace; + padding: 0.5em 1em; + border-radius: 2em; + background: var(--color2); + color: var(--color1); +} +button:after{ + content: " →"; + break-before: avoid; +} +.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;} +input{ + margin: 0 0 0.5rem; +} +input[type="submit"]{ + background-color: var(--color2); + color:var(--color1); + font-size: 1.5rem; + padding: 0.5rem; + font-family: monospace; + font-weight: 600; + width: 100%; +} +#floating-form{ + position: fixed; + z-index: 2; + background-color: var(--color2); + color:var(--color1); + width: 20rem; + padding: 2rem; + display: none; +} + +h4{margin: 0;} +textarea{ + width: 100%; + min-height: 20rem; + margin: 0 0 0.5rem; +} + +.two-col{ + max-width: calc(50% - 4rem); + float: left; + padding-right: 2rem; +} + + diff --git a/gesture/templates/template-index.html b/gesture/templates/template-index.html new file mode 100644 index 0000000..0bc7735 --- /dev/null +++ b/gesture/templates/template-index.html @@ -0,0 +1,16 @@ + + + + + +

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.

+
+
+ {% for word in text + %}{% + endfor %} +
+ + \ No newline at end of file diff --git a/gesture/templates/template-word.html b/gesture/templates/template-word.html new file mode 100644 index 0000000..c3ae93e --- /dev/null +++ b/gesture/templates/template-word.html @@ -0,0 +1,18 @@ + + + + + +

{{word}} x

+ {% for file in wordmedia %} +
+

Video {{file}}

+ + + {% for tag in media[file] + %}{% + endfor %} +
+ {% endfor %} + + \ No newline at end of file