-
Notifications
You must be signed in to change notification settings - Fork 0
/
love.html
164 lines (149 loc) · 4.68 KB
/
love.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
<!-- ---
title: 爱我吗
header: 爱我吗
group: navigation
--- -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Love - feiyuliu</title>
<meta name="description" content="">
<meta name="author" content="By justjavac">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function(){
// 让两个按钮居中
var left = (document.width - 240) / 2;
$("#yes").offset({
"left" : left
});
$("#no").offset({
"left" : left + 130
});
// #no 按钮绑定鼠标移动事件
$("#no").mouseover(function(e){
// 随机生成下一个位置
var next_left = Math.random() * (document.width - 110);
var next_top = Math.random() * (document.height - 48);
// 判断下一个位置是否落在鼠标上
// @todo 下一个位置是否落在『#yes』按钮上
while (e.clientX > next_left && e.clientX < next_left+110) {
next_left = Math.random() * (document.width - 110);
}
while (e.clientY > next_top && e.clientY < next_top+48) {
next_top = Math.random() * (document.height - 48);
}
$("#no").offset({
"left" : next_left,
"top" : next_top
});
});
});
</script>
<style>
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 1.6em;
color: #333333;
background-color: #ffffff;
}
.btn {
position: absolute;
display: inline-block;
*display: inline;
/* IE7 inline-block hack */
font-weight: normal;
margin-right: 10px;
*zoom: 1;
padding: 14px 24px;
margin-bottom: 0;
font-size: 20px;
line-height: 18px;
color: #333333;
text-align: center;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
vertical-align: middle;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(top, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
border: 1px solid #cccccc;
border-bottom-color: #b3b3b3;
border-radius: 6px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
cursor: pointer;
*margin-left: .3em;
}
.btn:hover, .btn:active {
color: #333;
text-decoration: none;
background-color: #E6E6E6;
background-position: 0 -15px;
transition: background-position 0.1s linear;
}
.btn-yes {
background-color: #0074CC;
background-image: -moz-linear-gradient(top, #08C, #05C);
background-image: -ms-linear-gradient(top, #08C, #05C);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08C), to(#05C));
background-image: -webkit-linear-gradient(top, #08C, #05C);
background-image: -o-linear-gradient(top, #08C, #05C);
background-image: linear-gradient(top, #08C, #05C);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);
border-color: #05C #05C #003580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
}
.btn-yes:hover, .btn-yes:active {
background-color: #05C;
}
.btn-yes, .btn-yes:hover {
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
color: white;
}
pre {
display: block;
text-align: center;
width: 300px;
margin: 20px auto;
font-size: 2em;
line-height: 1.6em;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
}
#yes {
}
#no {
z-index: 999;
}
p{
text-align: center;
color: red;
}
</style>
</head>
<body>
<p>不支持IE浏览器,请用谷歌最新浏览器或者360最新浏览器</p>
<pre>做我女朋友吧?</pre>
<a id="yes" class="btn btn-yes"> 好啊好啊 </a>
<a id="no" class="btn btn-no"> 想得美呢 </a>
</body>
</html>