Repository navigation
Expand file tree
/
Copy pathsample.html
More file actions
79 lines (66 loc) · 2.04 KB
/
Copy pathsample.html
File metadata and controls
79 lines (66 loc) · 2.04 KB
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
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="css/flex2html.css">
<script type="text/javascript" src="js/flex2html.min.js"></script>
<style>
html {
height: 100%;
overflow: hidden;
}
body {
font-family: 'Mitr', sans-serif;
color: rgb(49, 49, 49);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
transition: background 2s linear;
}
h1,
h2,
h3,
h4,
h5,
h6 {
-moz-text-shadow: 1px 1px 5px rgba(0, 0, 0, .8);
-webkit-font-smoothing: antialiased;
-webkit-text-shadow: 1px 1px 5px rgba(0, 0, 0, .8);
text-shadow: 1px 1px 5px rgba(0, 0, 0, .8);
font-weight: 600;
}
@media (min-width: 1400px) {
.h2,
h2 {
font-size: 4vh;
}
}
.container {
top: 50%;
transform: translateY(-50%);
}
.wrapper {
background-color: rgba(216, 216, 216, 0.8);
}
</style>
</head>
<body>
<div class="d-flex vh-100 justify-content-center ">
<div class="d-inline-flex w-75 align-self-center align-items-center align-self-stretch ">
<textarea class="form-control vh-100" placeholder="Flex Message..." id="flexJson" onkeyup="preview()"></textarea>
</div>
<div class="col-6">
<div class="chatbox w-100 vh-100">
<div id="flexPreview"></div>
</div>
</div>
</div>
<script>
const preview = () => {
let flexJson = document.getElementById('flexJson');
let jsonText = JSON.parse(`{"type":"flex","altText":"Flex Message","contents":${flexJson.value}}`);
// console.log(jsonText);
flex2html("flexPreview", jsonText);
}
</script>
</body>
</html>