Spaces:
Running
Running
Commit
·
4298351
1
Parent(s):
89fc047
Debug
Browse files- Templates/index.html +21 -18
- main.py +4 -0
Templates/index.html
CHANGED
@@ -571,32 +571,35 @@
|
|
571 |
let previousValue;
|
572 |
let divText = div.children[1];
|
573 |
|
574 |
-
function
|
575 |
-
|
576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
|
578 |
-
|
579 |
-
// Update text and fade in
|
580 |
-
previousValue = divText.textContent;
|
581 |
-
divText.textContent = `(${div.dataset.proba}%)`;
|
582 |
-
divText.style.opacity = 1;
|
583 |
|
|
|
|
|
|
|
584 |
setTimeout(() => {
|
585 |
-
divText.
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
divText.style.opacity = 1;
|
590 |
-
}, 300);
|
591 |
-
}, 1000);
|
592 |
-
}, 300);
|
593 |
}
|
594 |
|
595 |
// For desktop
|
596 |
-
div.addEventListener('mouseenter',
|
|
|
597 |
|
598 |
// For mobile
|
599 |
-
div.addEventListener('touchstart',
|
|
|
600 |
}
|
601 |
|
602 |
// Populate dropdown
|
|
|
571 |
let previousValue;
|
572 |
let divText = div.children[1];
|
573 |
|
574 |
+
function handleEnter() {
|
575 |
+
if (divText.textContent !== `(${div.dataset.proba}%)`){
|
576 |
+
divText.style.opacity = 0;
|
577 |
+
setTimeout(() => {
|
578 |
+
previousValue = divText.textContent;
|
579 |
+
divText.textContent = `(${div.dataset.proba}%)`;
|
580 |
+
divText.style.opacity = 1;
|
581 |
+
}, 300);
|
582 |
+
}
|
583 |
|
584 |
+
}
|
|
|
|
|
|
|
|
|
585 |
|
586 |
+
function handleLeave() {
|
587 |
+
if (previousValue !== undefined) {
|
588 |
+
divText.style.opacity = 0;
|
589 |
setTimeout(() => {
|
590 |
+
divText.textContent = previousValue;
|
591 |
+
divText.style.opacity = 1;
|
592 |
+
}, 300);
|
593 |
+
}
|
|
|
|
|
|
|
|
|
594 |
}
|
595 |
|
596 |
// For desktop
|
597 |
+
div.addEventListener('mouseenter', handleEnter);
|
598 |
+
div.addEventListener('mouseleave', handleLeave);
|
599 |
|
600 |
// For mobile
|
601 |
+
div.addEventListener('touchstart', handleEnter);
|
602 |
+
div.addEventListener('touchend', handleLeave);
|
603 |
}
|
604 |
|
605 |
// Populate dropdown
|
main.py
CHANGED
@@ -14,6 +14,10 @@ with open('Source/Data/lines.json','r') as f:
|
|
14 |
lines = json.load(f)
|
15 |
|
16 |
app = Flask(__name__, template_folder="Templates", static_folder="Static", static_url_path="/Static")
|
|
|
|
|
|
|
|
|
17 |
app.secret_key = 'green-flounder'
|
18 |
|
19 |
# get week, season
|
|
|
14 |
lines = json.load(f)
|
15 |
|
16 |
app = Flask(__name__, template_folder="Templates", static_folder="Static", static_url_path="/Static")
|
17 |
+
app.config.update(
|
18 |
+
SESSION_COOKIE_SECURE=True,
|
19 |
+
SESSION_COOKIE_SAMESITE='None',
|
20 |
+
)
|
21 |
app.secret_key = 'green-flounder'
|
22 |
|
23 |
# get week, season
|