-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlottery.html
executable file
·193 lines (165 loc) · 5.75 KB
/
lottery.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>抽奖啦!!!</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/reset.css">
<link rel="stylesheet" href="./css/animate.min.css">
<link rel="stylesheet" href="./css/lottery.css">
<link rel="stylesheet" href="./css/index.css">
<link rel="stylesheet" href="./css/loading2.css">
<link rel="stylesheet" href="./css/style.css">
<style id="styles"></style>
<style id="styles1"></style>
</head>
<body>
<div id="container" class="scene">
<!-- title -->
<div class="jiangpingtext hide">
<span id="jiangpingsspan"></span>
</div>
<div id="luck-list"></div>
<div class="star"></div>
</div>
<div id="menu" style="display: none;">
<button id="table">TABLE</button>
<button id="sphere">SPHERE</button>
<button id="helix">HELIX</button>
<button id="grid">GRID</button>
</div>
<audio id="runingmic" class="hide" loop>
<source src="./music/rolling.mp3">
</audio>
<audio id="pausemic" class="hide">
<source src="./music/stop.mp3">
</audio>
<!--loading加载-->
<div class="loading">
<div id="colorfulPulse">
<span class="item-1"></span>
<span class="item-2"></span>
<span class="item-3"></span>
<span class="item-4"></span>
<span class="item-5"></span>
<span class="item-6"></span>
<span class="item-7"></span>
</div>
</div>
<!--音乐开关-->
<a id="music-control" class="animated infinite bounce" href="javascript:;" data-open="1"></a>
<!--清除已抽奖信息-->
<a id="clear-control" href="javascript:;" data-open="1"></a>
<audio id="music" loop="loop" preload="auto" src="./music/background.mp3">
你的浏览器不支持audio标签
</audio>
<!-- 抽奖按钮 -->
<div class="bonus">
<div class="dropdown fl">
<button class="btn btn-default btn-sm dropdown-toggle" type="button" id="jiangping" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<sapn id="levelType">请选择奖项</sapn>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="jiangping" id="prize-list">
</ul>
</div>
<div class="dropdown fl">
<button class="btn btn-default btn-sm dropdown-toggle" type="button" id="lucknum" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<sapn id="lucknum">人数</sapn>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="lucknum">
<li><a href="javascript:void(0);" onclick="setLuckNum(1)">1</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(2)">2</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(3)">3</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(4)">4</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(5)">5</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(6)">6</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(8)">8</a></li>
<li><a href="javascript:void(0);" onclick="setLuckNum(10)">10</a></li>
</ul>
</div>
<button class="btn btn-sm btn-success fl" onclick="setPrize()"><span>开始抽奖</span></button>
</div>
<!-- script -->
<script src="./js/threejs/three.js"></script>
<script src="./js/threejs/tween.js"></script>
<script src="./js/threejs/controls/TrackballControls.js"></script>
<script src="./js/threejs/renderers/CSS3DRenderer.js"></script>
<script src="./js/jquery-2.1.4.min.js"></script>
<script src="./js/dropdown.js"></script>
<script src="./js/index.js"></script>
<script src="./js/lottery.js"></script>
<script src="./js/star.js"></script>
<script src="./js/CommentCoreLibrary.js"></script>
<script>
var wW = $(window).width();
var wH = $(window).height();
$('body,div.scene').css({
width: wW + 'px',
height: wH + 'px'
});
var bg = localStorage.getItem('bg');
if (bg && parseInt(bg) > 0) {
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.href = "./css/bg" + bg + ".css";
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link);
}
// var userList = null;
// 加载进度条并执行球
// $.getJSON('user.json', {}, function (data) {
// userList = data.userList;
// totalperson = userList.length;
// 隐藏进度条
$('div.loading').fadeOut(500);
// });
var music = document.getElementById('music');
$(function () {
if (prizes) { // load in index.js
prizes = JSON.parse(localStorage.getItem('prizes'));
}
var liStr = ''
for (let i = 0; i < prizes.length; i++) {
liStr += '<li><a href="javascript:void(0);" onclick="setPrizeLevel(' + prizes[i].level + ')">' + prizes[i].name + '</a></li>' + "\n"
}
$('#prize-list').append(liStr);
$('#music-control').removeClass('animated infinite bounce');
$('#music-control').click(function () {
if (music.paused) {
$('#music-control').addClass('animated infinite bounce');
music.play().then(
() => {
},
() => {
$('#music-control').removeClass('animated infinite bounce');
console.log("背景音乐自动播放失败,请手动播放!");
}
);
} else {
$('#music-control').removeClass('animated infinite bounce');
music.pause();
}
});
$('#music-control').click();
// 清除数据开关
$('#clear-control').click(function () {
var sure = confirm('确定清除已抽奖信息?!清除后不可恢复!!!');
if (sure) {
localStorage.removeItem('players');
localStorage.removeItem('isWinningedsJson');
localStorage.removeItem('isWinningeds');
window.location.reload();
}
});
init();
animate();
});
</script>
</body>
</html>