Skip to content

Commit b32a6a3

Browse files
committed
Add 'electric-landscape/' from commit '4ae2463e05b4b9616aad81f9324c7463725b706c'
git-subtree-dir: electric-landscape git-subtree-mainline: e2ea8fd git-subtree-split: 4ae2463
2 parents e2ea8fd + 4ae2463 commit b32a6a3

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

electric-landscape/Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: python app.py

electric-landscape/README.md

Whitespace-only changes.

electric-landscape/app.py

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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)

electric-landscape/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
flask

0 commit comments

Comments
 (0)