-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp.html
139 lines (131 loc) · 5.93 KB
/
temp.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<title>小抽奖游戏,最先两次一次就刷出中奖页面的可以自选一本技术书,到我这里备案</title>
</head>
<body>
<div class="game-wrap">
<div id="box"></div>
<button id="button">点击刷新</button>
</div>
<style type="text/css">
html{height:100%;overflow:hidden;}
*{-webkit-tap-highlight-color: rgba(0,0,0,0);}
body{background:-webkit-gradient(linear, left top, left bottom, from(#F5EED4), to(#EBD996));background-size:100%}
#box{position:relative;margin:50px auto;width:200px;padding:25px;color:#333;border:1px solid #F5D193;background:#fff;-webkit-box-shadow: 1px 1px 4px rgba(0,0,0, 0.1);-webkit-border-bottom-right-radius: 60px 5px;line-height:1.6;text-shadow:0 0 1px #f1f1f1;}
#box:before{position:absolute;display:block;content:"";background:#fff;border: 1px solid #F5D193;-webkit-box-shadow: 3px 1px 8px rgba(0,0,0, 0.1);right:0;bottom:0;padding:0 0 1px 0;width:98%;height:100%;z-index:-1;-webkit-transform: skew(2deg,2deg) translate(3px,8px);-webkit-box-shadow: 0px 0px 8px rgba(0,0,0, 0.1);-webkit-border-bottom-right-radius:60px 5px;}
#box:after{position:absolute;display:block;content:"";background:#fff;border: 1px solid #F5D193;-webkit-box-shadow: 1px 1px 8px rgba(0,0,0, 0.1);right:0;bottom:0;padding:0 0 1px 0;width:98%;height:100%;z-index:-1;-webkit-transform: skew(2deg,2deg) translate(-1px,2px);-webkit-box-shadow: 0px 0px 8px rgba(0,0,0, 0.1);-webkit-border-bottom-right-radius:60px 5px;}
#button{margin:0 auto;width:100px;height:100px;display:block;border:none;color:#fff;background:#FFB643;box-shadow: 0 0 1px #ccc;border-radius:50px;background:#FFB643;
box-shadow: 1px 1px 1px #ccc;font-size:16px;}
span{color:red;}
</style>
<script type="text/javascript">
var random = Math.random() * 5000;
if(!window.localStorage.temp){
window.localStorage.temp = 0
}
var arr = ['不要在意那些细节!', '苏宁苏宁我为你自豪!', '呀,你没有中奖!', '除了闲聊你们每天都干了什么!', '我最喜欢舒肤佳了!']
window.localStorage.temp++;
if(parseInt(random,10) > 4800){
document.getElementById('box').innerHTML = "中奖了,您只用了<span>" + window.localStorage.temp + "<span>次";
window.localStorage.temp = 0;
} else {
document.getElementById('box').innerHTML = arr[parseInt((Math.random() * 5),10)] + "继续刷新才能中奖,你已经刷新了<span>" + window.localStorage.temp + "</span>次";
}
document.getElementById('button').onclick = function(){
window.location.href = window.location.href;
};
(function(window) {
function pageShare(options) {
var o = options;
this.linkUrl = window.location.href;
this.imgUrl = o.imgUrl||"";
this.shareTitle = o.shareTitle || "";
this.souhuTitle = o.souhuTitle || "";
this.descContent = o.descContent || "";
this.pict = "";
this.appid = "";
this._initShare();
return this;
}
pageShare.prototype = {
constructor: pageShare,
_initShare: function() {
var that=this;
// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function(argv) {
that._shareFriend();
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function(argv) {
that._shareTimeline();
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function(argv) {
that._shareWeibo();
});
}, false);
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.call('hideToolbar');
});
that._shareWb();
},
//微信分享
_shareFriend: function() {
var that = this;
WeixinJSBridge.invoke('sendAppMessage', {
"appid": that.appid,
"img_url": that.imgUrl,
"img_width": "200",
"img_height": "200",
"link": that.linkUrl,
"desc": that.descContent,
"title": that.shareTitle
}, function(res) {
//_report('send_msg', res.err_msg);
});
},
_shareWeibo: function() {
var that = this;
WeixinJSBridge.invoke('shareWeibo', {
"content": that.descContent,
"url": that.linkUrl,
}, function(res) {
//_report('weibo', res.err_msg);
});
},
_shareTimeline: function() {
var that = this;
WeixinJSBridge.invoke('shareTimeline', {
"img_url": that.imgUrl,
"img_width": "200",
"img_height": "200",
"link": that.linkUrl,
"desc": that.descContent,
"title": that.shareTitle
}, function(res) {
//_report('timeline', res.err_msg);
});
},
}
window.pageShare=pageShare;
})(window)
//微信分享操作
var shareThis = new pageShare({
//分享的标题
shareTitle:"小抽奖游戏" + Date.now(),
//微信分享的内容概要
descContent:"最先两次一次就刷出中奖页面的可以自选一本技术书,到我这里备案",
//微信分享的缩略图的地址
imgUrl:"http://image1.suning.cn/content/catentries/00000000012142/000000000121425819/000000000121425819_ls1.jpg"
});
</script>
</body>
</html>