Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2

appview/pages: add mobile version for minitimeline component

Signed-off-by: oppiliappan <me@oppi.li>

authored by oppi.li and committed by tangled.org bfc1319e 1e28cac1

+89 -52
+47 -16
appview/pages/templates/timeline/fragments/preview.html
··· 1 {{ define "timeline/fragments/preview" }} 2 <div class="flex flex-col gap-4 overflow-hidden"> 3 - <div class="relative h-96 w-full"> 4 <!-- left fade overlay (fixed on left edge) --> 5 <div class="absolute left-0 top-0 h-full w-16 pointer-events-none z-10 bg-gradient-to-r from-white to-transparent dark:from-gray-900"></div> 6 ··· 8 <div class="absolute right-0 top-0 h-full w-16 pointer-events-none z-10 bg-gradient-to-l from-white to-transparent dark:from-gray-900"></div> 9 10 {{ template "marquee" $ }} 11 </div> 12 </div> 13 {{ end }} ··· 18 {{ $prev := -1 }} 19 {{ $w := mul (len .Timeline) 150 }} 20 21 - <div class="absolute h-full flex animate-marquee"> 22 <div class="relative h-full flex-shrink-0 bottom-4 border-b border-gray-200 dark:border-gray-700" style="width: {{ $w }}px;"> 23 {{ range $i, $e := .Timeline }} 24 {{ $curr := randInt 4 }} ··· 39 </div> 40 {{ end }} 41 42 {{ define "timelineEvent" }} 43 {{ $i := index . 0 }} 44 {{ $e := index . 1 }} 45 {{ $variance := randInt 10 }} 46 {{ $offset := add (index . 2) $variance }} 47 {{ $left := mul $i 175 }} 48 - {{ with $e }} 49 - <div 50 - class="absolute left-0 flex flex-col divide-y divide-gray-200 dark:divide-gray-700 border border-gray-200 dark:border-gray-700 rounded-sm bg-white dark:bg-gray-800 drop-shadow-sm" 51 - style="bottom: {{ $offset }}px; left: {{ $left }}px; transform: translateX(-50%); z-index: 5;" 52 - > 53 - {{ if .Repo }} 54 - {{ template "repoEvent" (list $ .) }} 55 - {{ else if .RepoStar }} 56 - {{ template "starEvent" (list $ .) }} 57 - {{ else if .Follow }} 58 - {{ template "followEvent" (list $ .) }} 59 - {{ end }} 60 - </div> 61 - {{ end }} 62 63 <!-- vertical connector --> 64 <div
··· 1 {{ define "timeline/fragments/preview" }} 2 <div class="flex flex-col gap-4 overflow-hidden"> 3 + <div class="relative h-fit md:h-96 w-full"> 4 <!-- left fade overlay (fixed on left edge) --> 5 <div class="absolute left-0 top-0 h-full w-16 pointer-events-none z-10 bg-gradient-to-r from-white to-transparent dark:from-gray-900"></div> 6 ··· 8 <div class="absolute right-0 top-0 h-full w-16 pointer-events-none z-10 bg-gradient-to-l from-white to-transparent dark:from-gray-900"></div> 9 10 {{ template "marquee" $ }} 11 + {{ template "marquee-mobile" $ }} 12 </div> 13 </div> 14 {{ end }} ··· 17 {{ $prev := -1 }} 18 {{ $w := mul (len .Timeline) 150 }} 19 20 + <div class="absolute h-full hidden md:flex animate-marquee"> 21 <div class="relative h-full flex-shrink-0 bottom-4 border-b border-gray-200 dark:border-gray-700" style="width: {{ $w }}px;"> 22 {{ range $i, $e := .Timeline }} 23 {{ $curr := randInt 4 }} ··· 38 </div> 39 {{ end }} 40 41 + {{ define "marquee-mobile" }} 42 + <div class="flex md:hidden flex-col gap-4 my-auto"> 43 + {{ range $rowIndex := list 0 1 2 3 }} 44 + {{ $offset := mul (add $rowIndex 2) 10 }} 45 + {{ if eq (mod $rowIndex 2) 0 }} 46 + {{ $offset = mul $offset -1 }} 47 + {{ end }} 48 + <div class="flex gap-4 overflow-hidden" style="padding-left: {{ $offset }}px; "> 49 + <div class="flex gap-4 animate-marquee"> 50 + {{ range $i, $e := $.Timeline }} 51 + {{ if eq (mod $i 4) $rowIndex }} 52 + <div class="flex-shrink-0"> 53 + {{ template "eventCard" (list $ $e) }} 54 + </div> 55 + {{ end }} 56 + {{ end }} 57 + </div> 58 + </div> 59 + {{ end }} 60 + </div> 61 + {{ end }} 62 + 63 + {{ define "eventCard" }} 64 + {{ $root := index . 0 }} 65 + {{ $e := index . 1 }} 66 + {{ with $e }} 67 + <div class="flex flex-col divide-y divide-gray-200 dark:divide-gray-700 border border-gray-200 dark:border-gray-700 rounded-sm bg-white dark:bg-gray-800 drop-shadow-sm"> 68 + {{ if .Repo }} 69 + {{ template "repoEvent" (list $root .) }} 70 + {{ else if .RepoStar }} 71 + {{ template "starEvent" (list $root .) }} 72 + {{ else if .Follow }} 73 + {{ template "followEvent" (list $root .) }} 74 + {{ end }} 75 + </div> 76 + {{ end }} 77 + {{ end }} 78 + 79 {{ define "timelineEvent" }} 80 {{ $i := index . 0 }} 81 {{ $e := index . 1 }} 82 {{ $variance := randInt 10 }} 83 {{ $offset := add (index . 2) $variance }} 84 {{ $left := mul $i 175 }} 85 + <div 86 + class="absolute left-0" 87 + style="bottom: {{ $offset }}px; left: {{ $left }}px; transform: translateX(-50%); z-index: 5;" 88 + > 89 + {{ template "eventCard" (list $ $e) }} 90 + </div> 91 92 <!-- vertical connector --> 93 <div
+42 -31
appview/pages/templates/timeline/home.html
··· 81 {{ $labelStyle := "normal-case cursor-pointer w-auto md:w-full p-4 md:px-6 rounded bg-white dark:bg-gray-800 font-medium text-base md:text-lg opacity-50 border border-gray-200 dark:border-gray-700 relative overflow-hidden" }} 82 {{ $spanStyle := "z-10 items-center justify-between gap-2 w-full" }} 83 {{ $connectorStyle := "w-0.5 h-6 bg-gray-300 dark:bg-gray-600 opacity-0 mx-auto" }} 84 - {{ $contentStyle := "hidden bg-white dark:bg-gray-800 rounded shadow-sm p-6 md:p-8 border border-gray-200 dark:border-gray-700 grid-cols-1 animate-fadein" }} 85 {{ $progressOverlayStyle := "absolute inset-0 bg-gray-600/10 dark:bg-gray-100/10 w-0 transition-none" }} 86 87 <style> ··· 139 <div class="{{ $connectorStyle }} peer-checked/spindles:opacity-100"></div> 140 141 {{ $titleStyle := "text-2xl md:text-6xl my-2 md:mb-4 text-black dark:text-white font-medium" }} 142 - {{ $textContentStyle := "pb-6 md:text-xl" }} 143 - {{ $imgContentStyle := "w-full min-h-96 min-h-[400px] md:min-h-[500px] rounded overflow-hidden place-content-center bg-gradient-to-b from-slate-50 to-slate-100 dark:from-gray-800 dark:to-gray-900 border border-gray-200 dark:border-gray-700" }} 144 {{ $linkDesktopStyle := "hover:no-underline items-center gap-2 p-3 text-base btn" }} 145 146 <div class="col-span-3 {{ $contentStyle }} peer-checked/prs:grid relative"> ··· 158 </a> 159 </section> 160 <div class="w-fit hidden md:flex items-center"> 161 - <div class="size-32 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 -mr-4" > 162 - {{ i "wand-sparkles" "size-16 text-green-500 dark:text-green-500" }} 163 </div> 164 - <div class="size-40 rounded-full flex items-center justify-center bg-indigo-100 dark:bg-indigo-900 z-10"> 165 - {{ i "git-pull-request" "size-24 text-indigo-500 dark:text-indigo-500 rotate-12" }} 166 </div> 167 </div> 168 </div> 169 - <div class="{{ $imgContentStyle }} min-h-[500px] relative overflow-hidden"> 170 - <div class="w-full h-full relative overflow-hidden"> 171 - <img src="https://assets.tangled.network/home-page-prs.png" class="h-full w-[200%] md:w-full object-cover object-left" /> 172 </div> 173 </div> 174 <a href="https://blog.tangled.org/stacking" class="hover:no-underline hidden md:inline-flex absolute -bottom-6 -right-12 items-center gap-2 p-3 text-base btn"> ··· 177 </a> 178 </div> 179 180 - <div class="col-span-3 {{ $contentStyle }} peer-checked/knots:grid"> 181 <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8"> 182 <section class="space-y-4"> 183 <h1 class="{{ $titleStyle }}">Run it at home</h1> 184 <p class="text-gray-600 dark:text-gray-400"> 185 Host your repositories on your own infrastructure with <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="no-underline">knots</a>. 186 - Run CI on your own machines with <a href="https://docs.tangled.org/spindles.html#self-hosting-guide" class="no-underline">spindles</a>. 187 <br> 188 Don't want to self-host? All are welcome on our hosted instances. 189 </p> 190 </section> 191 <div class="w-fit hidden md:flex items-center"> 192 - <div class="size-32 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 -mr-4" > 193 - {{ i "workflow" "size-16 text-green-500 dark:text-green-500" }} 194 </div> 195 - <div class="size-40 rounded-full flex items-center justify-center bg-indigo-100 dark:bg-indigo-900 z-10"> 196 - {{ i "server" "size-24 text-indigo-500 dark:text-indigo-500" }} 197 </div> 198 </div> 199 </div> 200 - <div class="{{ $imgContentStyle }} min-h-[500px] relative overflow-hidden"> 201 - <div class="w-full h-full relative overflow-hidden"> 202 - <img src="https://assets.tangled.network/home-page-self-host.png" class="h-full w-[200%] md:w-full object-cover object-center" /> 203 </div> 204 </div> 205 </div> 206 207 - <div class="col-span-3 {{ $contentStyle }} peer-checked/spindles:grid"> 208 <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8"> 209 <section class="space-y-4"> 210 <h1 class="{{ $titleStyle }}">Nix-powered CI</h1> ··· 224 <br> 225 Support for Docker and MicroVM based runners coming soon! 226 </p> 227 </section> 228 <div class="w-fit hidden md:flex items-center"> 229 <div class="size-32 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 -mr-4" > ··· 239 </div> 240 </div> 241 <div class="{{ $imgContentStyle }} flex items-end pb-0 overflow-hidden"> 242 - <div class="w-full h-full relative overflow-hidden"> 243 - <img src="https://assets.tangled.network/home-page-ci.png" class="h-full w-[200%] md:w-full object-cover object-left md:object-center" /> 244 </div> 245 </div> 246 </div> 247 </div> 248 ··· 344 <div class="{{ $cardInnerStyle }}"> 345 {{ $moreLink := "https://tangled.org/core" }} 346 <div class="{{ $contentStyle }}"> 347 - <h3 class="{{ $titleStyle }}">Free and Open-source</h3> 348 <p class="{{ $descriptionStyle }}"> 349 - All of Tangled is open-source and built in the open! 350 - Check out the <a class="underline" href="https://tangled.org/core">monorepo</a> and join in on the fun. 351 <br> 352 <br> 353 We welcome contributions however big or small. You can start contributing by picking up a 354 - <a class="underline" href="https://tangled.org/tangled.org/core/issues">good-first-issue</a>. 355 </p> 356 <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}"> 357 View source ··· 380 <h3 class="{{ $titleStyle }}">Social coding is back</h3> 381 <p class="{{ $descriptionStyle }}"> 382 Discover trending projects, follow your friends and star your favourite repositories. Coding is better together! 383 - <br> 384 - <br> 385 - You can use one account for all of the atmosphere. If you have 386 - friends on Bluesky, you will find them on Tangled with the same 387 - handle. 388 </p> 389 <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}"> 390 Explore timeline
··· 81 {{ $labelStyle := "normal-case cursor-pointer w-auto md:w-full p-4 md:px-6 rounded bg-white dark:bg-gray-800 font-medium text-base md:text-lg opacity-50 border border-gray-200 dark:border-gray-700 relative overflow-hidden" }} 82 {{ $spanStyle := "z-10 items-center justify-between gap-2 w-full" }} 83 {{ $connectorStyle := "w-0.5 h-6 bg-gray-300 dark:bg-gray-600 opacity-0 mx-auto" }} 84 + {{ $contentStyle := "hidden bg-white dark:bg-gray-800 rounded shadow-sm border border-gray-200 dark:border-gray-700 grid-cols-1 animate-fadein" }} 85 {{ $progressOverlayStyle := "absolute inset-0 bg-gray-600/10 dark:bg-gray-100/10 w-0 transition-none" }} 86 87 <style> ··· 139 <div class="{{ $connectorStyle }} peer-checked/spindles:opacity-100"></div> 140 141 {{ $titleStyle := "text-2xl md:text-6xl my-2 md:mb-4 text-black dark:text-white font-medium" }} 142 + {{ $textContentStyle := "p-4 md:p-6 md:text-xl" }} 143 + {{ $imgContentStyle := "w-full overflow-hidden place-content-center bg-gradient-to-b from-slate-50 to-slate-100 dark:from-gray-800 dark:to-gray-900 border-t border-gray-200 dark:border-gray-700" }} 144 {{ $linkDesktopStyle := "hover:no-underline items-center gap-2 p-3 text-base btn" }} 145 146 <div class="col-span-3 {{ $contentStyle }} peer-checked/prs:grid relative"> ··· 158 </a> 159 </section> 160 <div class="w-fit hidden md:flex items-center"> 161 + <div class="size-32 rounded-full flex items-center justify-center bg-yellow-100 dark:bg-yellow-900 -mr-4" > 162 + {{ i "wand-sparkles" "size-16 text-yellow-500 dark:text-yellow-500" }} 163 </div> 164 + <div class="size-40 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 z-10"> 165 + {{ i "git-pull-request-arrow" "size-24 text-green-500 dark:text-green-500 rotate-12" }} 166 </div> 167 </div> 168 </div> 169 + <div class="{{ $imgContentStyle }} relative overflow-hidden flex items-center"> 170 + <div class="w-full md:w-full flex justify-center"> 171 + <img src="https://assets.tangled.network/home-page-prs.svg" class="w-[120%] md:w-full" /> 172 </div> 173 </div> 174 <a href="https://blog.tangled.org/stacking" class="hover:no-underline hidden md:inline-flex absolute -bottom-6 -right-12 items-center gap-2 p-3 text-base btn"> ··· 177 </a> 178 </div> 179 180 + <div class="col-span-3 {{ $contentStyle }} peer-checked/knots:grid relative"> 181 <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8"> 182 <section class="space-y-4"> 183 <h1 class="{{ $titleStyle }}">Run it at home</h1> 184 <p class="text-gray-600 dark:text-gray-400"> 185 Host your repositories on your own infrastructure with <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="no-underline">knots</a>. 186 + Run CI on your own machines with <a href="https://docs.tangled.org/spindles.html#self-hosting-guide" class="no-underline">spindles</a>. 187 <br> 188 Don't want to self-host? All are welcome on our hosted instances. 189 </p> 190 + <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="hover:no-underline inline-flex md:hidden items-center gap-2 text-sm text-black dark:text-white font-medium"> 191 + Learn more 192 + {{ i "arrow-right" "size-4" }} 193 + </a> 194 </section> 195 <div class="w-fit hidden md:flex items-center"> 196 + <div class="size-32 rounded-full flex items-center justify-center bg-blue-100 dark:bg-blue-900 -mr-4" > 197 + {{ i "workflow" "size-16 text-blue-500 dark:text-blue-500" }} 198 </div> 199 + <div class="size-40 rounded-full flex items-center justify-center bg-yellow-100 dark:bg-yellow-900 z-10"> 200 + {{ i "server" "size-24 text-yellow-500 dark:text-yellow-500" }} 201 </div> 202 </div> 203 </div> 204 + <div class="{{ $imgContentStyle }} relative overflow-hidden flex items-center"> 205 + <div class="w-full md:w-full flex justify-center"> 206 + <img src="https://assets.tangled.network/home-page-self-host.svg" class="w-[120%] md:w-full" /> 207 </div> 208 </div> 209 + <a href="https://docs.tangled.org/knot-self-hosting-guide.html#knot-self-hosting-guide" class="hover:no-underline hidden md:inline-flex absolute -bottom-6 -right-12 items-center gap-2 p-3 text-base btn"> 210 + Learn more 211 + {{ i "arrow-right" "size-4" }} 212 + </a> 213 </div> 214 215 + <div class="col-span-3 {{ $contentStyle }} peer-checked/spindles:grid relative"> 216 <div class="{{ $textContentStyle }} flex place-content-between gap-4 md:gap-8"> 217 <section class="space-y-4"> 218 <h1 class="{{ $titleStyle }}">Nix-powered CI</h1> ··· 216 <br> 217 Support for Docker and MicroVM based runners coming soon! 218 </p> 219 + <a href="https://docs.tangled.org/spindles.html#pipelines" class="hover:no-underline inline-flex md:hidden items-center gap-2 text-sm text-black dark:text-white font-medium"> 220 + Learn more 221 + {{ i "arrow-right" "size-4" }} 222 + </a> 223 </section> 224 <div class="w-fit hidden md:flex items-center"> 225 <div class="size-32 rounded-full flex items-center justify-center bg-green-100 dark:bg-green-900 -mr-4" > ··· 227 </div> 228 </div> 229 <div class="{{ $imgContentStyle }} flex items-end pb-0 overflow-hidden"> 230 + <div class="w-full md:w-full flex justify-center"> 231 + <img src="https://assets.tangled.network/home-page-ci.svg" class="w-[120%] md:w-full" /> 232 </div> 233 </div> 234 + <a href="https://docs.tangled.org/spindles.html#pipelines" class="hover:no-underline hidden md:inline-flex absolute -bottom-6 -right-12 items-center gap-2 p-3 text-base btn"> 235 + Learn more 236 + {{ i "arrow-right" "size-4" }} 237 + </a> 238 </div> 239 </div> 240 ··· 328 <div class="{{ $cardInnerStyle }}"> 329 {{ $moreLink := "https://tangled.org/core" }} 330 <div class="{{ $contentStyle }}"> 331 + <h3 class="{{ $titleStyle }}">Free and open source</h3> 332 <p class="{{ $descriptionStyle }}"> 333 + All of Tangled is open source and built with the community! 334 + Check out the <a href="https://tangled.org/core">monorepo</a> and join in on the fun. 335 <br> 336 <br> 337 We welcome contributions however big or small. You can start contributing by picking up a 338 + <a href="https://tangled.org/tangled.org/core/issues">good-first-issue</a>. 339 </p> 340 <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}"> 341 View source ··· 364 <h3 class="{{ $titleStyle }}">Social coding is back</h3> 365 <p class="{{ $descriptionStyle }}"> 366 Discover trending projects, follow your friends and star your favourite repositories. Coding is better together! 367 </p> 368 <a href="{{ $moreLink }}" class="{{ $linkMobileStyle }}"> 369 Explore timeline
-5
appview/pages/templates/timeline/timeline.html
··· 8 {{ end }} 9 10 {{ define "content" }} 11 - {{ if .LoggedInUser }} 12 - {{ else }} 13 - {{ template "timeline/fragments/hero" . }} 14 - {{ end }} 15 - 16 {{ template "timeline/fragments/goodfirstissues" . }} 17 {{ template "timeline/fragments/trending" . }} 18 {{ template "timeline/fragments/timeline" . }}
··· 8 {{ end }} 9 10 {{ define "content" }} 11 {{ template "timeline/fragments/goodfirstissues" . }} 12 {{ template "timeline/fragments/trending" . }} 13 {{ template "timeline/fragments/timeline" . }}