diff options
| author | Kyren223 <contact@kyren.codes> | 2026-10-09 18:12:51 +0300 |
|---|---|---|
| committer | Kyren223 <contact@kyren.codes> | 2026-10-09 18:12:51 +0300 |
| commit | 65413df98c8ac0a1bc141f7aa7148eb52528024c (patch) | |
| tree | 5b032193cd7b2b150516a4497fe133756f10c8ae /website.templ | |
| parent | 8a0ee33521c39cda1d337992d5e28e09d1f3c915 (diff) | |
Some more changes, woohoo
Diffstat (limited to 'website.templ')
| -rw-r--r-- | website.templ | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/website.templ b/website.templ index 4a0471b..8b316b9 100644 --- a/website.templ +++ b/website.templ @@ -269,6 +269,7 @@ type Project struct { Icon templ.Component Tags []ProjectTag Links []ProjectLink + Link string } type ProjectTag struct { @@ -302,7 +303,7 @@ type Stat struct { var versionBeforeDownloads = false -const flagshipClasses = "[--border-py:1.25rem] border-(--accent)! bg-white/[0.03] shadow-[0_0_1.5rem_color-mix(in_srgb,var(--accent)_25%,transparent)]" +const flagshipClasses = "[--border-py:1.25rem] border-(--accent)! bg-white/[0.03] shadow-[0_0_1.5rem_color-mix(in_srgb,var(--accent)_25%,transparent)] bg-black/20 hover:bg-white/10 transition-colors duration-150" templ FlagshipProject(project Project, extra string) { @TerminalBorder("", "", flagshipClasses+" "+extra) { @@ -310,7 +311,7 @@ templ FlagshipProject(project Project, extra string) { <div class="flex flex-col gap-4 flex-1 min-w-0"> <div class="flex flex-wrap items-baseline gap-x-[1ch] gap-y-[0.4rem]"> @project.Icon - <a href={ templ.SafeURL("/projects/" + project.Slug) } class="text-[170%] font-bold text-(--accent) hover:underline after:absolute after:inset-0 after:z-0">{ project.Title }</a> + <a href={ templ.SafeURL("/projects/" + project.Slug) } class="no-underline text-[170%] font-bold text-(--accent) after:absolute after:inset-0 after:z-0">{ project.Title }</a> <span class="text-[85%] text-(--primary)">{ project.Category }</span> for _, tag := range project.Tags { <code class={ "text-[75%] px-[0.4rem] inline-block rounded-[0.3rem] border-[0.01rem] bg-(--alt)/25" + " " + tag.Color }>{ tag.Name }</code> @@ -429,13 +430,27 @@ templ IconKrypton() { // { "\uf192" } } +func projectURL(p Project) string { + if p.Link != "" { + return p.Link + } + return "/projects/" + p.Slug +} + templ ProjectItem(project Project, extra string) { <div> @TerminalBorder("", "", "[--border-py:0.25rem] py-2 text-[80%] bg-black/20 hover:bg-white/5 transition-colors duration-150"+" "+extra) { <div class="flex flex-col gap-[0.0625rem] w-full"> <div class="flex flex-wrap items-baseline gap-x-[1ch] gap-y-[0.4rem]"> @project.Icon - <a href={ templ.SafeURL("/projects/" + project.Slug) } class="text-[130%] font-bold text-(--accent) after:absolute after:inset-0 after:z-0">{ project.Title }</a> + <a + href={ templ.SafeURL(projectURL(project)) } + if project.Link != "" { + target="_blank" + rel="noopener noreferrer" + } + class="text-[130%] font-bold text-(--accent) after:absolute after:inset-0 after:z-0" + >{ project.Title }</a> <span class="text-[80%] text-(--primary)">{ project.Category }</span> for _, tag := range project.Tags { <code class={ "text-[75%] px-[0.4rem] inline-block rounded-[0.3rem] border-[0.01rem] bg-(--alt)/25" + " " + tag.Color }>{ tag.Name }</code> |
