-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_old.html
227 lines (212 loc) · 5.2 KB
/
index_old.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>彭小猪</title>
<style>
/*flex布局*/
/*文本和图片顶端对齐*/
/*li垂直分布*/
/*border-radius*/
/*气泡的角度*/
/*头像*/
/*background的各个参数*/
/*背景图片的位置*/
/*color颜色*/
/*气泡的颜色*/
/*css动画*/
/*音频显示*/
/*多行文本居中*/
/*气泡内容*/
/*行内元素的vertical-align*/
/*子选择器*/
/*nth-child(n)*/
/*js控制音频和动画*/
body{
margin:0px;
font-size: 32px;
overflow: hidden;
}
/* .emoji{
width:40px !important;
}*/
.header{
height: 10vh;
background: white;
}
.chatContent{
height: 80vh;
background:pink;
overflow-y: scroll;
overflow-x: hidden;
background-image: url("./img/chatBackground.jpeg");
background-repeat: no-repeat;
background-size:auto 100vh;
background-position: -1160px 0px;
}
.chatContent ul{
display: flex;
padding:0px;
flex-direction:column;
}
.chatContent ul li{
box-sizing: border-box;
list-style:none;
display: flex;
align-items: flex-start;
margin:20px 0px;
padding:0 30px;
width:100vw;
/*border:1px solid black;*/
}
.chatContent ul li.left-message{
flex-flow:row nowrap;
}
.chatContent ul li.right-message{
flex-flow:row-reverse nowrap;
/*align-items: flex-start;*/
}
.chatContent ul li.left-message .chatAvatar{
width:120px;
height:120px;
border-radius: 50%;
}
.chatContent ul li.left-message .chatImg{
padding-left: 20px;
border-radius:30px;
}
.chatContent ul li.left-message .content{
margin-left: 20px;
margin-top:10px;
background-color: rgb(245,245,245);
padding: 20px;
display: flex;
align-items: flex-start;
/*使用border-radius构造气泡*/
border-radius:0 40px 40px 40px/0 40px 40px 40px;
}
.chatContent ul li.right-message .chatImg{
padding-right: 20px;
border-radius:30px;
}
.chatContent ul li.right-message .content{
position:relative;
margin-left: 20px;
background-color: #25D4D0;
color:white;
padding: 20px;
display: flex;
align-items: flex-start;
/*使用border-radius构造气泡*/
border-radius:40px 0px 40px 40px/40px 0px 40px 40px;
}
.chatContent ul li.right-message .content.hasRead:before{
content:" ";
display: inline-block;
position:absolute;
bottom:0;
left:-15px;
width:10px;
height: 10px;
background: #25D4D0;
border:1px solid #25D4D0;
border-radius:50%;
}
.bottom{
height: 18vh;
background: white;
}
</style>
<script type="text/javascript" src="./js/emoji.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body onload="onLoad()">
<div class="header">
</div>
<div class="chatContent">
<ul>
<li class="left-message">
<img class="chatAvatar" src="./img/her.png" alt="#">
<div class="content" id="text">
也不知道跟你聊过啥😂
</div>
</li>
<li class="right-message">
<!-- <img class="chatAvatar" src="./img/cat.png" alt="#"> -->
<div class="content">
<div style="height: 80px;width: 400px;background: red"></div>
</div>
</li>
<li class="right-message">
<!-- <img class="chatAvatar" src="./img/cat.png" alt="#"> -->
<div class="content hasRead">
也不知道跟你聊过啥😂
</div>
</li>
<li class="right-message">
<!-- <img class="chatAvatar" src="./img/cat.png" alt="#"> -->
<div class="content">
这是聊
</div>
</li>
<li class="left-message">
<img class="chatAvatar" src="./img/her.png" alt="#">
<img class="chatImg" src="https://img.soulapp.cn/image/2019-02-14/a393673c-2f3c-464b-9737-70b00534b524-1550136829541.png" alt="" height="279" weight="314">
</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
<li>content</li>
</ul>
</div>
<div class="bottom">
</div>
<script type="text/javascript">
//转换包含emoji文本内容的DOM对象
function onLoad(){
console.time("emoji")
var elements = document.getElementsByClassName('content');
for (var i = elements.length - 1; i >= 0; i--) {
Emoji.emoji(elements[i])
console.log(elements[i])
}
// html = Emoji.emoji(el);
// console.log(html)
console.timeEnd("emoji")
}
</script>
</body>
</html>