A Twitch.tv viewer reward and games system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
4.4 KiB

  1. doctype html
  2. html(lang="en")
  3. head
  4. title= title
  5. link(rel='stylesheet', href='/lib/uikit/css/uikit.almost-flat.min.css')
  6. link(rel='stylesheet', href='/css/app.css')
  7. script(src='/lib/jquery.js')
  8. script(src='/lib/uikit/js/uikit.min.js')
  9. // Favicon stuff
  10. link(rel='apple-touch-icon', sizes='57x57', href='/apple-touch-icon-57x57.png')
  11. link(rel='apple-touch-icon', sizes='114x114', href='/apple-touch-icon-114x114.png')
  12. link(rel='apple-touch-icon', sizes='72x72', href='/apple-touch-icon-72x72.png')
  13. link(rel='apple-touch-icon', sizes='144x144', href='/apple-touch-icon-144x144.png')
  14. link(rel='apple-touch-icon', sizes='60x60', href='/apple-touch-icon-60x60.png')
  15. link(rel='apple-touch-icon', sizes='120x120', href='/apple-touch-icon-120x120.png')
  16. link(rel='apple-touch-icon', sizes='76x76', href='/apple-touch-icon-76x76.png')
  17. link(rel='apple-touch-icon', sizes='152x152', href='/apple-touch-icon-152x152.png')
  18. link(rel='icon', type='image/png', href='/favicon-196x196.png', sizes='196x196')
  19. link(rel='icon', type='image/png', href='/favicon-160x160.png', sizes='160x160')
  20. link(rel='icon', type='image/png', href='/favicon-96x96.png', sizes='96x96')
  21. link(rel='icon', type='image/png', href='/favicon-16x16.png', sizes='16x16')
  22. link(rel='icon', type='image/png', href='/favicon-32x32.png', sizes='32x32')
  23. meta(name='msapplication-TileColor', content='#da532c')
  24. meta(name='msapplication-TileImage', content='/mstile-144x144.png')
  25. body
  26. div.uk-grid
  27. div.uk-width-1-1
  28. div.uk-grid
  29. div.uk-width-1-4
  30. img(src='/img/#{logo}')
  31. div.uk-width-2-4
  32. // bigimagelogo
  33. h1.uk-text-center #{title}<br/>#{slogan}
  34. div.uk-width-1-4
  35. img.flip(src='/img/#{logo}')
  36. div.uk-width-1-1
  37. nav.uk-navbar
  38. ul.uk-navbar-nav.uk-navbar-center
  39. li: a(href='http://www.twitch.tv/#{title}'): img(src='/img/twitch.png', alt='Stream')
  40. li: a(href='/') Home
  41. li: a(href='/ladder') Ladder
  42. li: a(href='#') Chat Stats
  43. li: a(href='http://www.twitter.com/#{twitter}'): img(src='/img/twitter.gif', alt='Twitter')
  44. div.uk-width-1-1
  45. div.uk-container.uk-container-center
  46. div.uk-grid
  47. br
  48. br
  49. div.uk-width-1-2
  50. div.uk-panel.uk-panel-box
  51. h2 #{title} is
  52. span#status offline.
  53. div#streambox
  54. div.uk-width-1-2
  55. div.uk-panel.uk-panel-box
  56. table.uk-table.uk-table-hover.uk-table-striped
  57. caption Top 10 Potato Farmers
  58. thead
  59. tr
  60. th Viewer
  61. th Potatoes
  62. tbody
  63. each row in rows
  64. tr
  65. td #{row.user}
  66. td #{row.points}
  67. script.
  68. $(document).ready(function(){
  69. $.getJSON('https://api.twitch.tv/kraken/streams/#{title}?callback=?', function(data){
  70. if(data.stream) {
  71. $('#status').empty().append('online!');
  72. $("#streambox").append("<span>Game:</span> <span class='uk-text-bold uk-text-success'>"+data.stream.game+"</span><br/>");
  73. $("#streambox").append("<span>Viewers:</span> <span class='uk-text-bold uk-text-warning'>"+data.stream.viewers+"</span><br/>");
  74. $("#streambox").append("<br/><br/><img src='"+data.stream.preview.medium+"' />");;
  75. } else {
  76. $("#streambox").append("<h3 class='uk-text-danger'>Offline</h3>");
  77. }
  78. });
  79. });