Spaces:
Running
Running
BraydenMoore
commited on
Commit
β’
c8cf1db
1
Parent(s):
6e8090a
Git update
Browse files- Source/Data/gbg_and_odds_this_year.csv +1 -1
- Source/Data/gbg_this_year.csv +1 -1
- Source/Data/lines.json +10 -10
- Templates/index.html +92 -0
Source/Data/gbg_and_odds_this_year.csv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 27668
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:50b3b58f86136e21b5f840f9662fe345978d02b9b3a405b2b36b9bd0092f4b5c
|
3 |
size 27668
|
Source/Data/gbg_this_year.csv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 24329
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e84c713bd6186f61e03ef4a77221b21e4d3da826cdb1072efc9aa03da28cf6ff
|
3 |
size 24329
|
Source/Data/lines.json
CHANGED
@@ -37,19 +37,19 @@
|
|
37 |
],
|
38 |
"4":[
|
39 |
45.5,
|
40 |
-
|
41 |
53.5,
|
42 |
-
45.5,
|
43 |
46,
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
50 |
48,
|
51 |
-
43,
|
52 |
-
|
53 |
41.5,
|
54 |
47
|
55 |
]
|
|
|
37 |
],
|
38 |
"4":[
|
39 |
45.5,
|
40 |
+
42.5,
|
41 |
53.5,
|
|
|
42 |
46,
|
43 |
+
47,
|
44 |
+
39,
|
45 |
+
42,
|
46 |
+
45.5,
|
47 |
+
40,
|
48 |
+
43.0,
|
49 |
+
41.5,
|
50 |
48,
|
51 |
+
43.5,
|
52 |
+
43.5,
|
53 |
41.5,
|
54 |
47
|
55 |
]
|
Templates/index.html
CHANGED
@@ -109,6 +109,10 @@
|
|
109 |
margin: 0;
|
110 |
transition: 0.3s ease;
|
111 |
}
|
|
|
|
|
|
|
|
|
112 |
.over-under-wrapper {
|
113 |
cursor: default;
|
114 |
position: relative;
|
@@ -237,6 +241,10 @@
|
|
237 |
width: 80%;
|
238 |
display: inline-block;
|
239 |
}
|
|
|
|
|
|
|
|
|
240 |
#weekSelector {
|
241 |
transition: 0.3s ease;
|
242 |
border-radius: 10px;
|
@@ -248,6 +256,10 @@
|
|
248 |
#weekSelector:hover {
|
249 |
opacity: 0.5;
|
250 |
}
|
|
|
|
|
|
|
|
|
251 |
@keyframes spin {
|
252 |
0% {
|
253 |
transform: rotate(0deg);
|
@@ -369,6 +381,10 @@
|
|
369 |
for(let i = table.rows.length - 1; i > 0; i--) {
|
370 |
table.deleteRow(i);
|
371 |
}
|
|
|
|
|
|
|
|
|
372 |
const columns = ['Date','Away Team', 'Home Team'];
|
373 |
const lines_response = await fetch('/get_lines');
|
374 |
const lines = await lines_response.json()
|
@@ -458,6 +474,10 @@
|
|
458 |
wrapperDiv.appendChild(winnerImg);
|
459 |
const winnerEmojiDiv = document.createElement('div');
|
460 |
winnerEmojiDiv.className = 'emoji';
|
|
|
|
|
|
|
|
|
461 |
wrapperDiv.dataset.proba = (moneyline.Probabilities[0] * 100).toFixed(0);
|
462 |
if (moneyline.Winner[0] === moneyline.Result) {
|
463 |
winnerEmojiDiv.textContent = 'β
';
|
@@ -496,6 +516,10 @@
|
|
496 |
overUnderDiv.appendChild(textDiv);
|
497 |
const overEmojiDiv = document.createElement('div');
|
498 |
overEmojiDiv.className = 'emoji';
|
|
|
|
|
|
|
|
|
499 |
overUnderDiv.dataset.proba = (data.over_unders[index]['Probability'][0] * 100).toFixed(0);
|
500 |
if (data.over_unders[index]['Over/Under'][0] === data.over_unders[index]['Result']) {
|
501 |
overEmojiDiv.textContent = 'β
';
|
@@ -510,6 +534,10 @@
|
|
510 |
overUnderDiv.classList.remove('hidden');
|
511 |
}, 10);
|
512 |
overUnderCell.appendChild(overUnderDiv);
|
|
|
|
|
|
|
|
|
513 |
showProbabilityOnHover(wrapperDiv);
|
514 |
showProbabilityOnHover(overUnderDiv);
|
515 |
|
@@ -517,21 +545,41 @@
|
|
517 |
}
|
518 |
});
|
519 |
}
|
|
|
|
|
|
|
|
|
520 |
//Hover listener
|
521 |
function showProbabilityOnHover(div) {
|
522 |
let previousValue;
|
523 |
let divText = div.children[1];
|
524 |
let eventProcessed = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
525 |
function handleEnter() {
|
526 |
if (eventProcessed) return; // Skip if an event has already been processed
|
|
|
527 |
eventProcessed = true;
|
|
|
528 |
if (divText.textContent !== `(${div.dataset.proba}%)`) {
|
529 |
divText.style.opacity = 0;
|
|
|
|
|
530 |
setTimeout(() => {
|
531 |
previousValue = divText.textContent;
|
532 |
divText.textContent = `(${div.dataset.proba}%)`;
|
533 |
divText.style.opacity = 1;
|
534 |
}, 300);
|
|
|
|
|
|
|
|
|
535 |
setTimeout(() => {
|
536 |
divText.style.opacity = 0;
|
537 |
setTimeout(() => {
|
@@ -542,16 +590,28 @@
|
|
542 |
}, 1000);
|
543 |
}
|
544 |
}
|
|
|
|
|
|
|
|
|
545 |
// For desktop
|
546 |
div.addEventListener('mouseenter', handleEnter);
|
547 |
// For mobile
|
548 |
div.addEventListener('touchstart', handleEnter);
|
549 |
}
|
|
|
|
|
|
|
|
|
550 |
// Populate dropdown
|
551 |
let selectedWeek;
|
552 |
async function populateDropdown() {
|
553 |
const weekSelector = document.getElementById('weekSelector');
|
554 |
weekSelector.innerHTML = "";
|
|
|
|
|
|
|
|
|
555 |
const response = await fetch('/get_weeks');
|
556 |
const data = await response.json();
|
557 |
|
@@ -560,6 +620,10 @@
|
|
560 |
option.value = week;
|
561 |
option.text = `Week ${week}`;
|
562 |
weekSelector.appendChild(option);
|
|
|
|
|
|
|
|
|
563 |
if (index === 0) {
|
564 |
selectedWeek = week;
|
565 |
}
|
@@ -572,6 +636,11 @@
|
|
572 |
selectedWeek = event.target.value;
|
573 |
getNew();
|
574 |
});
|
|
|
|
|
|
|
|
|
|
|
575 |
// Initial load
|
576 |
function loadThings() {
|
577 |
populateDropdown()
|
@@ -579,10 +648,18 @@
|
|
579 |
.then(() => submitData())
|
580 |
.catch(error => console.error(error));
|
581 |
}
|
|
|
|
|
|
|
|
|
582 |
// Get new
|
583 |
async function getNew() {
|
584 |
const table = document.getElementById('gameTable');
|
585 |
table.style.opacity = "0.5";
|
|
|
|
|
|
|
|
|
586 |
try {
|
587 |
await fetchGames(selectedWeek);
|
588 |
await submitData();
|
@@ -591,14 +668,29 @@
|
|
591 |
console.error(error);
|
592 |
}
|
593 |
}
|
|
|
594 |
// Submit on click, enter, and pageload
|
595 |
loadThings();
|
596 |
document.getElementById('submitButton').addEventListener('click', submitData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
document.addEventListener('keydown', function(event) {
|
598 |
if (event.keyCode === 13) {
|
599 |
submitData();
|
600 |
}
|
601 |
});
|
|
|
|
|
|
|
|
|
|
|
602 |
</script>
|
603 |
|
604 |
</body>
|
|
|
109 |
margin: 0;
|
110 |
transition: 0.3s ease;
|
111 |
}
|
112 |
+
<<<<<<< HEAD
|
113 |
+
=======
|
114 |
+
|
115 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
116 |
.over-under-wrapper {
|
117 |
cursor: default;
|
118 |
position: relative;
|
|
|
241 |
width: 80%;
|
242 |
display: inline-block;
|
243 |
}
|
244 |
+
<<<<<<< HEAD
|
245 |
+
=======
|
246 |
+
|
247 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
248 |
#weekSelector {
|
249 |
transition: 0.3s ease;
|
250 |
border-radius: 10px;
|
|
|
256 |
#weekSelector:hover {
|
257 |
opacity: 0.5;
|
258 |
}
|
259 |
+
<<<<<<< HEAD
|
260 |
+
=======
|
261 |
+
|
262 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
263 |
@keyframes spin {
|
264 |
0% {
|
265 |
transform: rotate(0deg);
|
|
|
381 |
for(let i = table.rows.length - 1; i > 0; i--) {
|
382 |
table.deleteRow(i);
|
383 |
}
|
384 |
+
<<<<<<< HEAD
|
385 |
+
=======
|
386 |
+
|
387 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
388 |
const columns = ['Date','Away Team', 'Home Team'];
|
389 |
const lines_response = await fetch('/get_lines');
|
390 |
const lines = await lines_response.json()
|
|
|
474 |
wrapperDiv.appendChild(winnerImg);
|
475 |
const winnerEmojiDiv = document.createElement('div');
|
476 |
winnerEmojiDiv.className = 'emoji';
|
477 |
+
<<<<<<< HEAD
|
478 |
+
=======
|
479 |
+
|
480 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
481 |
wrapperDiv.dataset.proba = (moneyline.Probabilities[0] * 100).toFixed(0);
|
482 |
if (moneyline.Winner[0] === moneyline.Result) {
|
483 |
winnerEmojiDiv.textContent = 'β
';
|
|
|
516 |
overUnderDiv.appendChild(textDiv);
|
517 |
const overEmojiDiv = document.createElement('div');
|
518 |
overEmojiDiv.className = 'emoji';
|
519 |
+
<<<<<<< HEAD
|
520 |
+
=======
|
521 |
+
|
522 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
523 |
overUnderDiv.dataset.proba = (data.over_unders[index]['Probability'][0] * 100).toFixed(0);
|
524 |
if (data.over_unders[index]['Over/Under'][0] === data.over_unders[index]['Result']) {
|
525 |
overEmojiDiv.textContent = 'β
';
|
|
|
534 |
overUnderDiv.classList.remove('hidden');
|
535 |
}, 10);
|
536 |
overUnderCell.appendChild(overUnderDiv);
|
537 |
+
<<<<<<< HEAD
|
538 |
+
=======
|
539 |
+
|
540 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
541 |
showProbabilityOnHover(wrapperDiv);
|
542 |
showProbabilityOnHover(overUnderDiv);
|
543 |
|
|
|
545 |
}
|
546 |
});
|
547 |
}
|
548 |
+
<<<<<<< HEAD
|
549 |
+
=======
|
550 |
+
|
551 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
552 |
//Hover listener
|
553 |
function showProbabilityOnHover(div) {
|
554 |
let previousValue;
|
555 |
let divText = div.children[1];
|
556 |
let eventProcessed = false;
|
557 |
+
<<<<<<< HEAD
|
558 |
+
function handleEnter() {
|
559 |
+
if (eventProcessed) return; // Skip if an event has already been processed
|
560 |
+
eventProcessed = true;
|
561 |
+
if (divText.textContent !== `(${div.dataset.proba}%)`) {
|
562 |
+
divText.style.opacity = 0;
|
563 |
+
=======
|
564 |
+
|
565 |
function handleEnter() {
|
566 |
if (eventProcessed) return; // Skip if an event has already been processed
|
567 |
+
|
568 |
eventProcessed = true;
|
569 |
+
|
570 |
if (divText.textContent !== `(${div.dataset.proba}%)`) {
|
571 |
divText.style.opacity = 0;
|
572 |
+
|
573 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
574 |
setTimeout(() => {
|
575 |
previousValue = divText.textContent;
|
576 |
divText.textContent = `(${div.dataset.proba}%)`;
|
577 |
divText.style.opacity = 1;
|
578 |
}, 300);
|
579 |
+
<<<<<<< HEAD
|
580 |
+
=======
|
581 |
+
|
582 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
583 |
setTimeout(() => {
|
584 |
divText.style.opacity = 0;
|
585 |
setTimeout(() => {
|
|
|
590 |
}, 1000);
|
591 |
}
|
592 |
}
|
593 |
+
<<<<<<< HEAD
|
594 |
+
=======
|
595 |
+
|
596 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
597 |
// For desktop
|
598 |
div.addEventListener('mouseenter', handleEnter);
|
599 |
// For mobile
|
600 |
div.addEventListener('touchstart', handleEnter);
|
601 |
}
|
602 |
+
<<<<<<< HEAD
|
603 |
+
=======
|
604 |
+
|
605 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
606 |
// Populate dropdown
|
607 |
let selectedWeek;
|
608 |
async function populateDropdown() {
|
609 |
const weekSelector = document.getElementById('weekSelector');
|
610 |
weekSelector.innerHTML = "";
|
611 |
+
<<<<<<< HEAD
|
612 |
+
=======
|
613 |
+
|
614 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
615 |
const response = await fetch('/get_weeks');
|
616 |
const data = await response.json();
|
617 |
|
|
|
620 |
option.value = week;
|
621 |
option.text = `Week ${week}`;
|
622 |
weekSelector.appendChild(option);
|
623 |
+
<<<<<<< HEAD
|
624 |
+
=======
|
625 |
+
|
626 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
627 |
if (index === 0) {
|
628 |
selectedWeek = week;
|
629 |
}
|
|
|
636 |
selectedWeek = event.target.value;
|
637 |
getNew();
|
638 |
});
|
639 |
+
<<<<<<< HEAD
|
640 |
+
=======
|
641 |
+
|
642 |
+
|
643 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
644 |
// Initial load
|
645 |
function loadThings() {
|
646 |
populateDropdown()
|
|
|
648 |
.then(() => submitData())
|
649 |
.catch(error => console.error(error));
|
650 |
}
|
651 |
+
<<<<<<< HEAD
|
652 |
+
=======
|
653 |
+
|
654 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
655 |
// Get new
|
656 |
async function getNew() {
|
657 |
const table = document.getElementById('gameTable');
|
658 |
table.style.opacity = "0.5";
|
659 |
+
<<<<<<< HEAD
|
660 |
+
=======
|
661 |
+
|
662 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
663 |
try {
|
664 |
await fetchGames(selectedWeek);
|
665 |
await submitData();
|
|
|
668 |
console.error(error);
|
669 |
}
|
670 |
}
|
671 |
+
<<<<<<< HEAD
|
672 |
// Submit on click, enter, and pageload
|
673 |
loadThings();
|
674 |
document.getElementById('submitButton').addEventListener('click', submitData);
|
675 |
+
=======
|
676 |
+
|
677 |
+
|
678 |
+
// Submit on click, enter, and pageload
|
679 |
+
loadThings();
|
680 |
+
|
681 |
+
document.getElementById('submitButton').addEventListener('click', submitData);
|
682 |
+
|
683 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
684 |
document.addEventListener('keydown', function(event) {
|
685 |
if (event.keyCode === 13) {
|
686 |
submitData();
|
687 |
}
|
688 |
});
|
689 |
+
<<<<<<< HEAD
|
690 |
+
=======
|
691 |
+
|
692 |
+
|
693 |
+
>>>>>>> a1fa974af6e4e1de31cb2ee976c254c2cc5b3c64
|
694 |
</script>
|
695 |
|
696 |
</body>
|