-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (73 loc) · 1.73 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>@9am/halftone</title>
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
padding: 0 20px;
}
canvas, img {
width: 100%;
}
.blend {
isolation: isolate;
position: relative;
width: 100px;
height: 100px;
}
.dot {
mix-blend-mode: multiply;
position: absolute;
width: 60%;
height: 60%;
}
.cyan {
top: 0;
left: 0;
background: cyan;
}
.magenta {
background: magenta;
top: 0;
right: 0;
}
.yellow {
background: yellow;
bottom: 0;
right: 0;
}
.black {
background: #333;
bottom: 0;
left: 0;
}
</style>
</head>
<body>
<h1>🥑</h1>
<button>update</button>
<div class="blend">
<div class="dot cyan"></div>
<div class="dot magenta"></div>
<div class="dot yellow"></div>
<div class="dot black"></div>
</div>
<img-halftone src="./img/friut.jpeg" shape="circle"></img-halftone>
<!--
<script type="module" src="https://cdn.skypack.dev/@9am/img-halftone"></script>
<script src="https://www.unpkg.com/@9am/img-halftone"></script>
-->
<script type="module">
import './src/index.ts';
document.querySelector('button').addEventListener('click', () => {
document.querySelector('img-halftone').src = "/img/lamp2.webp";
});
</script>
</body>
</html>