Skip to content

Commit

Permalink
Merge pull request #378 from jovandeginste/fix-icons
Browse files Browse the repository at this point in the history
Add back a number of icons that went missing
  • Loading branch information
jovandeginste authored Jan 5, 2025
2 parents e183646 + 3ea5fb7 commit 9936eda
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 20 deletions.
42 changes: 42 additions & 0 deletions assets/output.css
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,20 @@ table {
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='512' height='512'%3E%3Cpath fill='black' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
}

.icon-\[fa6-solid--chevron-right\] {
display: inline-block;
width: 0.63em;
height: 1em;
background-color: currentColor;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512' width='320' height='512'%3E%3Cpath fill='black' d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256L73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E");
}

.icon-\[fa6-solid--chevron-up\] {
display: inline-block;
width: 1em;
Expand Down Expand Up @@ -2757,6 +2771,34 @@ table {
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M5 20q-2.125 0-3.562-1.437T0 15t1.463-3.562T5 10q1.925 0 3.238 1.15T9.9 14h.65l-1.8-5H7V7h5v2h-1.1l.35 1h4.8L14.6 6H12V4h2.6q.65 0 1.163.35t.737.95l1.7 4.65h.8q2.075 0 3.538 1.463T24 14.95q0 2.1-1.45 3.575T19 20q-1.8 0-3.162-1.125T14.1 16H9.9q-.35 1.725-1.7 2.863T5 20m0-2q1.025 0 1.763-.562T7.8 16H5v-2h2.8q-.3-.9-1.037-1.45T5 12q-1.275 0-2.137.863T2 15q0 1.25.863 2.125T5 18m7.7-4h1.4q.125-.575.338-1.075T15 12h-3.05zm6.3 4q1.275 0 2.138-.875T22 15q0-1.275-.862-2.137T19 12h-.1l1 2.65l-1.9.7l-.95-2.65q-.5.425-.775 1T16 15q0 1.25.863 2.125T19 18m0-3'/%3E%3C/svg%3E");
}

.icon-\[mdi--clipboard-check\] {
display: inline-block;
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='m10 17l-4-4l1.41-1.41L10 14.17l6.59-6.59L18 9m-6-6a1 1 0 0 1 1 1a1 1 0 0 1-1 1a1 1 0 0 1-1-1a1 1 0 0 1 1-1m7 0h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2'/%3E%3C/svg%3E");
}

.icon-\[octicon--mark-github-16\] {
display: inline-block;
width: 1em;
height: 1em;
background-color: currentColor;
-webkit-mask-image: var(--svg);
mask-image: var(--svg);
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3E%3Cpath fill='black' d='M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38c0-.27.01-1.13.01-2.2c0-.75-.25-1.23-.54-1.48c1.78-.2 3.65-.88 3.65-3.95c0-.88-.31-1.59-.82-2.15c.08-.2.36-1.02-.08-2.12c0 0-.67-.22-2.2.82c-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82c-.44 1.1-.16 1.92-.08 2.12c-.51.56-.82 1.28-.82 2.15c0 3.06 1.86 3.75 3.64 3.95c-.23.2-.44.55-.51 1.07c-.46.21-1.61.55-2.33-.66c-.15-.24-.6-.83-1.23-.82c-.67.01-.27.38.01.53c.34.19.73.9.82 1.13c.16.45.68 1.31 2.69.94c0 .67.01 1.3.01 1.49c0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8'/%3E%3C/svg%3E");
}

.visible {
visibility: visible;
}
Expand Down
5 changes: 5 additions & 0 deletions views/helpers/icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var iconMap = map[string]string{
"calories": "icon-[fa6-solid--fire]",

// Misc Icons
"welcome": "icon-[fa6-solid--chevron-right]",
"circular": "icon-[fa6-solid--circle-notch]",
"bidirectional": "icon-[fa6-solid--arrow-right-arrow-left]",
"units": "icon-[fa6-solid--ruler]",
Expand Down Expand Up @@ -68,6 +69,7 @@ var iconMap = map[string]string{
"equipment-add": "icon-[fa6-solid--circle-plus]",
"route-segment-add": "icon-[fa6-solid--circle-plus]",
"heatmap": "icon-[fa6-solid--fire]",
"changelog": "icon-[mdi--clipboard-check]",

// Utility Icons
"close": "icon-[fa6-solid--xmark]",
Expand All @@ -88,6 +90,9 @@ var iconMap = map[string]string{
"attention": "icon-[fa6-solid--circle-exclamation]",
"check": "icon-[fa6-solid--square-check]",
"totals": "icon-[fa6-solid--calculator]",

// Brand Icons
"github": "icon-[octicon--mark-github-16]",
}

func iconFor(what string) string {
Expand Down
12 changes: 8 additions & 4 deletions views/partials/footer.templ
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ templ Footer() {
</div>
<div>
<a
class="icon-brands icon-baseline icon-space-sm icon-outside icon-github"
target="_blank"
href="https://github.com/jovandeginste/workout-tracker"
>GitHub</a>
>
@helpers.IconFor("github")
GitHub
</a>
</div>
<div>
<a
class="icon-solid icon-baseline icon-space-sm icon-outside icon-clipboard-check"
target="_blank"
href={ templ.SafeURL("https://github.com/jovandeginste/workout-tracker/tree/" + v.Sha + "/CHANGELOG.md") }
>Changelog</a>
>
@helpers.IconFor("changelog")
Changelog
</a>
</div>
</div>
}
20 changes: 18 additions & 2 deletions views/partials/footer_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions views/user/login.templ
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ templ Login() {
<div class="sm:flex sm:flex-wrap [&>*]:basis-1/2">
<div>
<div class="inner-form">
<h2
class="icon-solid icon-baseline icon-space-sm icon-before icon-chevron-right"
>
<h2>
@helpers.IconFor("welcome")
{ i18n.T(ctx, "Welcome!") }
</h2>
</div>
Expand Down
26 changes: 15 additions & 11 deletions views/user/login_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9936eda

Please sign in to comment.