-
Notifications
You must be signed in to change notification settings - Fork 1
/
Example.html
executable file
·123 lines (99 loc) · 3.8 KB
/
Example.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
<!DOCTYPE html>
<html>
<head>
<title>Tinto Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="Tinto.js"></script>
<script>
function example(){
var original = document.getElementById("original");
var red = document.getElementById("red");
var blue = document.getElementById("blue");
var URL = original.src;
Tinto.fromURL(URL, function(tinto){
red.src = tinto.imageDataWithTintColor("#ff3b30");
blue.src = tinto.imageDataWithTintColor("#007aff");
});
};
document.addEventListener("DOMContentLoaded", example);
</script>
<style>
* {
margin: 0px;
padding: 0px;
}
html, body {
width: 100%;
height: 100%;
min-width: 800px;
}
.example {
display: table;
width: 100%;
height: 100%;
background-color: #f2f2f2;
}
.example ol {
display: table-cell;
text-align: center;
vertical-align: middle;
}
.example figure {
display: inline-block;
position: relative;
padding: 60px 67px;
background-color: white;
box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.1), 0px 0px 1px rgba(0, 0, 0, 0.1);
border-radius: 16px;
margin-right: 40px;
background-image:
-moz-linear-gradient(45deg, #ededef 25%, transparent 25%),
-moz-linear-gradient(-45deg, #ededef 25%, transparent 25%),
-moz-linear-gradient(45deg, transparent 75%, #ededef 75%),
-moz-linear-gradient(-45deg, transparent 75%, #ededef 75%);
background-image:
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #ededef), color-stop(.25, transparent)),
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #ededef), color-stop(.25, transparent)),
-webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #ededef)),
-webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #ededef));
-moz-background-size: 42px 42px;
background-size: 42px 42px;
-webkit-background-size: 42px 43px; /* override value for shitty webkit */
background-position:0 0, 21px 0, 21px -21px, 0px 21px;
}
.example figure:last-child {
margin-right: 0px;
}
.example figure figcaption {
position: absolute;
text-align: center;
-webkit-font-smoothing:antialiased;
font-size: 14px;
font-family: "Helvetica Neue", sans-serif;
line-height: 24px;
color: #888b90;
left: 0px;
right: 0px;
bottom: -44px;
}
</style>
</head>
<body>
<div class="example">
<ol>
<figure>
<img id="original" src="Example.png" width="75" height="90">
<figcaption>The template image</figcaption>
</figure>
<figure>
<img id="red" width="75" height="90">
<figcaption>Image with red tint</figcaption>
</figure>
<figure>
<img id="blue" width="75" height="90">
<figcaption>Image with blue tint</figcaption>
</figure>
</ol>
</div>
</body>
</html>