-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
46 lines (43 loc) · 1 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
<html>
<head>
<script src="colorizer.js"></script>
<style>
* {
margin: 0;
padding: 0;
font-family: Helvetica;
font-size: 18px;
overflow: hidden;
}
body {
background-color: rgba(0,0,0,1);
}
img {
position: absolute;
top: 122px;
left: 50%;
margin-left: -400px;
}
input {
padding: 18px;
display: block;
width: 100%;
outline: none;
}
</style>
</head>
<body>
<input placeholder="'rgb(x,x,x)' or '#xxxxxx'" type="text" />
<input placeholder="blendmode" type="text" />
<img src="sample.jpeg" alt="this is the sample image with the color filter applied" color="#ff340f" blendmode="lighten"/>
</body>
<script>
var image = document.getElementsByTagName("img")[0],
blendmode = document.getElementsByTagName("input")[1],
color = document.getElementsByTagName("input")[0];
setInterval( function(){
image.setAttribute("color" , color.value );
image.setAttribute("blendmode" , blendmode.value );
} , 200 );
</script>
</html>