full.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!-- Fullscreen forum view - renders JSONL forum posts -->
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Forum Thread</title>
  8. <style>
  9. body {
  10. margin: 0;
  11. padding: 20px;
  12. background: #0d1117;
  13. color: #c9d1d9;
  14. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  15. line-height: 1.6;
  16. }
  17. .header {
  18. max-width: 1000px;
  19. margin: 0 auto 30px;
  20. text-align: center;
  21. padding: 20px;
  22. border-bottom: 1px solid #30363d;
  23. }
  24. .icon {
  25. font-size: 48px;
  26. margin-bottom: 10px;
  27. }
  28. h1 {
  29. margin: 0;
  30. font-size: 28px;
  31. color: #f0f6fc;
  32. }
  33. .container {
  34. max-width: 1000px;
  35. margin: 0 auto;
  36. }
  37. .post {
  38. background: #161b22;
  39. border: 1px solid #30363d;
  40. border-radius: 6px;
  41. margin-bottom: 16px;
  42. padding: 16px;
  43. transition: border-color 0.2s;
  44. }
  45. .post:hover {
  46. border-color: #58a6ff;
  47. }
  48. .post-header {
  49. display: flex;
  50. justify-content: space-between;
  51. align-items: center;
  52. margin-bottom: 12px;
  53. padding-bottom: 12px;
  54. border-bottom: 1px solid #21262d;
  55. }
  56. .post-author {
  57. font-weight: 600;
  58. color: #58a6ff;
  59. font-size: 14px;
  60. }
  61. .post-date {
  62. color: #8b949e;
  63. font-size: 12px;
  64. }
  65. .post-title {
  66. margin: 0 0 12px 0;
  67. font-size: 18px;
  68. font-weight: 600;
  69. color: #f0f6fc;
  70. }
  71. .post-content {
  72. color: #c9d1d9;
  73. word-wrap: break-word;
  74. }
  75. .post-content img {
  76. max-width: 100%;
  77. height: auto;
  78. border-radius: 4px;
  79. }
  80. .post-content a {
  81. color: #58a6ff;
  82. text-decoration: none;
  83. }
  84. .post-content a:hover {
  85. text-decoration: underline;
  86. }
  87. .loading {
  88. text-align: center;
  89. padding: 40px;
  90. color: #8b949e;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <div class="header">
  96. <div class="icon">💬</div>
  97. <h1>Forum Thread</h1>
  98. </div>
  99. <div class="container">
  100. <div id="forum-posts" class="loading">Loading posts...</div>
  101. </div>
  102. <script>
  103. (async function() {
  104. try {
  105. const response = await fetch('{{ output_path }}');
  106. const text = await response.text();
  107. const posts = text.trim().split('\n').filter(line => line).map(line => JSON.parse(line));
  108. const container = document.getElementById('forum-posts');
  109. container.innerHTML = '';
  110. container.className = '';
  111. posts.forEach(post => {
  112. const postDiv = document.createElement('div');
  113. postDiv.className = 'post';
  114. const author = post.author || 'Anonymous';
  115. const date = post.date ? new Date(post.date).toLocaleString() : '';
  116. const title = post.title || '';
  117. const content = post.content || post.body || '';
  118. postDiv.innerHTML = `
  119. <div class="post-header">
  120. <span class="post-author">${escapeHtml(author)}</span>
  121. <span class="post-date">${escapeHtml(date)}</span>
  122. </div>
  123. ${title ? `<h2 class="post-title">${escapeHtml(title)}</h2>` : ''}
  124. <div class="post-content">${content}</div>
  125. `;
  126. container.appendChild(postDiv);
  127. });
  128. if (posts.length === 0) {
  129. container.innerHTML = '<div class="loading">No posts found</div>';
  130. }
  131. } catch(e) {
  132. document.getElementById('forum-posts').innerHTML = '<div class="loading">Error loading posts: ' + e.message + '</div>';
  133. }
  134. })();
  135. function escapeHtml(text) {
  136. const div = document.createElement('div');
  137. div.textContent = text;
  138. return div.innerHTML;
  139. }
  140. </script>
  141. </body>
  142. </html>