gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitbfc4ea4dbfc4ea4dMerge branch 'ap62' into mainTrackerbfc4ea4d/components/home.hl

6.9 KB

  1. // components/home.hl — `/` (tracker.worldapi.org#13; empty since step 1). Creator: "on the homepage when you are logged in
  2. // you see 4 icons leading to unwatched scheudle shows and movies. below that then same as logged out: first a text
  3. // describing what the site does then last released 10 movies and last aired 10 shows. movies and shows headings are links
  4. // to /movies and /shows". Architect's readings: the icons go to /my/unwatched, /my/schedule, /my/shows, /my/movies; "last
  5. // aired shows" = the series whose newest RELEASED episode is newest.
  6. //
  7. // The two rows come from catalog.hl (built once at start, no scan per request): poster + title + year, each a link to the
  8. // show page (a movie's too — it has the same page and Follow button). Phone: each row scrolls sideways inside itself;
  9. // from 40rem a grid (styles.hl). Sign in/out stays the header's job (components/main.hl).
  10. //
  11. // tracker.worldapi.org#21 (mission 068): series and shows are split — FIVE icon tiles (Unwatched, Schedule, Series → /my/series,
  12. // Shows → /my/shows, Movies) and THREE rows (Movies, Series → /series, Shows → /shows). #20: each row heading in its type's colour.
  13. parent './main.hl'
  14. import { appTitle } from '../lib/app.hl'
  15. import { userIdOfSession } from '../lib/users.hl'
  16. import { latestMovies, latestSeries, latestShows } from '../lib/catalog.hl'
  17. import { warmReady, warmText } from '../lib/warm.hl'
  18. session = null
  19. signedIn = userIdOfSession(&session) != null
  20. signedOut = !signedIn
  21. movieTiles = latestMovies(10)
  22. seriesTiles = latestSeries(10)
  23. showTiles = latestShows(10)
  24. __title = appTitle
  25. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'catalog'
  26. // stage is there this page says so instead of showing half a map
  27. warming = !warmReady('catalog')
  28. warmNote = warming ? warmText() : ''
  29. // Component styles use the shared theme variables.
  30. Style {
  31. home {
  32. display = 'block'
  33. }
  34. homeNav {
  35. display = 'grid'
  36. gridTemplateColumns = 'repeat(3, minmax(0, 1fr))'
  37. gap = '.6rem'
  38. marginBottom = '1.2rem'
  39. @media {
  40. minWidth = '40rem'
  41. gridTemplateColumns = 'repeat(5, minmax(0, 1fr))'
  42. gap = '1rem'
  43. }
  44. }
  45. aHometile {
  46. display = 'flex'
  47. flexDirection = 'column'
  48. alignItems = 'center'
  49. justifyContent = 'center'
  50. gap = '.4rem'
  51. padding = '1rem .5rem'
  52. borderRadius = 'var(--radius-large)'
  53. color = 'var(--color-text-strong)'
  54. background = 'var(--color-surface)'
  55. fontWeight = '600'
  56. hover {
  57. textDecoration = 'none'
  58. color = 'var(--color-accent)'
  59. }
  60. svg {
  61. display = 'block'
  62. width = '2.5rem'
  63. height = '2.5rem'
  64. fill = 'none'
  65. stroke = 'var(--color-accent)'
  66. strokeWidth = '1.6'
  67. strokeLinecap = 'round'
  68. strokeLinejoin = 'round'
  69. }
  70. @media {
  71. minWidth = '40rem'
  72. padding = '1.4rem .5rem'
  73. }
  74. }
  75. homeIntro {
  76. display = 'block'
  77. marginBottom = '1rem'
  78. color = 'var(--color-text)'
  79. p {
  80. margin = '0 0 .6rem'
  81. }
  82. }
  83. homeSection {
  84. display = 'block'
  85. marginBottom = '1.2rem'
  86. h2 {
  87. margin = '0 0 .5rem'
  88. fontSize = '1.1rem'
  89. a {
  90. color = 'var(--color-text-strong)'
  91. }
  92. 'a.type-movie' {
  93. color = 'var(--color-type1)'
  94. }
  95. 'a.type-series' {
  96. color = 'var(--color-type2)'
  97. }
  98. 'a.type-show' {
  99. color = 'var(--color-type3)'
  100. }
  101. 'a::after' {
  102. content = "' ›'"
  103. color = 'var(--color-accent)'
  104. }
  105. }
  106. }
  107. tileRow {
  108. display = 'flex'
  109. gap = '.6rem'
  110. overflowX = 'auto'
  111. scrollSnapType = 'x proximity'
  112. paddingBottom = '.4rem'
  113. 'a.tile' {
  114. flex = 'none'
  115. width = '7rem'
  116. scrollSnapAlign = 'start'
  117. @media {
  118. minWidth = '40rem'
  119. width = 'auto'
  120. }
  121. }
  122. @media {
  123. minWidth = '40rem'
  124. display = 'grid'
  125. gridTemplateColumns = 'repeat(5, minmax(0, 1fr))'
  126. gap = '1rem .8rem'
  127. overflowX = 'visible'
  128. }
  129. }
  130. }
  131. View {
  132. home {
  133. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  134. if (signedIn) {
  135. homeNav {
  136. a { Style.aHometile href = "/my/unwatched"
  137. svg { viewBox = "0 0 24 24" width = "40" height = "40" "aria-hidden" = "true"
  138. circle { cx = "12" cy = "12" r = "10" }
  139. path { d = "M7 12.5 L10.5 16 L17 8.5" }
  140. }
  141. span { "Unwatched" }
  142. }
  143. a { Style.aHometile href = "/my/schedule"
  144. svg { viewBox = "0 0 24 24" width = "40" height = "40" "aria-hidden" = "true"
  145. rect { x = "3" y = "5" width = "18" height = "16" rx = "2" }
  146. path { d = "M3 10 H21 M8 3 V7 M16 3 V7 M7 14 H9 M11 14 H13 M15 14 H17 M7 17.5 H9 M11 17.5 H13" }
  147. }
  148. span { "Schedule" }
  149. }
  150. a { Style.aHometile href = "/my/series"
  151. svg { viewBox = "0 0 24 24" width = "40" height = "40" "aria-hidden" = "true"
  152. rect { x = "2" y = "7" width = "20" height = "14" rx = "2" }
  153. path { d = "M8 3 L12 7 L16 3" }
  154. }
  155. span { "Series" }
  156. }
  157. // a show: a microphone (talk, news, reality)
  158. a { Style.aHometile href = "/my/shows"
  159. svg { viewBox = "0 0 24 24" width = "40" height = "40" "aria-hidden" = "true"
  160. rect { x = "9" y = "2" width = "6" height = "12" rx = "3" }
  161. path { d = "M5 11 A7 7 0 0 0 19 11 M12 18 V22 M8 22 H16" }
  162. }
  163. span { "Shows" }
  164. }
  165. a { Style.aHometile href = "/my/movies"
  166. svg { viewBox = "0 0 24 24" width = "40" height = "40" "aria-hidden" = "true"
  167. rect { x = "3" y = "3" width = "18" height = "18" rx = "2" }
  168. path { d = "M7.5 3 V21 M16.5 3 V21 M3 7.5 H7.5 M3 12 H7.5 M3 16.5 H7.5 M16.5 7.5 H21 M16.5 12 H21 M16.5 16.5 H21" }
  169. }
  170. span { "Movies" }
  171. }
  172. }
  173. }
  174. homeIntro {
  175. p { "tracker keeps track of the series and movies you follow and of every episode you have watched. Follow a show and its new episodes show up under Unwatched once they are out, and under Schedule before that — new episodes and posters come in from TMDB every day." }
  176. if (signedOut) { p { "Log in with ident (top right: choose ident) to follow shows and mark what you have seen." } }
  177. p { "tracker installs as an app on your phone or computer: use your browser's \"Install\" or \"Add to Home Screen\"." }
  178. }
  179. homeSection { id = "home-movies"
  180. h2 { a { href = "/movies" class = "type-word type-movie" "Movies" } }
  181. tileRow {
  182. for (t of movieTiles) {
  183. a { class = "tile" href = t.href
  184. img { class = "tile-poster" src = t.posterUrl alt = t.title loading = "lazy" }
  185. tileTitle { t.title }
  186. tileYear { t.year }
  187. }
  188. }
  189. }
  190. }
  191. homeSection { id = "home-series"
  192. h2 { a { href = "/series" class = "type-word type-series" "Series" } }
  193. tileRow {
  194. for (t of seriesTiles) {
  195. a { class = "tile" href = t.href
  196. img { class = "tile-poster" src = t.posterUrl alt = t.title loading = "lazy" }
  197. tileTitle { t.title }
  198. tileYear { t.year }
  199. }
  200. }
  201. }
  202. }
  203. homeSection { id = "home-shows"
  204. h2 { a { href = "/shows" class = "type-word type-show" "Shows" } }
  205. tileRow {
  206. for (t of showTiles) {
  207. a { class = "tile" href = t.href
  208. img { class = "tile-poster" src = t.posterUrl alt = t.title loading = "lazy" }
  209. tileTitle { t.title }
  210. tileYear { t.year }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }

Branches

Latest commits

  • bfc4ea4dMerge branch 'ap62' into mainTracker
  • 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker
  • b9c7c3c8Merge branch 'records-dp74' into mainTracker
  • 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker
  • b1496147Merge branch 'ap61' into mainTracker
  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker
  • 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
  • 613ae0ecMerge branch 'bs3' into mainTracker
  • 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
  • 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
  • 310613f1Merge branch 'records-dp72' into mainTracker
  • 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
  • c41587d2Merge branch 'bs2' into mainTracker
  • 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
  • 019d5cedMerge branch 'records-1110' into mainTracker
  • f88ae8b9|||PR records: day56 toggle live, reviewTracker
  • b6b3bb4dMerge branch 'ap56e' into mainTracker