From db00617080440f0df85f05c6c11a70a37276816a Mon Sep 17 00:00:00 2001 From: alicestrt Date: Tue, 8 Sep 2020 20:31:48 +0200 Subject: [PATCH] made iframes draggable --- hello.py | 13 +++++++++++++ static/css/style.css | 17 ++++++++++++++--- templates/perspectiveA.html | 13 ++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/hello.py b/hello.py index 9cd3423..86bb0ff 100644 --- a/hello.py +++ b/hello.py @@ -3,6 +3,19 @@ from flask import render_template app = Flask(__name__) +@app.context_processor +def override_url_for(): + return dict(url_for=dated_url_for) + +def dated_url_for(endpoint, **values): + if endpoint == 'static': + filename = values.get('filename', None) + if filename: + file_path = os.path.join(app.root_path, + endpoint, filename) + values['q'] = int(os.stat(file_path).st_mtime) + return url_for(endpoint, **values) + @app.route('/') def hello_world(): return 'Hello, World!' diff --git a/static/css/style.css b/static/css/style.css index 879bd8d..ea92e8d 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,13 +1,24 @@ +* { + background-color: gray; +} #video1 { - padding-top: 100px; + margin-top: 300px; +} + +.draggable { + position: absolute; } .draggable img { opacity: 0.7; +} + +.draggable iframe { + padding: 20px; +} #video2 { - padding-top: 100px; - position: relative; + margin-top: 100px; } #audio1 { diff --git a/templates/perspectiveA.html b/templates/perspectiveA.html index e374070..970e678 100644 --- a/templates/perspectiveA.html +++ b/templates/perspectiveA.html @@ -1,7 +1,10 @@ + + + - + Perspective A @@ -10,11 +13,11 @@ -
- +
+
-
- +
+