-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_index.py
More file actions
55 lines (54 loc) · 1.19 KB
/
generate_index.py
File metadata and controls
55 lines (54 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
mw=3000
mh=3000
s="""<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Screen Meter</title>
<meta content="width=device-width, initial-scale=1" name="viewport" />
<style>
body {
background-color: skyblue;
font-size:5vmin;
font-family:monospace;
}
div.x {
width:50vw;
text-align:center;
position:absolute;
top:50%;
left:50%;
margin-top:-5vmin;
margin-left:-25vw;
}
span {display:none};"""
for i in range(mw):
s+="""
@media (min-width: """+str(i+1)+"""px) and (max-width: """+str(i+2)+"""px) {
span#w"""+str(i+1)+""" {display:inline-block;}
span#w"""+str(i)+""" {display:none;}
}"""
for i in range(mh):
s+="""
@media (min-height: """+str(i+1)+"""px) and (max-height: """+str(i+2)+"""px) {
span#h"""+str(i+1)+""" {display:inline-block;}
span#h"""+str(i)+""" {display:none;}
}"""
s+="""
</style>
</head>
<body>
<div class="x">"""
for i in range(mw):
s+="""
<span id="w"""+str(i+1)+"""">"""+str(i+1)+"""</span>"""
s+="""
X """
for i in range(mh):
s+="""
<span id="h"""+str(i+1)+"""">"""+str(i+1)+"""</span>"""
s+="""
</div></body>
</html>
"""
print s;