forked from steimelchrome/steimelchrome.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpip_size_constraints_demo.html
101 lines (86 loc) · 2.42 KB
/
pip_size_constraints_demo.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<head>
<title>PiP Size Constraints Demo</title>
<style>
body {
margin: 0;
padding: 0;
}
#container {
width: 100%;
height: 100%;
background: Cornsilk;
position: relative;
}
#window {
background: DarkGray;
position: absolute;
}
:root {
--resize-handle-length: 50px;
--resize-handle-edge: 20px;
}
.resize-handle {
background: DarkGreen;
position: absolute;
}
.resize-handle-wide {
margin-left: calc(var(--resize-handle-length) / -2);
left: 50%;
width: var(--resize-handle-length);
height: var(--resize-handle-edge);
}
.resize-handle-tall {
margin-top: calc(var(--resize-handle-length) / -2);
top: 50%;
height: var(--resize-handle-length);
width: var(--resize-handle-edge);
}
.resize-handle-corner {
width: var(--resize-handle-edge);
height: var(--resize-handle-edge);
}
#top {
top: 0;
}
#bottom {
bottom: 0;
}
#left {
left: 0;
}
#right {
right: 0;
}
#top-left {
top: 0;
left: 0;
}
#top-right {
top: 0;
right: 0;
}
#bottom-left {
bottom: 0;
left: 0;
}
#bottom-right {
bottom: 0;
right: 0;
}
</style>
</head>
<body>
<div id="container">
<div id="window">
<div id="top-left" class="resize-handle resize-handle-corner"></div>
<div id="top" class="resize-handle resize-handle-wide"></div>
<div id="top-right" class="resize-handle resize-handle-corner"></div>
<div id="left" class="resize-handle resize-handle-tall"></div>
<div id="right" class="resize-handle resize-handle-tall"></div>
<div id="bottom-left" class="resize-handle resize-handle-corner"></div>
<div id="bottom" class="resize-handle resize-handle-wide"></div>
<div id="bottom-right" class="resize-handle resize-handle-corner"></div>
</div>
</div>
<script src="pip_size_constraints_demo.js"></script>
</body>