-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
187 lines (144 loc) · 6.23 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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!-- saved from url=(0028)https://tarot.keepfight.net/ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>塔羅線上抽牌</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><table width="90%" border="0" align="center" cellpadding="0" cellspacing="5">
<tbody><tr>
<td width="150" bgcolor="#05c1f5" onmouseover="pviiW3Cbg(this, '#05c1f5')" onmouseout="pviiW3Cbg(this, '#05c1f5')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(1)">一張牌陣</a></font></div></td>
<td width="150" bgcolor="#CC6600" onmouseover="pviiW3Cbg(this, '#993366')" onmouseout="pviiW3Cbg(this, '#CC6600')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(3)">三張牌陣</a></font></div></td>
<td width="150" bgcolor="#CC6600" onmouseover="pviiW3Cbg(this, '#666699')" onmouseout="pviiW3Cbg(this, '#CC6600')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(4)">四張牌陣</a></font></div></td>
<td width="150" bgcolor="#CC6600" onmouseover="pviiW3Cbg(this, '#FF6666')" onmouseout="pviiW3Cbg(this, '#CC6600')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(5)">五張牌陣</a></font></div></td>
<td width="150" bgcolor="#CC6600" onmouseover="pviiW3Cbg(this, '#669966')" onmouseout="pviiW3Cbg(this, '#CC6600')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(7)">七張牌陣</a></font></div></td>
<td width="150" bgcolor="#CC6600" onmouseover="pviiW3Cbg(this, '#CC9933')" onmouseout="pviiW3Cbg(this, '#CC6600')" style="background-color: rgb(0, 154, 196);"><div align="center"><font color="#FFFFFF"><a target="mainFrame" onclick="Drawing(9)">九張牌陣</a></font></div></td>
</tr>
</tbody></table></td>
</tr>
</tbody></table>
<table width="20%" border="0" align="center" cellpadding="0" cellspacing="5">
<td align="center"><img id = "pic0" src="a.png" width="120"></td>
<td align="center"><img id = "pic1" src="a.png" width="120"></td>
<td align="center"><img id = "pic2" src="a.png" width="120"></td>
<td align="center"><img id = "pic3" src="a.png" width="120"></td>
<td align="center"><img id = "pic4" src="a.png" width="120"></td>
<td align="center"><img id = "pic5" src="a.png" width="120"></td>
<td align="center"><img id = "pic6" src="a.png" width="120"></td>
<td align="center"><img id = "pic7" src="a.png" width="120"></td>
<td align="center"><img id = "pic8" src="a.png" width="120"></td>
</table>
<table align="center"><td align="center"><p id="p1">占卜序號</p></td></table>
<script type="text/javascript">
function getRandom(){
return Math.floor(Math.random()*78)+1;
}
function convert(dfdf){
var newdata = dfdf.split("-");
for(var t = 0;t < newdata.length;t++){
console.log(newdata[t]);
}
for(var i = 0;i<newdata.length;i = i+2){
var s = "cards/" + newdata[i] + "/" + newdata[i+1] +".jpg";
var j = i/2;
console.log(j);
var obj = document.getElementById("pic"+j);
console.log(s);
obj.src = s;
}
if(newdata.length/2 < 9){
var ll = (newdata.length/2);
var dd = 9 - ll;
for(ss = 0;ss<dd;ss++){
var temm = ll + ss;
console.log(temm);
var obj = document.getElementById("pic"+temm);
obj.src = "";
}
}
}
function convert2(){
var dfdf = document.getElementById("cards").value;
var newdata = dfdf.split("-");
for(var t = 0;t < newdata.length;t++){
console.log(newdata[t]);
}
for(var i = 0;i<newdata.length;i = i+2){
var s = "cards/" + newdata[i] + "/" + newdata[i+1] +".jpg";
var j = i/2;
console.log(j);
var obj = document.getElementById("pic"+j);
console.log(s);
obj.src = s;
}
if(newdata.length/2 < 9){
var ll = (newdata.length/2);
var dd = 9 - ll;
for(ss = 0;ss<dd;ss++){
var temm = ll + ss;
console.log(temm);
var obj = document.getElementById("pic"+temm);
obj.src = "";
}
}
}
function Drawing(cardNum){
alert("請想著問題點選確定" + cardNum);
var xs = new Array(cardNum);
console.log("測試");
var x = getRandom();
xs[0] = x;
var i = 1;
while(i < cardNum){
var isrepeat = true;
var t = getRandom();
while(isrepeat){
t = getRandom();
isrepeat = false;
for(var a = 0;a < i;a++){
if(t == xs[a]){
isrepeat = true;
}
}
}
xs[i] = t;
i++;
}
var ys = new Array(cardNum);
for(var g = 0 ;g<cardNum;g++){
ys[g] = getRandom();
if(ys[g] < 39){
ys[g] = 0;
}
if(ys[g] > 38){
ys[g] = 1;
}
}
var answer = "";
for(var z = 0;z<cardNum;z++){
answer = answer + ys[z] + "-"+ xs[z];
if(z != (cardNum-1)){
answer = answer + "-";
}
}
document.getElementById("p1").innerHTML="本次占卜序號"+answer;
convert(answer);
}
</script>
<!---<button onclick="Drawing(1)" style="background-image:url(a.png);width:80px;height:25px;"></button>
<button onclick="Drawing(3)" style="background-image:url(a.png);width:80px;height:25px;"></button>
<button onclick="Drawing(5)" style="background-image:url(a.png);width:80px;height:25px;"></button>-->
<p></p>
<table align="center">
<form name="form" id="form" >
<td align="center"><label>輸入占卜序號</label></td>
<td align="center"><input type="text" name="cards" id="cards"></td>
<td align="center"><input type="button" name="submit" value="送出" onclick="convert2()"></td>
</form>
</table>
</body>
</html>