Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -385,16 +385,38 @@ app_ui = ui.page_fluid(
|
|
385 |
|
386 |
ui.navset_tab(
|
387 |
ui.nav("Schedule",
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
|
399 |
ui.nav("Scorers Streamers",
|
400 |
ui.tags.h3(""),
|
|
|
385 |
|
386 |
ui.navset_tab(
|
387 |
ui.nav("Schedule",
|
388 |
+
ui.div(
|
389 |
+
ui.tags.head(
|
390 |
+
ui.tags.script({"src": "https://html2canvas.hertzen.com/dist/html2canvas.min.js"})
|
391 |
+
),
|
392 |
+
ui.tags.button(
|
393 |
+
"Download as PNG",
|
394 |
+
{"onclick": """
|
395 |
+
html2canvas(document.getElementById('capture-div')).then(function(canvas) {
|
396 |
+
var link = document.createElement('a');
|
397 |
+
link.download = 'fantasy-hockey-schedule.png';
|
398 |
+
link.href = canvas.toDataURL();
|
399 |
+
link.click();
|
400 |
+
});
|
401 |
+
"""},
|
402 |
+
{"style": "margin: 10px 0;"}
|
403 |
+
),
|
404 |
+
ui.div(
|
405 |
+
{"id": "capture-div", "style": "background-color: white; padding: 20px;"},
|
406 |
+
ui.tags.h3(""),
|
407 |
+
ui.div({"style": "font-size:2em;"}, ui.output_text("txt_title")),
|
408 |
+
ui.tags.h5("Created By: @TJStats, Data: NHL"),
|
409 |
+
ui.div({"style": "font-size:1.2em;"}, ui.output_text("txt")),
|
410 |
+
ui.output_table("schedule_result"),
|
411 |
+
ui.tags.h5('Legend'),
|
412 |
+
ui.output_table("schedule_result_legend"),
|
413 |
+
ui.tags.h6('An Off Night is defined as a day in which less than half the teams in the NHL are playing'),
|
414 |
+
ui.tags.h6('The scores are determined by using games played, off-nights, B2B, and strength of opponents')
|
415 |
+
)
|
416 |
+
)
|
417 |
+
)
|
418 |
+
|
419 |
+
,
|
420 |
|
421 |
ui.nav("Scorers Streamers",
|
422 |
ui.tags.h3(""),
|