diff --git a/web/server.py b/web/server.py new file mode 100644 index 0000000..3978989 --- /dev/null +++ b/web/server.py @@ -0,0 +1,13 @@ +from flask import Flask, render_template +app = Flask(__name__) + +@app.route('/', methods=['GET']) +def hello_world(): + return render_template('index.html') + +@app.route('/predict', methods=['POST']) +def predict(id, permission): + return 'Hello World!!!!' + +if __name__ == '__main__': + app.run(host = '0.0.0.0', debug = True) diff --git a/web/custom.js b/web/static/custom.js similarity index 89% rename from web/custom.js rename to web/static/custom.js index 31bd0af..587e167 100644 --- a/web/custom.js +++ b/web/static/custom.js @@ -3,17 +3,19 @@ const canvas = document.getElementById('canvas'); const user = document.getElementById('userForm'); const loader = document.getElementById('heartLoader'); const context = canvas.getContext('2d'); -const biggerText = document.getElementById('issaBiggerText') -const smallerText = document.getElementById('issaSmallerText') +const biggerText = document.getElementById('issaBiggerText'); +const smallerText = document.getElementById('issaSmallerText'); const constraints = { video: true, }; + //Enables webcam navigator.mediaDevices.getUserMedia(constraints) .then((stream) => { webcam.srcObject = stream; }); + // Checks if "^" Key is pressed document.addEventListener("keydown", function (e) { if (e.keyCode == 192) { @@ -30,13 +32,13 @@ document.addEventListener("keydown", function (e) { smallerText.style.opacity = 0; smallerText.style.transitionDuration = "1s"; crypticWow("Ihr Bild wird nun verarbeitet"); - } else if (e.keyCode == 70) { + } else if (e.keyCode == 77) { crypticWow("Sie sind 54 Jahre alt und weiblich"); - smallerText.innerHTML = "korrigieren Sie ihre Schätzung und drücken Sie dann auf das Herz" + smallerText.innerHTML = "korrigieren Sie ihre Schätzung und drücken Sie dann auf das Herz"; smallerText.style.transitionDelay = "1s"; smallerText.style.opacity = 1; smallerText.style.transitionDuration = "2s"; - + } }, false); @@ -45,11 +47,11 @@ function send(canvas) { $.ajax({ type: "POST", url: "", //TODO: insert filename which gets the image via post - data: { + data: { imgBase64: dataURL } }).done(function(o) { - console.log('saved'); + console.log('saved'); }); } @@ -91,4 +93,3 @@ function toggleFullScreen() { } } } - diff --git a/web/index.html b/web/static/index.html similarity index 99% rename from web/index.html rename to web/static/index.html index 80bdcb4..174db2c 100644 --- a/web/index.html +++ b/web/static/index.html @@ -30,4 +30,4 @@

und stimmen zu, dass ihr Bild für das Trainieren der - \ No newline at end of file + diff --git a/web/style.css b/web/static/style.css similarity index 100% rename from web/style.css rename to web/static/style.css diff --git a/web/userForm.png b/web/static/userForm.png similarity index 100% rename from web/userForm.png rename to web/static/userForm.png diff --git a/web/templates/index.html b/web/templates/index.html new file mode 100644 index 0000000..bbd04d2 --- /dev/null +++ b/web/templates/index.html @@ -0,0 +1,33 @@ + + + + + + IP Hartung + + + + + +
+

Drücken Sie Enter und lassen Sie Ihr Alter schätzen

+

und stimmen zu, dass ihr Bild für das Trainieren der + Software weiterverwendet wird.

+
+
+ +
+
+ +
+
+
+
+ + + + + + +