Skip to content

Commit

Permalink
Create now page (#4)
Browse files Browse the repository at this point in the history
* Add now page to nav

* Stub out more now page

* Add link markup

* Move SocialLink, hide link when link is empty

* Name all Urls to Url

* Add Bluesky icon, use consts for SVGs

* Change Twitter icon to X icon

* Fix whitespace

* Fix whitespace

* Just put it out there
  • Loading branch information
codemonkey85 authored Feb 20, 2024
1 parent 3d84a9f commit dc7af80
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AboutMe.Wasm;
namespace AboutMe.Wasm.Components;

public class SocialLink
{
Expand Down
1 change: 1 addition & 0 deletions AboutMe/Wasm/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
global using AboutMe.Wasm;
global using AboutMe.Wasm.Components;
global using Microsoft.AspNetCore.Components.Web;
global using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
global using MudBlazor;
Expand Down
5 changes: 5 additions & 0 deletions AboutMe/Wasm/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
Home
</MudNavLink>

<MudNavLink Href="now"
Match="NavLinkMatch.All">
Now
</MudNavLink>

<MudNavLink Href="resume"
Match="NavLinkMatch.All">
Résumé
Expand Down
60 changes: 41 additions & 19 deletions AboutMe/Wasm/Pages/Contact.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@ namespace AboutMe.Wasm.Pages;

public partial class Contact
{
private const string MastodonSvg = """
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-mastodon"
viewBox="0 0 16 16">
<path d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z" />
</svg>
""";

private const string ThreadsSvg = """
<svg aria-label="Threads"
viewBox="0 0 192 192"
xmlns="http://www.w3.org/2000/svg">
<path class="x19hqcy"
d="M141.537 88.9883C140.71 88.5919 139.87 88.2104 139.019 87.8451C137.537 60.5382 122.616 44.905 97.5619 44.745C97.4484 44.7443 97.3355 44.7443 97.222 44.7443C82.2364 44.7443 69.7731 51.1409 62.102 62.7807L75.881 72.2328C81.6116 63.5383 90.6052 61.6848 97.2286 61.6848C97.3051 61.6848 97.3819 61.6848 97.4576 61.6855C105.707 61.7381 111.932 64.1366 115.961 68.814C118.893 72.2193 120.854 76.925 121.825 82.8638C114.511 81.6207 106.601 81.2385 98.145 81.7233C74.3247 83.0954 59.0111 96.9879 60.0396 116.292C60.5615 126.084 65.4397 134.508 73.775 140.011C80.8224 144.663 89.899 146.938 99.3323 146.423C111.79 145.74 121.563 140.987 128.381 132.296C133.559 125.696 136.834 117.143 138.28 106.366C144.217 109.949 148.617 114.664 151.047 120.332C155.179 129.967 155.42 145.8 142.501 158.708C131.182 170.016 117.576 174.908 97.0135 175.059C74.2042 174.89 56.9538 167.575 45.7381 153.317C35.2355 139.966 29.8077 120.682 29.6052 96C29.8077 71.3178 35.2355 52.0336 45.7381 38.6827C56.9538 24.4249 74.2039 17.11 97.0132 16.9405C119.988 17.1113 137.539 24.4614 149.184 38.788C154.894 45.8136 159.199 54.6488 162.037 64.9503L178.184 60.6422C174.744 47.9622 169.331 37.0357 161.965 27.974C147.036 9.60668 125.202 0.195148 97.0695 0H96.9569C68.8816 0.19447 47.2921 9.6418 32.7883 28.0793C19.8819 44.4864 13.2244 67.3157 13.0007 95.9325L13 96L13.0007 96.0675C13.2244 124.684 19.8819 147.514 32.7883 163.921C47.2921 182.358 68.8816 191.806 96.9569 192H97.0695C122.03 191.827 139.624 185.292 154.118 170.811C173.081 151.866 172.51 128.119 166.26 113.541C161.776 103.087 153.227 94.5962 141.537 88.9883ZM98.4405 129.507C88.0005 130.095 77.1544 125.409 76.6196 115.372C76.2232 107.93 81.9158 99.626 99.0812 98.6368C101.047 98.5234 102.976 98.468 104.871 98.468C111.106 98.468 116.939 99.0737 122.242 100.233C120.264 124.935 108.662 128.946 98.4405 129.507Z" />
</svg>
<svg aria-label="Threads"
viewBox="0 0 192 192"
xmlns="http://www.w3.org/2000/svg">
<path class="x19hqcy"
d="M141.537 88.9883C140.71 88.5919 139.87 88.2104 139.019 87.8451C137.537 60.5382 122.616 44.905 97.5619 44.745C97.4484 44.7443 97.3355 44.7443 97.222 44.7443C82.2364 44.7443 69.7731 51.1409 62.102 62.7807L75.881 72.2328C81.6116 63.5383 90.6052 61.6848 97.2286 61.6848C97.3051 61.6848 97.3819 61.6848 97.4576 61.6855C105.707 61.7381 111.932 64.1366 115.961 68.814C118.893 72.2193 120.854 76.925 121.825 82.8638C114.511 81.6207 106.601 81.2385 98.145 81.7233C74.3247 83.0954 59.0111 96.9879 60.0396 116.292C60.5615 126.084 65.4397 134.508 73.775 140.011C80.8224 144.663 89.899 146.938 99.3323 146.423C111.79 145.74 121.563 140.987 128.381 132.296C133.559 125.696 136.834 117.143 138.28 106.366C144.217 109.949 148.617 114.664 151.047 120.332C155.179 129.967 155.42 145.8 142.501 158.708C131.182 170.016 117.576 174.908 97.0135 175.059C74.2042 174.89 56.9538 167.575 45.7381 153.317C35.2355 139.966 29.8077 120.682 29.6052 96C29.8077 71.3178 35.2355 52.0336 45.7381 38.6827C56.9538 24.4249 74.2039 17.11 97.0132 16.9405C119.988 17.1113 137.539 24.4614 149.184 38.788C154.894 45.8136 159.199 54.6488 162.037 64.9503L178.184 60.6422C174.744 47.9622 169.331 37.0357 161.965 27.974C147.036 9.60668 125.202 0.195148 97.0695 0H96.9569C68.8816 0.19447 47.2921 9.6418 32.7883 28.0793C19.8819 44.4864 13.2244 67.3157 13.0007 95.9325L13 96L13.0007 96.0675C13.2244 124.684 19.8819 147.514 32.7883 163.921C47.2921 182.358 68.8816 191.806 96.9569 192H97.0695C122.03 191.827 139.624 185.292 154.118 170.811C173.081 151.866 172.51 128.119 166.26 113.541C161.776 103.087 153.227 94.5962 141.537 88.9883ZM98.4405 129.507C88.0005 130.095 77.1544 125.409 76.6196 115.372C76.2232 107.93 81.9158 99.626 99.0812 98.6368C101.047 98.5234 102.976 98.468 104.871 98.468C111.106 98.468 116.939 99.0737 122.242 100.233C120.264 124.935 108.662 128.946 98.4405 129.507Z" />
</svg>
""";

private const string BlueskySvg = """
<svg class="w-[40px] h-auto"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 568 501">
<title>Bluesky butterfly logo</title>
<path fill="currentColor"
d="M123.121 33.664C188.241 82.553 258.281 181.68 284 234.873c25.719-53.192 95.759-152.32 160.879-201.21C491.866-1.611 568-28.906 568 57.947c0 17.346-9.945 145.713-15.778 166.555-20.275 72.453-94.155 90.933-159.875 79.748C507.222 323.8 536.444 388.56 473.333 453.32c-119.86 122.992-172.272-30.859-185.702-70.281-2.462-7.227-3.614-10.608-3.631-7.733-.017-2.875-1.169.506-3.631 7.733-13.43 39.422-65.842 193.273-185.702 70.281-63.111-64.76-33.89-129.52 80.986-149.071-65.72 11.185-139.6-7.295-159.875-79.748C9.945 203.659 0 75.291 0 57.946 0-28.906 76.135-1.612 123.121 33.664Z" />
</svg>
""";

private List<SocialLink> SocialLinksList { get; set; } =
[
SocialLink.EmailMe,
Expand All @@ -17,43 +54,28 @@ public partial class Contact
Name = "Mastodon",
Url = "https://mastodon.social/@codemonkey85",
Title = "[email protected] on Mastodon",
Icon = """
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-mastodon"
viewBox="0 0 16 16">
<path d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z" />
</svg>
""",
Icon = MastodonSvg,
},
new()
{
Name = "Threads",
Url = "https://www.threads.net/@codemonkey85",
Title = "codemonkey85 on Threads",
Icon = """
<svg aria-label="Threads"
viewBox="0 0 192 192"
xmlns="http://www.w3.org/2000/svg">
<path class="x19hqcy"
d="M141.537 88.9883C140.71 88.5919 139.87 88.2104 139.019 87.8451C137.537 60.5382 122.616 44.905 97.5619 44.745C97.4484 44.7443 97.3355 44.7443 97.222 44.7443C82.2364 44.7443 69.7731 51.1409 62.102 62.7807L75.881 72.2328C81.6116 63.5383 90.6052 61.6848 97.2286 61.6848C97.3051 61.6848 97.3819 61.6848 97.4576 61.6855C105.707 61.7381 111.932 64.1366 115.961 68.814C118.893 72.2193 120.854 76.925 121.825 82.8638C114.511 81.6207 106.601 81.2385 98.145 81.7233C74.3247 83.0954 59.0111 96.9879 60.0396 116.292C60.5615 126.084 65.4397 134.508 73.775 140.011C80.8224 144.663 89.899 146.938 99.3323 146.423C111.79 145.74 121.563 140.987 128.381 132.296C133.559 125.696 136.834 117.143 138.28 106.366C144.217 109.949 148.617 114.664 151.047 120.332C155.179 129.967 155.42 145.8 142.501 158.708C131.182 170.016 117.576 174.908 97.0135 175.059C74.2042 174.89 56.9538 167.575 45.7381 153.317C35.2355 139.966 29.8077 120.682 29.6052 96C29.8077 71.3178 35.2355 52.0336 45.7381 38.6827C56.9538 24.4249 74.2039 17.11 97.0132 16.9405C119.988 17.1113 137.539 24.4614 149.184 38.788C154.894 45.8136 159.199 54.6488 162.037 64.9503L178.184 60.6422C174.744 47.9622 169.331 37.0357 161.965 27.974C147.036 9.60668 125.202 0.195148 97.0695 0H96.9569C68.8816 0.19447 47.2921 9.6418 32.7883 28.0793C19.8819 44.4864 13.2244 67.3157 13.0007 95.9325L13 96L13.0007 96.0675C13.2244 124.684 19.8819 147.514 32.7883 163.921C47.2921 182.358 68.8816 191.806 96.9569 192H97.0695C122.03 191.827 139.624 185.292 154.118 170.811C173.081 151.866 172.51 128.119 166.26 113.541C161.776 103.087 153.227 94.5962 141.537 88.9883ZM98.4405 129.507C88.0005 130.095 77.1544 125.409 76.6196 115.372C76.2232 107.93 81.9158 99.626 99.0812 98.6368C101.047 98.5234 102.976 98.468 104.871 98.468C111.106 98.468 116.939 99.0737 122.242 100.233C120.264 124.935 108.662 128.946 98.4405 129.507Z" />
</svg>
""",
Icon = ThreadsSvg,
},
new()
{
Name = "X (Formerly Twitter)",
Url = "https://twitter.com/codemonkey85",
Title = "codemonkey85 on X (Formerly Twitter)",
Icon = Icons.Custom.Brands.Twitter,
Icon = Icons.Custom.Brands.X,
},
new()
{
Name = "Bluesky",
Url = "https://bsky.app/profile/codemonkey85.bsky.social",
Title = "codemonkey85.bsky.social on BlueSky",
Icon = BlueskySvg,
},
];
}
2 changes: 1 addition & 1 deletion AboutMe/Wasm/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</MudText>

<MudText Typo="@Typo.body1">
My pronouns are He / Him.
My pronouns are he / him / his.
</MudText>

<MudPaper Width="235px">
Expand Down
39 changes: 38 additions & 1 deletion AboutMe/Wasm/Pages/Now.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
@page "/now"

<PageTitle>
Michael Bond - Now
</PageTitle>

<MudText Typo="@Typo.h3">
Now
What I'm Doing Now
</MudText>

@if (NowThings is { Count: > 0 })
{
<MudStack Spacing="3"
Class="mb-3">
@foreach (var nowThing in NowThings)
{
<MudCard>
<MudCardHeader>
<MudText Typo="@Typo.h5">
@nowThing.Title
</MudText>
</MudCardHeader>
<MudCardContent>
<MudText Typo="@Typo.body1">
@nowThing.Description
</MudText>
</MudCardContent>
<MudCardActions Class="d-flex gap-4">
@if (nowThing.Url is { Length: > 0 })
{
<MudButton StartIcon="@Icons.Material.Filled.OpenInBrowser"
Variant="Variant.Filled"
Color="Color.Primary"
title="@($"'{@nowThing.Title}' on the web")"
Href="@nowThing.Url"
Target="_blank">
Open
</MudButton>
}
</MudCardActions>
</MudCard>
}
</MudStack>
}
17 changes: 17 additions & 0 deletions AboutMe/Wasm/Pages/Now.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,22 @@ namespace AboutMe.Wasm.Pages;

public partial class Now
{
private List<NowThing> NowThings { get; set; } =
[
new()
{
Title = "Working on",
Description = "This site",
Url = null,
},
];

private struct NowThing
{
public string Title { get; set; }

public string Description { get; set; }

public string? Url { get; set; }
}
}
2 changes: 1 addition & 1 deletion AboutMe/Wasm/Pages/Projects.razor
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
Variant="Variant.Filled"
Color="Color.Primary"
title="@($"'{@project.Name}' on the web")"
Href="@project.WebUrl"
Href="@project.Url"
Target="_blank">
Open
</MudButton>
Expand Down
16 changes: 8 additions & 8 deletions AboutMe/Wasm/Pages/Projects.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,55 @@ public partial class Projects
{
Name = "PKMDS Blazor",
Description = "A port of PKHeX for web, built wih Blazor",
WebUrl = "https://www.pkmds.app/",
Url = "https://www.pkmds.app/",
GitHubUrl = "https://github.com/codemonkey85/PKMDS-Blazor",
Screenshots = [],
}, // PKMDS Blazor
new()
{
Name = "Sound Test",
Description = "Messing around with the JavaScript tone APIs in Blazor",
WebUrl = "https://codemonkey85.github.io/SoundTest/",
Url = "https://codemonkey85.github.io/SoundTest/",
GitHubUrl = "https://github.com/codemonkey85/SoundTest",
Screenshots = [],
}, // Sound Test
new()
{
Name = "Tic Tac Toe Blazor",
Description = "A Tic Tac Toe game for web, built with Blazor",
WebUrl = "https://codemonkey85.github.io/TicTacToeBlazor/",
Url = "https://codemonkey85.github.io/TicTacToeBlazor/",
GitHubUrl = "https://github.com/codemonkey85/TicTacToeBlazor",
Screenshots = [],
}, // Tic Tac Toe Blazor
new()
{
Name = "Four Is The Magic Number!",
Description = "A neat party trick, built with Blazor",
WebUrl = "https://codemonkey85.github.io/FourMagicNumberGame/",
Url = "https://codemonkey85.github.io/FourMagicNumberGame/",
GitHubUrl = "https://github.com/codemonkey85/FourMagicNumberGame",
Screenshots = [],
}, // Four Is The Magic Number!
new()
{
Name = "Barcode Helper",
Description = "Solve the missing digit in a UPC-12",
WebUrl = "https://codemonkey85.github.io/BarcodeHelper/",
Url = "https://codemonkey85.github.io/BarcodeHelper/",
GitHubUrl = "https://github.com/codemonkey85/BarcodeHelper",
Screenshots = [],
}, // Barcode Helper
new()
{
Name = "Tired Doctor Manhattan",
Description = "Doctor Manhattan is tired of stuff",
WebUrl = "https://codemonkey85.github.io/TiredDoctorManhattan/",
Url = "https://codemonkey85.github.io/TiredDoctorManhattan/",
GitHubUrl = "https://github.com/codemonkey85/TiredDoctorManhattan",
Screenshots = [],
}, // Tired Doctor Manhattan
new()
{
Name = "Minecraft Command Builder",
Description = "A tool to help build Minecraft commands",
WebUrl = "https://codemonkey85.github.io/MinecraftCommandBuilder/",
Url = "https://codemonkey85.github.io/MinecraftCommandBuilder/",
GitHubUrl = "https://github.com/codemonkey85/MinecraftCommandBuilder",
Screenshots = [],
}, // Minecraft Command Builder
Expand All @@ -68,7 +68,7 @@ private class Project

public string? Description { get; set; }

public string? WebUrl { get; set; }
public string? Url { get; set; }

public string? GitHubUrl { get; set; }

Expand Down

0 comments on commit dc7af80

Please sign in to comment.