-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
140 lines (127 loc) · 3.99 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
name="viewport">
<title>Pseudo-mask Demo</title>
<style>
* {
box-sizing: content-box;
}
:root {
background-color: black;
}
body {
font-family: Helvetica, sans-serif;
width: 100%;
margin: unset;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
}
a {
text-decoration: none;
color: inherit;
}
img {
margin: 0;
width: 100%;
height: auto;
display: block;
}
aside {
top: 0;
left: 0;
right: 0;
height: 100vh;
display: flex;
position: fixed;
align-items: center;
pointer-events: none;
flex-direction: column;
justify-content: center;
height: -moz-available;
height: -webkit-fill-available;
height: fill-available;
}
section {
--filter: blur(30px);
--mask: unset;
max-width: 40vw;
padding: 5vw;
color: white;
border-radius: 5vw;
position: relative;
pointer-events: initial;
}
section:before {
content: '';
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
position: absolute;
pointer-events: none;
border-radius: inherit;
background-color: rgba(0, 0, 0, 0.2);
backdrop-filter: var(--filter);
-webkit-backdrop-filter: var(--filter);
}
section h1 {
font-size: 4vw;
font-weight: 700;
margin: unset;
line-height: 1.3;
}
section p {
line-height: 1.3;
}
pseudo-mask {
--filter: blur(50px) saturate(3) brightness(2);
}
@media (orientation: portrait) {
section {
padding: 10vw;
max-width: 60vw;
border-radius: 10vw;
}
section h1 {
font-size: 6vw;
}
img {
width: 100%;
height: 100%;
min-height: 100vh;
object-fit: cover;
min-height: -moz-available;
min-height: -webkit-fill-available;
min-height: fill-available;
}
}
</style>
<script type="importmap">{"imports": {"@ponomarevlad/svg-text": "https://cdn.skypack.dev/@ponomarevlad/svg-text"}}
</script>
<script async noshim src="https://unpkg.com/es-module-shims/dist/es-module-shims.js"></script>
<script src="./index.mjs" type="module"></script>
</head>
<body>
<img decoding="async" height="2048" src="https://picsum.photos/2048?1" width="2048" referrerpolicy="no-referrer">
<img decoding="async" height="2048" src="https://picsum.photos/2048?2" width="2048" referrerpolicy="no-referrer">
<img decoding="async" height="2048" src="https://picsum.photos/2048?3" width="2048" referrerpolicy="no-referrer">
<img decoding="async" height="2048" src="https://picsum.photos/2048?4" width="2048" referrerpolicy="no-referrer">
<img decoding="async" height="2048" src="https://picsum.photos/2048?5" width="2048" referrerpolicy="no-referrer">
<aside>
<section>
<a href="https://www.webcomponents.org/element/pseudo-mask">
<h1>
<pseudo-mask>< pseudo-mask /></pseudo-mask>
</h1>
</a>
<p>
<pseudo-mask>A tiny custom element that generates SVG masks from text content ✨</pseudo-mask>
</p>
</section>
</aside>
</body>
</html>