Skip to content

Commit

Permalink
抽奖逻辑修改
Browse files Browse the repository at this point in the history
  • Loading branch information
Weslie0803 committed Oct 28, 2022
1 parent 3e5db25 commit 0ed46c8
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 54 deletions.
102 changes: 52 additions & 50 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,62 +62,64 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<div id="num1" class="showNum">
<div class="CardRolling" >
<ul>
<li><img src="抽奖软件UI/底色/复合/复合1.png" width="100%" height="100%" style="display: block;"></li>
<li><img src="抽奖软件UI/底色/复合/复合2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/金属/金属1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/金属/金属2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/非金/非金1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/非金/非金2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/高分子/高分子1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/高分子/高分子2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/复合/复合1.png" width="100%" height="100%" style="display: block;"></li>
</ul>
<div id="container" class="container">
<div class="row">
<div class="col-xs-4">
<div id="num1" class="showNum">
<div class="CardRolling" >
<ul>
<li><img src="抽奖软件UI/底色/复合/复合1.png" width="100%" height="100%" style="display: block;"></li>
<li><img src="抽奖软件UI/底色/复合/复合2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/金属/金属1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/金属/金属2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/非金/非金1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/非金/非金2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/高分子/高分子1.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/高分子/高分子2.png" width="100%" height="100%"></li>
<li><img src="抽奖软件UI/底色/复合/复合1.png" width="100%" height="100%" style="display: block;"></li>
</ul>
</div>

</div>

</div>
</div>
<div class="col-xs-4">
<div id="num2" class="showNum">
<div class="NumRolling" >
<ul>
<li><img src="抽奖软件UI/数字/0.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/1.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/2.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/3.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/4.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/5.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/6.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/7.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/8.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/9.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/0.png" style="display: block;"></li>
</ul>
<div class="col-xs-4">
<div id="num2" class="showNum">
<div class="NumRolling" >
<ul>
<li><img src="抽奖软件UI/数字/0.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/1.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/2.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/3.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/4.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/5.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/6.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/7.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/8.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/9.png" style="display: block;"></li>
<li><img src="抽奖软件UI/数字/0.png" style="display: block;"></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div id="num3" class="showNum">
<div class="BondRolling">
<ul>
<li><img src="抽奖软件UI/键和方式/1-H2.png"></li>
<li><img src="抽奖软件UI/键和方式/2-水.png"></li>
<li><img src="抽奖软件UI/键和方式/3-乙炔.png"></li>
<li><img src="抽奖软件UI/键和方式/4-正四面体.png"></li>
<li><img src="抽奖软件UI/键和方式/5-石墨.png"></li>
<li><img src="抽奖软件UI/键和方式/6-丙炔.png"></li>
<li><img src="抽奖软件UI/键和方式/7-简单立方.png"></li>
<li><img src="抽奖软件UI/键和方式/8-BCC.png"></li>
</ul>
<div class="col-xs-4">
<div id="num3" class="showNum">
<div class="BondRolling">
<ul>
<li><img src="抽奖软件UI/键和方式/1-H2.png"></li>
<li><img src="抽奖软件UI/键和方式/2-水.png"></li>
<li><img src="抽奖软件UI/键和方式/3-乙炔.png"></li>
<li><img src="抽奖软件UI/键和方式/4-正四面体.png"></li>
<li><img src="抽奖软件UI/键和方式/5-石墨.png"></li>
<li><img src="抽奖软件UI/键和方式/6-丙炔.png"></li>
<li><img src="抽奖软件UI/键和方式/7-简单立方.png"></li>
<li><img src="抽奖软件UI/键和方式/8-BCC.png"></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-xs-4">
<div id="num4" class="showNum"></div>
<div class="col-xs-4">
<div id="num4" class="showNum"></div>
</div>
</div>
</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ $(document).ready(function () {
$("#num2").css("display", "inherit");
$(".container").css("max-width", "730px");
$(".col-xs-4").css("width", "50%");
}
var toggleThirdPrize = function () {
$(".row").css("display", "none");
//TODO
}
// Lottery
var usedArr = [];
Expand All @@ -157,19 +161,19 @@ $(document).ready(function () {
$('body').keydown(function (event) {
if (event.which === 51) {// press key 3
prize = 3;
toggleSingleFrame();
toggleThirdPrize();
pressTimes = 0;
} else if(event.which === 50) {// press key 2
prize = 2;
toggleDoubleFrame();
toggleSecondPrize();
pressTimes = 0;
} else if(event.which === 49) {// press key 1
prize = 1;
toggleSingleFrame();
toggleFirstPrize();
pressTimes = 0;
} else if(event.which === 48) {// press key 0
prize = 0;
toggleSingleFrame();
toggleSpecialPrize();
pressTimes = 0;
}
if (config[5] === 0) {
Expand Down Expand Up @@ -200,6 +204,7 @@ $(document).ready(function () {
}
} else if(prize === 3){
if(event.which === 32 && pressTimes === 0){
// 旋转变形
// 抽出数字
pressTimes++;
} else if(event.which === 32 && pressTimes === 1){
Expand Down

0 comments on commit 0ed46c8

Please sign in to comment.