-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathindex.html
92 lines (86 loc) · 2.9 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Auto scale</title>
<script
src="/dist/bundle.js"
type="text/javascript"
charset="utf-8"
></script>
</head>
<body>
<article class="pat-rich" style="display: block; min-height: 20em">
<p>A random HTML element:</p>
<p>
<button class="pat-button">👉 BUTTON 👈</button>
</p>
<p>
The same HTML element, now scaled up to match the width it
parent element by pat-auto-scale:
</p>
<p>
<button class="pat-button pat-auto-scale">👉 BUTTON 👈</button>
</p>
<p>The scaling mechanism takes paddings into account:</p>
<p
style="
border: 4px solid skyblue;
width: 350px;
height: 100px;
padding: 20px;
"
>
<button class="pat-button pat-auto-scale">👉 BUTTON 👈</button>
</p>
<p>
Another element, scaled up to fill the parent element. This is
done with the property: `size: contain`.
</p>
<p style="border: 4px solid skyblue; width: 350px; height: 100px">
<button
class="pat-button pat-auto-scale"
data-pat-auto-scale="size: contain"
>
👌
</button>
</p>
<p>
The same element, now scaled up to fill the parent completely.
The styling property `overflow: hidden` is used on the parent
element to prevent bleeding. This is done with the property:
`size: cover`.
</p>
<p
style="
border: 4px solid skyblue;
width: 350px;
height: 350px;
overflow: hidden;
"
>
<button
class="pat-button pat-auto-scale"
data-pat-auto-scale="size: cover"
>
👌
</button>
</p>
<p>Autoscale and fullscreen:</p>
<p class="fullscreen-element">
<button class="pat-button pat-auto-scale">👉 BUTTON 👈</button>
</p>
<button
class="pat-fullscreen"
data-pat-fullscreen="selector:.fullscreen-element"
>
open in fullscreen
</button>
<style type="text/css">
.pat-button {
float: left;
}
</style>
</article>
</body>
</html>