-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
40 lines (37 loc) · 972 Bytes
/
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
<!doctype html>
<html>
<head>
<title>Stock photo picker</title>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var handler = new StockPhotoPicker({
unsplash: {
token: ''
},
giphy: {
token: ''
},
onImageSelected: (url) => {
console.log(url);
}
});
document.getElementById('unsplashButton').addEventListener('click', function(e) {
handler.open({
provider: 'unsplash'
});
e.preventDefault();
});
document.getElementById('giphyButton').addEventListener('click', function(e) {
handler.open({
provider: 'giphy'
});
e.preventDefault();
});
});
</script>
</head>
<body>
<button id="unsplashButton">Open Unsplash</button>
<button id="giphyButton">Open Giphy</button>
</body>
</html>