Omnibus commited on
Commit
8d6809c
·
1 Parent(s): 8e9b61d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -15,7 +15,7 @@ def search_fn(query):
15
  out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
16
  out = out[0]
17
 
18
- frame_l=f'<div class="frame_class"><iframe src="{out}" frameborder="0" width="100%" height="2000"></iframe></div>'
19
 
20
  file.writelines(frame_l)
21
 
@@ -37,9 +37,25 @@ def test(inp):
37
  with open("myfile.txt", "r") as file1:
38
  html_out = file1.read()
39
  style = '''
40
- frame_class{
41
- width:30%,
42
- }'''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  out = f'''<!DOCTYPE html>
44
  <html lang="en">
45
  <head>
 
15
  out = (re.split(":(?=http)",link["href"].replace("/url?q=","").split("&sa",1)[0]))
16
  out = out[0]
17
 
18
+ frame_l=f'<div class="container"><iframe class="responsive-iframe" src="{out}" frameborder="0" width="100%" height="2000"></iframe></div>'
19
 
20
  file.writelines(frame_l)
21
 
 
37
  with open("myfile.txt", "r") as file1:
38
  html_out = file1.read()
39
  style = '''
40
+ .container {
41
+ position: relative;
42
+ overflow: hidden;
43
+ width: 100%;
44
+ padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
45
+ }
46
+
47
+ /* Then style the iframe to fit in the container div with full height and width */
48
+ .responsive-iframe {
49
+ position: absolute;
50
+ top: 0;
51
+ left: 0;
52
+ bottom: 0;
53
+ right: 0;
54
+ width: 100%;
55
+ height: 100%;
56
+ }
57
+
58
+ '''
59
  out = f'''<!DOCTYPE html>
60
  <html lang="en">
61
  <head>