forked from sendbird/sendbird-javascript-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
64 lines (57 loc) · 3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon"
href="https://dxstmhyqfqr1o.cloudfront.net/favicon/Sendbird_Favicon_PNG/Sendbird_Favicon_16X16.png">
<link rel="shortcut icon"
href="https://dxstmhyqfqr1o.cloudfront.net/favicon/Sendbird_Favicon_PNG/Sendbird_Favicon_16X16.png">
<link
href='https://fonts.googleapis.com/css?family=Exo+2:400,900italic,900,800italic,800,700italic,700,600italic,600,500italic,500,400italic,300italic,200italic,200,100italic,100,300'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"
integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link rel="stylesheet" href="index.css">
<title>Sample | Sendbird for JavaScript</title>
</head>
<body>
<div class="container">
<div class='title'>Sendbird JavaScript samples</div>
<div id='platform' class='platform'></div>
<script type='text/javascript' src='./sample-info.js'></script>
<script type='text/javascript'>
window.onload = function () {
var platformContainer = document.getElementById('platform');
for (var key in SampleInfo) {
var platform = SampleInfo[key];
var platformItem = document.createElement('div');
platformItem.className = 'platform-item';
platformItem.innerHTML = "\
<div class='label'>" + platform.label + "</div>\
<div class='items'></div>";
var sampleContainer = platformItem.querySelector('.items');
for (var sample of platform.items) {
var sampleItem = document.createElement('div');
sampleItem.className = 'sample';
sampleItem.innerHTML = "\
<div style='background-image:url(\"" + sample.thumbnail + "\");' class='thumbnail'></div>\
<div class='detail'>\
<div class='name'>" + sample.name + "</div>\
</div>\
<div class='buttons'>"
+ (sample.url
? "<a href='" + sample.url + "' target='_blank' class='button'><i class='fas fa-link'></i> Demo</a>"
: "") +
"<a href='" + sample.repo + "' target='_blank' class='button'><i class='fab fa-github'></i> Github</a>\
</div>";
sampleContainer.appendChild(sampleItem);
}
platformContainer.appendChild(platformItem);
}
};
</script>
</div>
</body>
</html>