diff --git a/slaeforms/app.py b/slaeforms/app.py index bafc2bd..add31e7 100644 --- a/slaeforms/app.py +++ b/slaeforms/app.py @@ -1,7 +1,8 @@ import sys import json import random -from flask import Flask, redirect, url_for, request, session, make_response +import base64 +from flask import Flask, redirect, url_for, request, session, make_response, jsonify from flask import render_template from flask_sqlalchemy import SQLAlchemy from sqlalchemy.orm import DeclarativeBase @@ -13,6 +14,9 @@ import uuid random_order = True +# activate environment: cd C:\Users\Jan\Google Drive\Master Stuff\Code\SLAEForms Testing\.venv\Scripts\ +# then this: activate + #create the app app = Flask(__name__) # configure the database, give it a path (it will be in the instances folder) @@ -58,12 +62,21 @@ with app.app_context(): @app.route("/video", methods=["GET", "POST"]) -def sendpage(): +def videopage(): return render_template( - "layout2.html" + #"videorecorder3.html" + "myvideotemplate.html" ) +@app.route("/send_video", methods=["POST"]) +def send_video(): + data_url = request.json['dataUrl'] + data = data_url.split(',')[1] + with open('video.webm', 'wb') as f: + f.write(base64.b64decode(data)) + return jsonify({'message': 'Video saved successfully'}) + @app.route("/send", methods=["POST"]) @@ -83,6 +96,8 @@ def sendpage(): return redirect("/form") except: return "There was a problem while adding the response to the Database" + + @app.route("/form", methods=["GET", "POST"]) # / should not even be needed right? def formpage(): diff --git a/slaeforms/static/attributions.txt b/slaeforms/static/attributions.txt index b44b7c1..1ae57aa 100644 --- a/slaeforms/static/attributions.txt +++ b/slaeforms/static/attributions.txt @@ -1,3 +1,54 @@ https://jamesalvarez.co.uk/blog/how-to-make-responsive-likert-scales-in-css-(like-qualtrics)/ +Licenses: + +Open Iconic Icon Set (https://github.com/iconic/open-iconic) + +The MIT License (MIT) + +Copyright (c) 2014 Waybury + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +Bootstrap Icons https://github.com/twbs/icons + +The MIT License (MIT) + +Copyright (c) 2019-2024 The Bootstrap Authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/slaeforms/static/icons/camera-icon.png b/slaeforms/static/icons/camera-icon.png new file mode 100644 index 0000000..7d15774 Binary files /dev/null and b/slaeforms/static/icons/camera-icon.png differ diff --git a/slaeforms/static/icons/camera-off-icon.png b/slaeforms/static/icons/camera-off-icon.png new file mode 100644 index 0000000..bf302a6 Binary files /dev/null and b/slaeforms/static/icons/camera-off-icon.png differ diff --git a/slaeforms/static/icons/camera-reels-icon.png b/slaeforms/static/icons/camera-reels-icon.png new file mode 100644 index 0000000..d948dc0 Binary files /dev/null and b/slaeforms/static/icons/camera-reels-icon.png differ diff --git a/slaeforms/static/icons/check-icon.png b/slaeforms/static/icons/check-icon.png new file mode 100644 index 0000000..5e3e8c2 Binary files /dev/null and b/slaeforms/static/icons/check-icon.png differ diff --git a/slaeforms/static/icons/record-icon.png b/slaeforms/static/icons/record-icon.png new file mode 100644 index 0000000..10235a8 Binary files /dev/null and b/slaeforms/static/icons/record-icon.png differ diff --git a/slaeforms/static/icons/stop-icon.png b/slaeforms/static/icons/stop-icon.png new file mode 100644 index 0000000..7ac9c08 Binary files /dev/null and b/slaeforms/static/icons/stop-icon.png differ diff --git a/slaeforms/static/icons/trash-icon.png b/slaeforms/static/icons/trash-icon.png new file mode 100644 index 0000000..8c33162 Binary files /dev/null and b/slaeforms/static/icons/trash-icon.png differ diff --git a/slaeforms/static/icons/x-icon.png b/slaeforms/static/icons/x-icon.png new file mode 100644 index 0000000..d210e49 Binary files /dev/null and b/slaeforms/static/icons/x-icon.png differ diff --git a/slaeforms/static/styles.css b/slaeforms/static/styles.css index 1e1bfa4..456c3c4 100644 --- a/slaeforms/static/styles.css +++ b/slaeforms/static/styles.css @@ -8,6 +8,22 @@ body { font-size: 16px; } +.videocontrols { + width: 100px; /* Set a specific width for the buttons */ + height: 70px; /* Set a specific height for the buttons */ + background-color: #cae4ff; + border: none; + border: none; + color: white; + margin: 0 10px; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s ease; + display: inline-flex; /* Display button contents as a flexbox */ + justify-content: center; /* Center contents horizontally */ + align-items: center; /* Center contents vertically */ +} + .columncontainer { display: flex; } diff --git a/slaeforms/static/videoscript.js b/slaeforms/static/videoscript.js new file mode 100644 index 0000000..e69de29 diff --git a/slaeforms/templates/layout1.html b/slaeforms/templates/layout1.html index 72c5835..c29eace 100644 --- a/slaeforms/templates/layout1.html +++ b/slaeforms/templates/layout1.html @@ -1,5 +1,5 @@ - + diff --git a/slaeforms/templates/myvideotemplate.html b/slaeforms/templates/myvideotemplate.html new file mode 100644 index 0000000..551eea0 --- /dev/null +++ b/slaeforms/templates/myvideotemplate.html @@ -0,0 +1,139 @@ + + + + + + + + Testform + + + + +

Gib Feedback als Video

+
+ + + +
+ +
+ + + + + + + + + +
+ +
+
+ + + + + \ No newline at end of file diff --git a/slaeforms/templates/videorecorder.html b/slaeforms/templates/videorecorder.html new file mode 100644 index 0000000..f31aa96 --- /dev/null +++ b/slaeforms/templates/videorecorder.html @@ -0,0 +1,65 @@ + + + + + + Webcam Recorder + + + + + + + + + + + \ No newline at end of file diff --git a/slaeforms/templates/videorecorder2.html b/slaeforms/templates/videorecorder2.html new file mode 100644 index 0000000..c6cdf6a --- /dev/null +++ b/slaeforms/templates/videorecorder2.html @@ -0,0 +1,84 @@ + + + + + + + Webcam Recorder + + + + + + + +
+ + + + + + diff --git a/slaeforms/templates/videorecorder3.html b/slaeforms/templates/videorecorder3.html new file mode 100644 index 0000000..7bf4b20 --- /dev/null +++ b/slaeforms/templates/videorecorder3.html @@ -0,0 +1,177 @@ + + + + + + + + Videorecorder test + + + +

Videorecordertest

+
+ + + + +
+
+
+ +
+
+ +
+ + + \ No newline at end of file diff --git a/slaeforms/video.webm b/slaeforms/video.webm new file mode 100644 index 0000000..be798c5 Binary files /dev/null and b/slaeforms/video.webm differ