forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbadge-expected.html
More file actions
55 lines (55 loc) · 1.25 KB
/
badge-expected.html
File metadata and controls
55 lines (55 loc) · 1.25 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
<!DOCTYPE html>
<meta name="viewport" content="width=device-width">
<style>
a {
-webkit-clip-path: path("M 82 14 L 84 14 L 84 16 L 82 16 z");
text-decoration: none;
}
img {
width: 100px;
height: 100px;
}
</style>
<script>
window.addEventListener("load", () => {
const canvas = document.createElement("canvas");
canvas.width = 10;
canvas.height = 10;
const ctx = canvas.getContext("2d");
const images = document.querySelectorAll("img");
images.forEach(image => {
ctx.clearRect(0, 0, 10, 10);
const color = image.getAttribute("data-color");
ctx.fillStyle = color;
ctx.fillRect(0, 0, 10, 10);
image.src = canvas.toDataURL();
});
}, false);
</script>
<a href="/">
<img data-color="rgb(255, 57, 57)">
</a>
<a href="/">
<img data-color="rgb(80, 169, 79)">
</a>
<a href="/">
<img data-color="rgb(102, 102, 255)">
</a>
<a href="/">
<img data-color="rgb(0, 255, 255)">
</a>
<a href="/">
<img data-color="rgb(156, 156, 156)">
</a>
<a href="/">
<img data-color="rgb(255, 174, 104)">
</a>
<a href="/">
<img data-color="white">
</a>
<a href="/">
<img data-color="rgb(118, 118, 118)">
</a>
<a href="/">
<img data-color="rgba(0, 0, 0, 0.0)">
</a>