-
Notifications
You must be signed in to change notification settings - Fork 286
/
Copy pathindex.html
116 lines (106 loc) · 3.16 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
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Новый image-set()</title>
<style>
body {
margin: 0;
display: grid;
grid-template-columns: 1fr 1fr;
font-family: sans-serif;
}
/* Picture */
.picture {
display: block;
max-width: 100%;
height: auto;
}
/* Feature */
.feature {
position: relative;
display: grid;
align-items: end;
/* Для Chrome и Safari */
background-image:
linear-gradient(
to top,
black,
transparent 70%
),
-webkit-image-set(
url('images/[email protected]') 2x,
url('images/[email protected]') 1x
);
/* Для Firefox */
background-image:
linear-gradient(
to top,
black,
transparent 70%
),
image-set(
url('images/[email protected]') type('image/avif') 2x,
url('images/[email protected]') type('image/avif') 1x,
url('images/[email protected]') type('image/webp') 2x,
url('images/[email protected]') type('image/webp') 1x,
url('images/[email protected]') 2x,
url('images/[email protected]') 1x
);
background-size: cover;
max-width: 500px;
aspect-ratio: 1 / 1;
}
/* @media (min-resolution: 2dppx) {
.feature {
background-image: url('images/[email protected]');
}
} */
.feature__title {
margin: 0;
padding: 0.7em;
color: white;
line-height: 0.7;
font-weight: normal;
font-size: 50px;
}
.feature__link {
color: white;
text-decoration: none;
}
.feature__link:focus-visible {
outline: none;
}
.feature__link:focus-visible::before {
outline: 5px solid deepskyblue;
outline-offset: -5px;
}
.feature__link::before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
}
</style>
</head>
<body>
<picture>
<source type="image/avif" srcset="images/[email protected] 1x, images/[email protected] 2x">
<source type="image/webp" srcset="images/[email protected] 1x, images/[email protected] 2x">
<img class="picture" width="500" height="500"
src="images/[email protected]"
srcset="images/[email protected] 2x"
alt="Рыжий кот нюхает штанину.">
</picture>
<article class="feature">
<h2 class="feature__title">
<a class="feature__link" href>
Кот понюхал штанину
</a>
</h2>
</article>
</body>
</html>