-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
147 lines (130 loc) · 4.79 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1,IE=9">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="img/cxtv_logo.jpg">
<link href="css/bootstrap.min.css" rel="stylesheet">
<title>弹幕自动档</title>
</head>
<body style="background-color: #eee">
<!-- 导航 -->
<nav style="background-color: #ffffff; border-bottom: solid 1px"
class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand "
style="padding: 0px 15px 0px 0px; margin: 0px"><img
src="img/cxtv.png" alt="抽象TV"></a>
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#navbar-collapse">
<span class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span>
</button>
</div>
</div>
</nav>
<!--主要显示-->
<div class="container" style="margin-top: 80px;">
<div class="col-sm-5 ">
<div class="well" style="line-height: 2">
<blockquote>
<h2 style="font-family: '微软雅黑'">使用方法</h2>
</blockquote>
<ol>
<li>进入斗鱼直播房间并登录</li>
<li>按F12或在浏览器设置中进入开发者工具</li>
<li>Chrome、360、QQ浏览器等进入Console选项卡,IE浏览器进入控制台选项卡</li>
<li>
在输入框中插生成的代码,按Enter执行,IE按Ctrl+Enter或点击运行脚本</li>
</ol>
<blockquote>
<h2 style="font-family: '微软雅黑'">PS</h2>
</blockquote>
<ul>
<li>末尾会加上 ‘-执行次数’</li>
<li>单击弹幕输入框或可以提前停车</li>
</ul>
</div>
</div>
<div class="col-sm-7">
<form id="inputAttr">
<div class="form-group">
<label for="content" class="control-label">开车内容(斗鱼限制23个字符)</label>
<input type="text" class="form-control" id="content" name="content" maxlength="23"
placeholder="内容" >
</div>
<div class="form-group">
<label for="aintervalTime" class="control-label">发车间隔(单位:秒)</label>
<input type="number" class="form-control" id="intervalTime" name="intervalTime"
placeholder="最快不超过房间设置的发言间隔" >
</div>
<div class="form-group">
<label for="times" class="control-label">发车次数</label> <input
type="number" class="form-control" id="times" name="times" placeholder="发车的次数"
>
</div>
<div class="form-group">
<button type="button" id="geneBtn"
class="btn btn-success form-control">生成脚本并复制到剪切板</button>
</div>
<textarea spellcheck="false" id="geneCode" class="form-control"
rows="20"></textarea>
</form>
</div>
</div>
<div class="container"></div>
<script id="code">
var setContent ='<%= content %>';
var setIntervalTime =<%=interval%>;
var setTimes = <%=times%>;
var realTime=1;
var realContent = setContent;
var realIntervalTime
var autoSendMsg;
var sendTextArea = document.getElementsByClassName("ChatSend-txt")[0];
var sendButton = document.getElementsByClassName("ChatSend-button")[0];
sendMsg();
sendTextArea.onclick=function(){
clearTimeout(autoSendMsg);
}
function sendMsg(){
if(!canSend()){return;}
realContent=setContent+'-'+realTime++;
sendTextArea.value = realContent;
sendButton.click();
var roomMsgCd = getRoomMsgCd();
if(roomMsgCd>setIntervalTime){
realIntervalTime=roomMsgCd;
}else{
realIntervalTime=setIntervalTime;
}
autoSendMsg = setTimeout("sendMsg()",realIntervalTime*1000+300);
realContent=setContent;
if(realTime>setTimes){
clearTimeout(autoSendMsg);
}
}
function getRoomMsgCd(){
if(!isNaN(Number(sendButton.innerText))){
return Number(sendButton.innerText);
}else{
return realIntervalTime;
}
}
function canSend(){
return sendButton.className.toLocaleString().search("is-gray")==-1;
}
</script>
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="https://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script> <script
src="https://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script>
<script src="js/bootstrapValidator.min.js"></script>
<script src="js/validate.js"></script>
<script src="js/template-web.js"></script>
<script src="js/main.js"></script>
</body>
</html>