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.

64 lines
3.1 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. body
  10. div.uk-grid
  11. div.uk-width-1-1
  12. div.uk-grid
  13. div.uk-width-1-4
  14. img(src='/img/#{logo}')
  15. div.uk-width-2-4
  16. // bigimagelogo
  17. h1.uk-text-center #{title}<br/>#{slogan}
  18. div.uk-width-1-4
  19. img.flip(src='/img/#{logo}')
  20. div.uk-width-1-1
  21. nav.uk-navbar
  22. ul.uk-navbar-nav.uk-navbar-center
  23. li: a(href='http://www.twitch.tv/#{title}'): img(src='/img/twitch.png', alt='Stream')
  24. li: a(href='/') Home
  25. li: a(href='/ladder') Ladder
  26. li: a(href='#') Chat Stats
  27. li: a(href='http://www.twitter.com/#{twitter}'): img(src='/img/twitter.gif', alt='Twitter')
  28. div.uk-width-1-1
  29. div.uk-container.uk-container-center
  30. div.uk-grid
  31. br
  32. br
  33. div.uk-width-1-2
  34. div.uk-panel.uk-panel-box
  35. h2 #{title} is
  36. span#status offline.
  37. div#streambox
  38. div.uk-width-1-2
  39. div.uk-panel.uk-panel-box
  40. table.uk-table.uk-table-hover.uk-table-striped
  41. caption Top 10 Potato Farmers
  42. thead
  43. tr
  44. th Viewer
  45. th Potatoes
  46. tbody
  47. each row in rows
  48. tr
  49. td #{row.user}
  50. td #{row.points}
  51. script.
  52. $(document).ready(function(){
  53. $.getJSON('https://api.twitch.tv/kraken/streams/#{title}?callback=?', function(data){
  54. if(data.stream) {
  55. $('#status').empty().append('online!');
  56. $("#streambox").append("<span>Game:</span> <span class='uk-text-bold uk-text-success'>"+data.stream.game+"</span><br/>");
  57. $("#streambox").append("<span>Viewers:</span> <span class='uk-text-bold uk-text-warning'>"+data.stream.viewers+"</span><br/>");
  58. $("#streambox").append("<br/><br/><img src='"+data.stream.preview.medium+"' />");;
  59. } else {
  60. $("#streambox").append("<h3 class='uk-text-danger'>Offline</h3>");
  61. }
  62. });
  63. });