File tree 4 files changed +59
-0
lines changed
4 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ web : python app.py
Original file line number Diff line number Diff line change
1
+ from flask import Flask , request
2
+ from os import environ
3
+ app = Flask (__name__ )
4
+ port = int (environ .get ('PORT' , 5000 ))
5
+
6
+ default = """
7
+ <!DOCTYPE html>
8
+ <html lang="en">
9
+ <head>
10
+ <meta charset="utf-8">
11
+ <meta name="viewport" content="height = 1920, width = 1080">
12
+ <style type="text/css">
13
+ body {
14
+ margin: 0;
15
+ }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <canvas style="background-color: #999;" width="1080" height="1920">
20
+ </body>
21
+ </html>
22
+ """
23
+
24
+ content = """
25
+ <html>
26
+ <head>
27
+ <meta charset="utf-8">
28
+ <meta name="viewport" content="height=1920, width=1080, minimum-scale=1">
29
+ <style type="text/css">
30
+ body, iframe#main {{
31
+ margin: 0;
32
+ }}
33
+ </style>
34
+ </head>
35
+ <body style="width: 1080px; height: 1920px; margin: 0; position: absolute; top: 0; left: 0;">
36
+ <iframe
37
+ id="main"
38
+ src="{}"
39
+ frameborder=0
40
+ width=1920
41
+ height=1080
42
+ style="transform: rotate(90deg) translate(26em, 26em)" target="_parent">
43
+ </iframe>
44
+ </body>
45
+ </html>
46
+ """
47
+
48
+
49
+ @app .route ('/' )
50
+ def main ():
51
+ url = request .args .get ('url' , '' )
52
+ if url :
53
+ return content .format (url )
54
+ return default
55
+
56
+ if __name__ == "__main__" :
57
+ app .run (host = "0.0.0.0" , port = port )
Original file line number Diff line number Diff line change
1
+ flask
You can’t perform that action at this time.
0 commit comments