Showing
3 changed files
with
86 additions
and
13 deletions
js/data.js
0 → 100644
This diff is collapsed. Click to expand it.
js/ready.js
0 → 100644
1 | + | ||
2 | +//회차별 당첨번호를 가지고 오기 위하여 테이블을 만들고 data를 가지고 오기 위해 주소를 변경하는 함수 | ||
3 | +$(document).ready(function () { | ||
4 | + | ||
5 | + loadlot(1); | ||
6 | + var dropdown = $('#selectBox'); | ||
7 | + var form = $('#form'); | ||
8 | + var result = $('#result'); | ||
9 | + var a2=$('#a1'); | ||
10 | + for (i = 1; i < 862; i++) { | ||
11 | + var option = $('<option>'); | ||
12 | + option.val(i).text(i+'회차'); | ||
13 | + dropdown.append(option); | ||
14 | + } | ||
15 | + form.on('submit', function (event) { | ||
16 | + event.preventDefault(); | ||
17 | + if (!dropdown.val()) { | ||
18 | + alert('뭔가 선택을 하세요.'); | ||
19 | + dropdown.focus(); | ||
20 | + } else { | ||
21 | + var lotto_parent = document.getElementById("winner"); | ||
22 | + for(i=0;i<7;i++) { | ||
23 | + if(i==6) { | ||
24 | + var lotto_child=document.getElementById("output"+i); | ||
25 | + lotto_child.remove(); | ||
26 | + $("#plus").after('<div class="output" id=output'+i+'></div>'); | ||
27 | + } | ||
28 | + else { | ||
29 | + var lotto_child=document.getElementById("output"+i); | ||
30 | + lotto_child.remove(); | ||
31 | + $("#plus").before('<div class="output" id=output'+i+'></div>'); | ||
32 | + } | ||
33 | + } | ||
34 | + loadlot(862-dropdown.val()); | ||
35 | + | ||
36 | + | ||
37 | + /* | ||
38 | + //회차별로 api에서 당첨번호를 끌어오기 위한 문자열 주소 조합 | ||
39 | + document.getElementById("lotto_api_src").src="http://lotto.kaisyu.com/api?method=get&gno="+dropdown.val()+";callback=loadlot"; | ||
40 | + //api에서 data를 끌어올때 최초 1회만 끌어올수 있는 문제를 해결하기 위한 방안 | ||
41 | + var lotto_parent = document.getElementById("lotto_api_data"); | ||
42 | + var lotto_child=document.getElementById("lotto_api_src"); | ||
43 | + lotto_child.remove(); | ||
44 | + child_node=document.createElement('script'); | ||
45 | + child_node.id="lotto_api_src"; | ||
46 | + lotto_parent.append(child_node); | ||
47 | + */ | ||
48 | + | ||
49 | + | ||
50 | + } | ||
51 | + }); | ||
52 | +}); |
... | @@ -7,21 +7,26 @@ | ... | @@ -7,21 +7,26 @@ |
7 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | 7 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
8 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | 8 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
9 | <meta name="theme-color" content="#212121" /> | 9 | <meta name="theme-color" content="#212121" /> |
10 | - <title>로또 번호 생성기</title> | 10 | + <title>Lotto 분석 및 생성</title> |
11 | <link rel="stylesheet" type="text/css" href="/style.css"> | 11 | <link rel="stylesheet" type="text/css" href="/style.css"> |
12 | <script src="/jquery.js" type="text/javascript"></script> | 12 | <script src="/jquery.js" type="text/javascript"></script> |
13 | <script src="/main.js" type="text/javascript"></script> | 13 | <script src="/main.js" type="text/javascript"></script> |
14 | - <script defer="" type="text/javascript" src="http://lotto.kaisyu.com/api?method=get&callback=loadlot" ></script> | 14 | + <script src="/data.js" type="text/javascript"></script> |
15 | - | 15 | + <script src="/ready.js" type="text/javascript"></script> |
16 | + <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | ||
17 | + <script type="text/javascript"> | ||
18 | + google.charts.load('current', {'packages':['corechart']}); | ||
19 | + </script> | ||
20 | + <div style="height:1800px; background-color: ivory"> | ||
21 | + | ||
16 | 22 | ||
17 | </head> | 23 | </head> |
18 | 24 | ||
19 | <body> | 25 | <body> |
20 | - | 26 | + <H2>Lotto 분석 & 번호 생성</H2> |
21 | - <H2>로또 번호 생성 & 당첨 확인</H2> | 27 | + <p>랜덤 생성 기능은 무작위로 번호를 생성하여 선택한 회차의 당첨번호와 비교합니다.</p> |
22 | - <p>로또 번호를 생성하고 각 회차의 당첨번호와 비교합니다</p> | 28 | + <p>생성한 번호의 횟수를 누적하여 그 결과를 토대로 번호를 추천해줍니다.</p> |
23 | - <p>회차 선택시 1등 당첨번호가 바뀌며 선택한 회차의 당첨번호와</p> | 29 | + <p>역대 출현한 번호들의 누적횟수와 패턴을 통하여 랜덤하게 번호를 생성해줍니다.</p> |
24 | - <p>생성한 당첨번호를 비교하여 각 등수의 당첨확률을 보여줍니다</p> | ||
25 | <div class="container"> | 30 | <div class="container"> |
26 | <div class="row p-4"> | 31 | <div class="row p-4"> |
27 | <div class="col-xs-12"> | 32 | <div class="col-xs-12"> |
... | @@ -41,9 +46,9 @@ | ... | @@ -41,9 +46,9 @@ |
41 | </div> | 46 | </div> |
42 | 47 | ||
43 | 48 | ||
44 | - <p style="position:absolute;top:calc(35% + 100px);width:100%;"> | 49 | + <p id="event_section" style="position:absolute;top:calc(38% + 100px);width:100%;"> |
45 | 랜덤 번호 생성 <input type="text" id="inputnum" value="5" size="2">번 <span class="key" onclick="count()">시작</span><span class="key" onclick=" | 50 | 랜덤 번호 생성 <input type="text" id="inputnum" value="5" size="2">번 <span class="key" onclick="count()">시작</span><span class="key" onclick=" |
46 | -accumulate_number()">누적번호&번호추천</span><span class="key" onclick="resets()">초기화</span> | 51 | +accumulate_number()">누적번호&번호추천</span><span class="key" onclick="resets()">초기화</span><span class="key" onclick="graph_accum()">패턴 & 번호추천</span><span class="key" onclick="patten()">역대 번호별 누적횟수</span> |
47 | </p> | 52 | </p> |
48 | 53 | ||
49 | <section id="winner" class="shadow"> | 54 | <section id="winner" class="shadow"> |
... | @@ -54,15 +59,31 @@ accumulate_number()">누적번호&번호추천</span><span class="key" onclick=" | ... | @@ -54,15 +59,31 @@ accumulate_number()">누적번호&번호추천</span><span class="key" onclick=" |
54 | <div class="output" id="output3"></div> | 59 | <div class="output" id="output3"></div> |
55 | <div class="output" id="output4"></div> | 60 | <div class="output" id="output4"></div> |
56 | <div class="output" id="output5"></div> | 61 | <div class="output" id="output5"></div> |
57 | - <div class="output" style="box-shadow:none; color:#000;">+</div> | 62 | + <div class="output" style="box-shadow:none; color:#000;" id="plus">+</div> |
58 | <div class="output" id="output6"></div> | 63 | <div class="output" id="output6"></div> |
59 | </section> | 64 | </section> |
60 | 65 | ||
66 | + | ||
67 | + <div id="lotto_api_data2"> | ||
68 | + <script id="lotto_api_src2"></script> | ||
69 | + </div> | ||
70 | + | ||
61 | <div id="stats"></div> | 71 | <div id="stats"></div> |
62 | <ol id="lottotable"></ol> | 72 | <ol id="lottotable"></ol> |
63 | <ol id="accumulate_table"></ol> | 73 | <ol id="accumulate_table"></ol> |
64 | - <ol id="recom_table"></ol> | 74 | + <ol id="recom_table"></ol> |
65 | - | 75 | + <ol id="patten_table"></ol> |
76 | + <ol id="patten_recom_table"></ol> | ||
77 | + <section id="graph_section"> | ||
78 | + <div id="chart_div_1"></div> | ||
79 | + <section id="graph_section2"> | ||
80 | + <div id="chart_div_2"></div> | ||
81 | + </section> | ||
82 | + <section id="graph_section3"> | ||
83 | + <div id="chart_div_3"></div> | ||
84 | + <section id="graph_section4"> | ||
85 | + <div id="chart_div_4"></div> | ||
86 | + </section> | ||
66 | 87 | ||
67 | 88 | ||
68 | </body> | 89 | </body> | ... | ... |
-
Please register or login to post a comment