nesticot commited on
Commit
da868a8
·
verified ·
1 Parent(s): 32f64c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -10
app.py CHANGED
@@ -385,16 +385,38 @@ app_ui = ui.page_fluid(
385
 
386
  ui.navset_tab(
387
  ui.nav("Schedule",
388
- ui.tags.h3(""),
389
- ui.div({"style": "font-size:2em;"},ui.output_text("txt_title")),
390
- #ui.tags.h2("Fantasy Hockey Schedule Summary"),
391
- ui.tags.h5("Created By: @TJStats, Data: NHL"),
392
- ui.div({"style": "font-size:1.2em;"},ui.output_text("txt")),
393
- ui.output_table("schedule_result"),
394
- ui.tags.h5('Legend'),
395
- ui.output_table("schedule_result_legend"),
396
- ui.tags.h6('An Off Night is defined as a day in which less than half the teams in the NHL are playing'),
397
- ui.tags.h6('The scores are determined by using games played, off-nights, B2B, and strength of opponents') ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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(""),