index.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>i12bretro Tutorials</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  7. <script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
  8. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  9. <style>
  10. table { width: 65%; max-width: 950px; }
  11. tr { line-height: 24px; }
  12. tbody tr td { vertical-align: bottom; }
  13. .dataTables_filter { position: absolute; top: 50px; right: 100px; z-index: 100; }
  14. img.viewIcon { height: 24px; }
  15. a:link { color: #e00; transition: color 0.35s; }
  16. a:hover { color: #333; }
  17. </style>
  18. </head>
  19. <body>
  20. <div id="gridContainer">
  21. <div class="topMargin"></div>
  22. <div id="listName" class="topMargin">
  23. <h1>i12bretro Tutorials</h1>
  24. </div>
  25. <div></div>
  26. <div id="content">
  27. <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
  28. <thead>
  29. <tr><th width="80">ID</th><th>Title</th><th width="40">View</th><th width="195">Last Modified</th></tr>
  30. </thead>
  31. <tbody id="tutorialList">
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. </body>
  37. <script>
  38. $.ajax({ type:'GET', dataType: 'json', cache: false, url: './data.json', success: function(r){
  39. r.forEach((tut) => {
  40. $('#tutorialList').append(`<tr><td align="center">${('0000'+ tut.i).slice(-4)}</td><td><a href="https://i12bretro.github.io/tutorials/${('0000'+ tut.i).slice(-4)}.html" target="_blank">${tut.t}</a></td><td align="center"><a href="https://youtu.be/${tut.v}" target="_blank"><img src="images/youtube.png" alt="View on YouTube" title="View on YouTube" class="viewIcon" /></a></td><td align="center">${new Date((tut.d * 1000)).toLocaleString().replace(', ',' ')}</td></tr>`);
  41. });
  42. initTable();
  43. }
  44. });
  45. function initTable(){
  46. $('table').DataTable({'paging': false });
  47. }
  48. </script>
  49. </html>