forked from zhujun24/At
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
131 lines (118 loc) · 2.76 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>新浪微博输入框</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
#input {
width: 610px;
height: 130px;
position: relative;
margin: 100px auto;
}
.same {
display: inline-block;
position: absolute;
overflow-x: hidden;
overflow-y: auto;
outline: none;
resize: none;
white-space: pre-wrap;
cursor: auto;
color: rgb(128, 128, 128);
width: 600px;
height: 100px;
top: 20px;
padding: 4px;
border-radius: 4px;
font-size: 14px;
line-height: 18px;
border: 1px solid #fa7d3c;
font-family: Arial, 'Microsoft YaHei';
}
#div {
z-index: 9999;
visibility: hidden;
}
#textarea {
z-index: 10000;
}
#info {
position: absolute;
background: #fff;
color: #333;
border: 1px solid #ccc;
border-radius: 2px;
padding: 2px;
box-shadow: 0px 2px 8px 1px rgba(0, 0, 0, 0.2);
z-index: 10001;
display: none;
}
#info .list-content, #info .list-title {
font-family: Arial, 'Microsoft YaHei';
font-size: 12px;
padding: 6px 10px;
cursor: pointer;
list-style: none;
}
#info .list-content.list-active {
color: #eb7350;
background-color: #f2f2f5;
}
#rest {
font-family: Arial, 'Microsoft YaHei';
height: 20px;
font-size: 14px;
line-height: 20px;
position: absolute;
right: 0;
}
#rest span {
color: #eb7350;
font-size: 18px;
line-height: 20px;
font-weight: bold;
}
#link {
position: absolute;
height: 20px;
left: 0;
}
a {
color: #428bca;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
text-decoration: none;
}
</style>
</head>
<body>
<div id="input">
<div id="link">
<a target="_blank" href="https://github.com/zhujun24/At">Github</a>
<a target="_blank" href="/1.0">以前的版本</a>
</div>
<p id="rest">还可以输入<span>140</span>字</p>
<textarea class="same" id="textarea" placeholder="说点什么吧……"></textarea>
<div class="same" id="div" contenteditable="true"></div>
</div>
<ul id="info"></ul>
<input id="cursor" type="hidden"/>
<script type="text/javascript" src="at.js"></script>
<script type="text/javascript">
window.onload = function () {
//at1.1.js中定义了getById()函数
var textarea = getById("textarea");
var hiddenObj = getById("div");
var atList = getById("info");
var rest = getById("rest");
at(textarea, hiddenObj, atList, rest);
}
</script>
</body>
</html>