-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·143 lines (133 loc) · 5.98 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width,initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no">
<meta name="x5-fullscreen" content="true">
<meta name="full-screen" content="yes">
<link rel="shortcut icon" href="image/sorry.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="image/sorry.ico" type="image/vnd.microsoft.icon" />
<title>对不起留言板——在区块链中记录你再也无法说出口的对不起</title>
<link rel="stylesheet" href="lib/bootstrap-4.0.0-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="lib/spin.css">
</head>
<body>
<nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand" href="./index.html">对不起留言板</a>
<ul class="nav nav-pills">
<li>
<a href="./search.html">
<button type="button" class="btn btn-primary mr-2">搜索</button>
</a>
</li>
<li>
<a href="./history.html">
<button type="button" class="btn btn-primary mr-2">历史</button>
</a>
</li>
<li>
<a href="https://blog.mouxuezha.com/" target="_blank">
<button type="button" class="btn btn-primary mr-2">关于我们</button>
</a>
</li>
</ul>
</nav>
<div class="ml-5 mt-3 mr-5 mb-3">
<div>
<h3>对不起留言板</h3>
<div class="ml-2 mt-1">
<p class="font-italic">在区块链中记录你再也无法说出口的对不起</p>
</div>
</div>
</div>
<div>
<div class="noExtension d-none" id="noExtension">
请先安装
<a target="_blank" href="https://github.com/ChengOrangeJu/WebExtensionWallet">WebExtensionWallet</a>
</div>
<div class="ml-5 mt-3 mr-5">
<hr>
<div class="mb-5">
<div class="form-group row mt-3">
<label for="inputSender" class="col-sm-2 col-form-label">你的名字: </label>
<div class="col-sm-10">
<input type="text" maxlength="50"class="form-control" id="inputSender" placeholder="你的名字">
</div>
</div>
<div class="form-group row mt-3">
<label for="inputRecipient" class="col-sm-2 col-form-label">对方的名字: </label>
<div class="col-sm-10">
<input type="text" maxlength="50"class="form-control" id="inputRecipient" placeholder="对方的名字">
</div>
</div>
<div class="form-group row mt-3">
<label for="inputContent" class="col-sm-2 col-form-label">没来及说出的话: </label>
<div class="col-sm-10">
<textarea maxlength="200" id="inputContent" class="span6 form-control" rows="3" placeholder="你想说些什么?" required></textarea>
</div>
</div>
<button type="button" id="submit" onclick="submitHandler()" class="btn btn-primary float-right">提交</button>
</div>
</div>
</div>
<script src=lib/jquery-3.3.1.min.js></script>
<script src=lib/nebPay.js></script>
<script src=lib/bootstrap-4.0.0-dist/js/bootstrap.min.js></script>
<script src=lib/nebulas.js></script>
<script src="lib/spin.js"></script>
<script>
"use strict";
//opts 可从网站在线制作
var opts = {
lines: 13, // 花瓣数目
length: 20, // 花瓣长度
width: 10, // 花瓣宽度
radius: 30, // 花瓣距中心半径
corners: 1, // 花瓣圆滑度 (0-1)
rotate: 0, // 花瓣旋转角度
direction: 1, // 花瓣旋转方向 1: 顺时针, -1: 逆时针
color: '#333333', // 花瓣颜色
speed: 1, // 花瓣旋转速度
trail: 60, // 花瓣旋转时的拖影(百分比)
shadow: false, // 花瓣是否显示阴影
hwaccel: false, //spinner 是否启用硬件加速及高速旋转
className: 'spinner', // spinner css 样式名称
zIndex: 2e9, // spinner的z轴 (默认是2000000000)
top: '50%', // spinner 相对父容器Top定位 单位 px
left: '50%'// spinner 相对父容器Left定位 单位 px
};
var dappAddress = "n1n2BJQYHwfWLJfEtHfEhjGQsPd8UBnGZ2n"
var NebPay = require("nebpay");
var nebPay = new NebPay();
var spinner = undefined;
function submitHandler() {
if ($("#inputSender").val().length === 0) {
alert("Please input your name!");
} else if ($("#inputRecipient").val().length === 0) {
alert("Please input other name!")
} else if ($("#inputContent").val().length === 0) {
alert("Please input content!")
} else if ($("#inputSender").val().length > 100) {
alert("Your name limit 100!")
} else if ($("#inputRecipient").val().length > 100) {
alert("Other name limit 100!")
} else if ($("#inputContent").val().length > 5000) {
alert("Content limit 5000!")
} else {
spinner = new Spinner(opts).spin($('body').get(0));//显示加载
var to = dappAddress;
var value = "0";
var callFunction = "save";
var callArgs = "[\"" + $("#inputContent").val() + "\",\"" + $("#inputSender").val() + "\",\"" + $("#inputRecipient").val() + "\"]";
nebPay.call(to, value, callFunction, callArgs, {
listener: function (resp) {
spinner.spin();//移除加载
console.log("thecallback is " + resp)
}
})
}
}
</script>
</body>
</html>