this repo has no description
1{{ define "title" }}{{ resolve .Card.UserDid }}{{ end }}
2
3{{ define "extrameta" }}
4 {{ $handle := resolve .Card.UserDid }}
5 {{ $avatarUrl := fullAvatar $handle }}
6 <meta property="og:title" content="{{ $handle }}" />
7 <meta property="og:type" content="profile" />
8 <meta property="og:url" content="https://tangled.org/{{ $handle }}?tab={{ .Active }}" />
9 <meta property="og:description" content="{{ or .Card.Profile.Description $handle }}" />
10 <meta property="og:image" content="{{ $avatarUrl }}" />
11 <meta property="og:image:width" content="512" />
12 <meta property="og:image:height" content="512" />
13
14 <meta name="twitter:card" content="summary" />
15 <meta name="twitter:title" content="{{ $handle }}" />
16 <meta name="twitter:description" content="{{ or .Card.Profile.Description $handle }}" />
17 <meta name="twitter:image" content="{{ $avatarUrl }}" />
18{{ end }}
19
20{{ define "content" }}
21 {{ template "profileTabs" . }}
22 <section class="bg-white dark:bg-gray-800 px-2 py-6 md:p-6 rounded w-full dark:text-white drop-shadow-sm">
23 <div class="grid grid-cols-1 md:grid-cols-11 gap-4">
24 {{ $style := "hidden md:block md:col-span-3" }}
25 {{ if eq $.Active "overview" }}
26 {{ $style = "md:col-span-3" }}
27 {{ end }}
28 <div class="{{ $style }} order-1 order-1">
29 <div class="flex flex-col gap-4">
30 {{ template "user/fragments/profileCard" .Card }}
31 {{ block "punchcard" .Card.Punchcard }} {{ end }}
32 </div>
33 </div>
34
35 {{ block "profileContent" . }} {{ end }}
36 </div>
37 </section>
38{{ end }}
39
40{{ define "profileTabs" }}
41<nav class="w-full pl-4 overflow-x-auto overflow-y-hidden">
42 <div class="flex z-60">
43 {{ $activeTabStyles := "-mb-px bg-white dark:bg-gray-800" }}
44 {{ $tabs := .Card.GetTabs }}
45 {{ $tabmeta := dict "x" "y" }}
46 {{ range $item := $tabs }}
47 {{ $key := index $item 0 }}
48 {{ $value := index $item 1 }}
49 {{ $icon := index $item 2 }}
50 {{ $meta := index $item 3 }}
51 <a
52 href="?tab={{ $value }}"
53 class="relative -mr-px group no-underline hover:no-underline"
54 hx-boost="true">
55 <div
56 class="px-4 py-1 mr-1 text-black dark:text-white min-w-[80px] text-center relative rounded-t whitespace-nowrap
57 {{ if eq $.Active $key }}
58 {{ $activeTabStyles }}
59 {{ else }}
60 group-hover:bg-gray-100/25 group-hover:dark:bg-gray-700/25
61 {{ end }}
62 ">
63 <span class="flex items-center justify-center">
64 {{ i $icon "w-4 h-4 mr-2" }}
65 {{ $key }}
66 {{ if $meta }}
67 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm ml-1">{{ $meta }}</span>
68 {{ end }}
69 </span>
70 </div>
71 </a>
72 {{ end }}
73 </div>
74</nav>
75{{ end }}
76
77{{ define "punchcard" }}
78 {{ $now := now }}
79 <div>
80 <p class="px-2 pb-4 flex gap-2 text-sm font-bold dark:text-white">
81 PUNCHCARD
82 <span class="font-mono font-normal text-sm text-gray-500 dark:text-gray-400 ">
83 {{ .Total | int64 | commaFmt }} commits
84 </span>
85 </p>
86 <div class="grid grid-cols-28 md:grid-cols-14 gap-y-3 w-full h-full">
87 {{ range .Punches }}
88 {{ $count := .Count }}
89 {{ $theme := "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
90 {{ if lt $count 1 }}
91 {{ $theme = "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
92 {{ else if lt $count 2 }}
93 {{ $theme = "bg-green-200 dark:bg-green-900 size-[5px]" }}
94 {{ else if lt $count 4 }}
95 {{ $theme = "bg-green-300 dark:bg-green-800 size-[5px]" }}
96 {{ else if lt $count 8 }}
97 {{ $theme = "bg-green-400 dark:bg-green-700 size-[6px]" }}
98 {{ else }}
99 {{ $theme = "bg-green-500 dark:bg-green-600 size-[7px]" }}
100 {{ end }}
101
102 {{ if .Date.After $now }}
103 {{ $theme = "border border-gray-200 dark:border-gray-700 size-[4px]" }}
104 {{ end }}
105 <div class="w-full h-full flex justify-center items-center">
106 <div
107 class="aspect-square rounded-full transition-all duration-300 {{ $theme }} max-w-full max-h-full"
108 title="{{ .Date.Format "2006-01-02" }}: {{ .Count }} commits">
109 </div>
110 </div>
111 {{ end }}
112 </div>
113 </div>
114{{ end }}
115
116{{ define "layouts/profilebase" }}
117 {{ template "layouts/base" . }}
118{{ end }}