Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add global search bar widget (#158)

Leendert de Borstf3e740bab37f
diff --git a/src/AliasVault.Admin/wwwroot/css/tailwind.css b/src/AliasVault.Admin/wwwroot/css/tailwind.css
index 944c2eeea..908302721 100644
--- a/src/AliasVault.Admin/wwwroot/css/tailwind.css
+++ b/src/AliasVault.Admin/wwwroot/css/tailwind.css
@@ -644,14 +644,6 @@ video {
grid-column: 1 / -1;
}
-.col-span-2 {
- grid-column: span 2 / span 2;
-}
-
-.col-span-6 {
- grid-column: span 6 / span 6;
-}
-
.mx-3 {
margin-left: 0.75rem;
margin-right: 0.75rem;
@@ -667,6 +659,10 @@ video {
margin-bottom: 1rem;
}
+.mb-1 {
+ margin-bottom: 0.25rem;
+}
+
.mb-2 {
margin-bottom: 0.5rem;
}
@@ -743,10 +739,6 @@ video {
margin-top: 2rem;
}
-.mb-1 {
- margin-bottom: 0.25rem;
-}
-
.line-clamp-1 {
overflow: hidden;
display: -webkit-box;
@@ -822,10 +814,18 @@ video {
width: 50%;
}
+.w-1\/3 {
+ width: 33.333333%;
+}
+
.w-10 {
width: 2.5rem;
}
+.w-2\/3 {
+ width: 66.666667%;
+}
+
.w-4 {
width: 1rem;
}
@@ -858,14 +858,6 @@ video {
width: 100%;
}
-.w-1\/3 {
- width: 33.333333%;
-}
-
-.w-2\/3 {
- width: 66.666667%;
-}
-
.max-w-2xl {
max-width: 42rem;
}
@@ -882,10 +874,6 @@ video {
max-width: 36rem;
}
-.flex-1 {
- flex: 1 1 0%;
-}
-
.flex-shrink-0 {
flex-shrink: 0;
}
@@ -924,6 +912,10 @@ video {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
+.grid-cols-2 {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+}
+
.grid-cols-4 {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
@@ -932,14 +924,6 @@ video {
grid-template-columns: repeat(7, minmax(0, 1fr));
}
-.grid-cols-2 {
- grid-template-columns: repeat(2, minmax(0, 1fr));
-}
-
-.grid-cols-6 {
- grid-template-columns: repeat(6, minmax(0, 1fr));
-}
-
.flex-col {
flex-direction: column;
}
@@ -972,10 +956,6 @@ video {
justify-content: space-between;
}
-.gap-6 {
- gap: 1.5rem;
-}
-
.space-x-1 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
@@ -1140,11 +1120,6 @@ video {
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
}
-.bg-blue-600 {
- --tw-bg-opacity: 1;
- background-color: rgb(37 99 235 / var(--tw-bg-opacity));
-}
-
.bg-gray-100 {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
@@ -1344,6 +1319,14 @@ video {
padding-bottom: 2rem;
}
+.pl-2 {
+ padding-left: 0.5rem;
+}
+
+.pr-2 {
+ padding-right: 0.5rem;
+}
+
.ps-2 {
padding-inline-start: 0.5rem;
}
@@ -1360,14 +1343,6 @@ video {
padding-top: 2rem;
}
-.pl-2 {
- padding-left: 0.5rem;
-}
-
-.pr-2 {
- padding-right: 0.5rem;
-}
-
.text-left {
text-align: left;
}
@@ -1518,11 +1493,6 @@ video {
color: rgb(133 77 14 / var(--tw-text-opacity));
}
-.text-blue-500 {
- --tw-text-opacity: 1;
- color: rgb(59 130 246 / var(--tw-text-opacity));
-}
-
.underline {
text-decoration-line: underline;
}
@@ -1595,11 +1565,6 @@ video {
transition-duration: 300ms;
}
-.hover\:bg-blue-700:hover {
- --tw-bg-opacity: 1;
- background-color: rgb(29 78 216 / var(--tw-bg-opacity));
-}
-
.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
@@ -1625,14 +1590,14 @@ video {
background-color: rgb(154 93 38 / var(--tw-bg-opacity));
}
-.hover\:bg-red-800:hover {
+.hover\:bg-red-700:hover {
--tw-bg-opacity: 1;
- background-color: rgb(153 27 27 / var(--tw-bg-opacity));
+ background-color: rgb(185 28 28 / var(--tw-bg-opacity));
}
-.hover\:bg-red-700:hover {
+.hover\:bg-red-800:hover {
--tw-bg-opacity: 1;
- background-color: rgb(185 28 28 / var(--tw-bg-opacity));
+ background-color: rgb(153 27 27 / var(--tw-bg-opacity));
}
.hover\:text-gray-900:hover {
@@ -1750,11 +1715,6 @@ video {
border-color: rgb(55 65 81 / var(--tw-border-opacity));
}
-.dark\:bg-blue-500:is(.dark *) {
- --tw-bg-opacity: 1;
- background-color: rgb(59 130 246 / var(--tw-bg-opacity));
-}
-
.dark\:bg-gray-600:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
@@ -1785,6 +1745,11 @@ video {
background-color: rgb(214 131 56 / var(--tw-bg-opacity));
}
+.dark\:bg-red-500:is(.dark *) {
+ --tw-bg-opacity: 1;
+ background-color: rgb(239 68 68 / var(--tw-bg-opacity));
+}
+
.dark\:bg-red-900:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(127 29 29 / var(--tw-bg-opacity));
@@ -1795,11 +1760,6 @@ video {
background-color: rgb(113 63 18 / var(--tw-bg-opacity));
}
-.dark\:bg-red-500:is(.dark *) {
- --tw-bg-opacity: 1;
- background-color: rgb(239 68 68 / var(--tw-bg-opacity));
-}
-
.dark\:bg-opacity-80:is(.dark *) {
--tw-bg-opacity: 0.8;
}
@@ -1893,11 +1853,6 @@ video {
--tw-ring-offset-color: #1f2937;
}
-.dark\:hover\:bg-blue-600:hover:is(.dark *) {
- --tw-bg-opacity: 1;
- background-color: rgb(37 99 235 / var(--tw-bg-opacity));
-}
-
.dark\:hover\:bg-gray-600:hover:is(.dark *) {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity));
@@ -1948,11 +1903,6 @@ video {
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity));
}
-.dark\:focus\:ring-blue-800:focus:is(.dark *) {
- --tw-ring-opacity: 1;
- --tw-ring-color: rgb(30 64 175 / var(--tw-ring-opacity));
-}
-
.dark\:focus\:ring-gray-600:focus:is(.dark *) {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity));
@@ -1978,21 +1928,17 @@ video {
--tw-ring-color: rgb(154 93 38 / var(--tw-ring-opacity));
}
-.dark\:focus\:ring-red-900:focus:is(.dark *) {
+.dark\:focus\:ring-red-800:focus:is(.dark *) {
--tw-ring-opacity: 1;
- --tw-ring-color: rgb(127 29 29 / var(--tw-ring-opacity));
+ --tw-ring-color: rgb(153 27 27 / var(--tw-ring-opacity));
}
-.dark\:focus\:ring-red-800:focus:is(.dark *) {
+.dark\:focus\:ring-red-900:focus:is(.dark *) {
--tw-ring-opacity: 1;
- --tw-ring-color: rgb(153 27 27 / var(--tw-ring-opacity));
+ --tw-ring-color: rgb(127 29 29 / var(--tw-ring-opacity));
}
@media (min-width: 640px) {
- .sm\:col-span-3 {
- grid-column: span 3 / span 3;
- }
-
.sm\:flex {
display: flex;
}
@@ -2011,18 +1957,18 @@ video {
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
- .sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
- --tw-space-y-reverse: 0;
- margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
- margin-bottom: calc(0px * var(--tw-space-y-reverse));
- }
-
.sm\:space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}
+ .sm\:space-y-0 > :not([hidden]) ~ :not([hidden]) {
+ --tw-space-y-reverse: 0;
+ margin-top: calc(0px * calc(1 - var(--tw-space-y-reverse)));
+ margin-bottom: calc(0px * var(--tw-space-y-reverse));
+ }
+
.sm\:p-6 {
padding: 1.5rem;
}
@@ -2116,10 +2062,6 @@ video {
order: 2;
}
- .lg\:col-auto {
- grid-column: auto;
- }
-
.lg\:mb-10 {
margin-bottom: 2.5rem;
}
@@ -2180,17 +2122,17 @@ video {
gap: 1rem;
}
- .xl\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
- --tw-space-x-reverse: 0;
- margin-right: calc(2rem * var(--tw-space-x-reverse));
- margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
- }
-
.xl\:space-x-0 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0px * var(--tw-space-x-reverse));
margin-left: calc(0px * calc(1 - var(--tw-space-x-reverse)));
}
+
+ .xl\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
+ --tw-space-x-reverse: 0;
+ margin-right: calc(2rem * var(--tw-space-x-reverse));
+ margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
+ }
}
@media (min-width: 1536px) {
@@ -2198,10 +2140,6 @@ video {
grid-column: span 2 / span 2;
}
- .\32xl\:flex {
- display: flex;
- }
-
.\32xl\:space-x-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(1rem * var(--tw-space-x-reverse));
diff --git a/src/AliasVault.Client/Main/Components/Widgets/CreateNewIdentityWidget.razor b/src/AliasVault.Client/Main/Components/Widgets/CreateNewIdentityWidget.razor
index 577601d4c..cab8c589e 100644
--- a/src/AliasVault.Client/Main/Components/Widgets/CreateNewIdentityWidget.razor
+++ b/src/AliasVault.Client/Main/Components/Widgets/CreateNewIdentityWidget.razor
@@ -104,7 +104,7 @@
await UpdatePopupStyle();
await Task.Delay(100); // Give time for the DOM to update
- await JSRuntime.InvokeVoidAsync("focusElement", "serviceName");
+ await JsInteropService.FocusElementById("serviceName");
}
private void ClosePopup()
diff --git a/src/AliasVault.Client/Main/Components/Widgets/SearchWidget.razor b/src/AliasVault.Client/Main/Components/Widgets/SearchWidget.razor
new file mode 100644
index 000000000..3ee5c5209
--- /dev/null
+++ b/src/AliasVault.Client/Main/Components/Widgets/SearchWidget.razor
@@ -0,0 +1,178 @@
+@inject DbService DbService
+@inject NavigationManager NavigationManager
+@inject KeyboardShortcutService KeyboardShortcutService
+@inject JsInteropService JsInteropService
+@implements IAsyncDisposable
+
+<div class="relative">
+ <input
+ id="searchWidget"
+ type="text"
+ placeholder="Type here to search"
+ autocomplete="off"
+ class="w-full px-4 py-2 text-gray-700 bg-white border rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:focus:ring-primary-500"
+ @bind-value="SearchTerm"
+ @oninput="SearchTermChanged"
+ @onfocus="OnFocus"
+ @onblur="OnBlur"
+ @onkeydown="HandleKeyDown"/>
+
+ @if (ShowHelpText)
+ {
+ <div class="absolute z-10 w-full mt-1 bg-white rounded-md shadow-lg dark:bg-gray-800 p-2 text-sm text-gray-600 dark:text-gray-400">
+ @if (string.IsNullOrEmpty(SearchTerm))
+ {
+ <p>Type a term to search for, this can be the service name, description or email address.</p>
+ }
+ else if (SearchTerm.Length == 1)
+ {
+ <p>Please type more chars</p>
+ }
+ else
+ {
+ <p>Searching for "@SearchTerm"</p>
+ }
+ </div>
+ }
+
+ @if (ShowResults)
+ {
+ @if (SearchResults.Any())
+ {
+ <div class="absolute z-10 w-full mt-1 bg-white rounded-md shadow-lg dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400">
+ @for (int i = 0; i < SearchResults.Count; i++)
+ {
+ var result = SearchResults[i];
+ <div
+ class="@(i == SelectedIndex ? "bg-gray-100 dark:bg-gray-700" : "") px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700"
+ @onclick="() => SelectResult(result)">
+ @result.Service.Name <span class="text-gray-500">(@result.Alias.Email)</span>
+ </div>
+ }
+ </div>
+ }
+ else
+ {
+ <div class="absolute z-10 w-full mt-1 bg-white rounded-md shadow-lg dark:bg-gray-800 text-sm text-gray-600 dark:text-gray-400">
+ <div class="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
+ No results found
+ </div>
+ </div>
+ }
+ }
+</div>
+
+@code {
+ private string SearchTerm { get; set; } = string.Empty;
+ private List<Credential> SearchResults { get; set; } = new();
+ private bool ShowResults => SearchTerm.Length >= 2;
+ private bool ShowHelpText { get; set; }
+ private int SelectedIndex { get; set; } = -1;
+
+ /// <inheritdoc />
+ async ValueTask IAsyncDisposable.DisposeAsync()
+ {
+ await KeyboardShortcutService.UnregisterShortcutAsync("gs");
+ await KeyboardShortcutService.UnregisterShortcutAsync("gc");
+ NavigationManager.LocationChanged -= ResetSearchField;
+ }
+
+ /// <inheritdoc />
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if (firstRender)
+ {
+ await KeyboardShortcutService.RegisterShortcutAsync("gs", FocusSearchField);
+ await KeyboardShortcutService.RegisterShortcutAsync("gf", FocusSearchField);
+ NavigationManager.LocationChanged += ResetSearchField;
+ }
+ }
+
+ private void OnFocus()
+ {
+ ShowHelpText = true;
+ }
+
+ private void OnBlur()
+ {
+ ShowHelpText = false;
+ }
+
+ private async Task SearchTermChanged(ChangeEventArgs e)
+ {
+ Console.WriteLine("Search term changed");
+ SearchTerm = e.Value?.ToString() ?? string.Empty;
+ await PerformSearch();
+ }
+
+ private async Task PerformSearch()
+ {
+ var context = await DbService.GetDbContextAsync();
+ if (SearchTerm.Length >= 2)
+ {
+ var searchTerms = SearchTerm.Trim().ToLowerInvariant().Split(' ', StringSplitOptions.RemoveEmptyEntries);
+
+ var query = context.Credentials
+ .Include(x => x.Service)
+ .Include(x => x.Alias)
+ .AsQueryable();
+
+ foreach (var term in searchTerms)
+ {
+ query = query.Where(x =>
+ (x.Service.Name != null && EF.Functions.Like(x.Service.Name.ToLower(), $"%{term}%")) ||
+ (x.Alias.Email != null && EF.Functions.Like(x.Alias.Email.ToLower(), $"%{term}%"))
+ );
+ }
+
+ SearchResults = await query.Take(10).ToListAsync();
+
+ // Select first entry by default so when pressing enter, the first result is immediately selected.
+ SelectedIndex = 0;
+ }
+ else
+ {
+ SearchResults.Clear();
+ }
+
+ StateHasChanged();
+ }
+
+ private async Task HandleKeyDown(KeyboardEventArgs e)
+ {
+ switch (e.Key)
+ {
+ case "ArrowDown":
+ SelectedIndex = Math.Min(SelectedIndex + 1, SearchResults.Count - 1);
+ break;
+ case "ArrowUp":
+ SelectedIndex = Math.Max(SelectedIndex - 1, -1);
+ break;
+ case "Enter":
+ if (SelectedIndex >= 0 && SelectedIndex < SearchResults.Count)
+ {
+ await SelectResult(SearchResults[SelectedIndex]);
+ }
+
+ break;
+ }
+ }
+
+ private async Task SelectResult(Credential credential)
+ {
+ await JsInteropService.BlurElementById("searchWidget");
+ NavigationManager.NavigateTo($"/credentials/{credential.Id}");
+ }
+
+ private void ResetSearchField(object? sender, LocationChangedEventArgs e)
+ {
+ SearchTerm = string.Empty;
+ SearchResults.Clear();
+ StateHasChanged();
+ }
+
+ private async Task FocusSearchField()
+ {
+ await JsInteropService.FocusElementById("searchWidget");
+ }
+}
diff --git a/src/AliasVault.Client/Main/Layout/Footer.razor b/src/AliasVault.Client/Main/Layout/Footer.razor
index d4cca12b9..6c67b1f9c 100644
--- a/src/AliasVault.Client/Main/Layout/Footer.razor
+++ b/src/AliasVault.Client/Main/Layout/Footer.razor
@@ -1,16 +1,57 @@
- <footer class="md:flex md:items-center md:justify-between px-4 2xl:px-0 py-6 md:py-10">
+@inject NavigationManager NavigationManager
+@implements IDisposable
+
+<footer class="md:flex md:items-center md:justify-between px-4 2xl:px-0 py-6 md:py-10">
<p class="text-sm text-center text-gray-500 mb-4 md:mb-0">
© 2024 AliasVault. All rights reserved.
</p>
<ul class="flex flex-wrap items-center justify-center">
- <li><a href="#" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">Terms and conditions</a></li>
- <li><a href="#" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">License</a></li>
- <li><a href="https://github.com/lanedirt/AliasVault" target="_blank" class="text-sm font-normal text-gray-500 hover:underline dark:text-gray-400">GitHub</a></li>
+ <li>
+ <a href="#" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">Terms and conditions</a>
+ </li>
+ <li>
+ <a href="#" class="mr-4 text-sm font-normal text-gray-500 hover:underline md:mr-6 dark:text-gray-400">License</a>
+ </li>
+ <li>
+ <a href="https://github.com/lanedirt/AliasVault" target="_blank" class="text-sm font-normal text-gray-500 hover:underline dark:text-gray-400">GitHub</a>
+ </li>
</ul>
</footer>
<div class="text-center text-gray-400 text-sm pt-4 pb-2">@RandomQuote</div>
@code {
- private string RandomQuote => "Tip: You can use the 'gc' keyboard shortcut to quickly create a new identity.";
+ private static readonly string[] Quotes =
+ [
+ "Tip: Use the g+c (go create) keyboard shortcut to quickly create a new identity.",
+ "Tip: Use the g+f (go find) keyboard shortcut to focus the search field.",
+ "Tip: Use the g+h (go home) keyboard shortcut to go to the homepage.",
+ ];
+
+ private string RandomQuote = string.Empty;
+
+ /// <inheritdoc />
+ public void Dispose()
+ {
+ NavigationManager.LocationChanged -= RefreshQuote;
+ }
+
+ /// <inheritdoc />
+ protected override void OnAfterRender(bool firstRender)
+ {
+ if (firstRender)
+ {
+ RandomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
+ NavigationManager.LocationChanged += RefreshQuote;
+ }
+ }
+
+ /// <summary>
+ /// Shows a new random quote.
+ /// </summary>
+ private void RefreshQuote(object? sender, LocationChangedEventArgs e)
+ {
+ RandomQuote = Quotes[Random.Shared.Next(Quotes.Length)];
+ StateHasChanged();
+ }
}
diff --git a/src/AliasVault.Client/Main/Layout/TopMenu.razor b/src/AliasVault.Client/Main/Layout/TopMenu.razor
index 0c774c8d2..bd3bddfa7 100644
--- a/src/AliasVault.Client/Main/Layout/TopMenu.razor
+++ b/src/AliasVault.Client/Main/Layout/TopMenu.razor
@@ -15,9 +15,18 @@
<NavLink href="/credentials" class="block text-gray-700 hover:text-primary-700 dark:text-gray-400 dark:hover:text-white" ActiveClass="text-primary-700 dark:text-primary-500" Match="NavLinkMatch.All">
Credentials
</NavLink>
+ <NavLink href="/emails" class="block text-gray-700 hover:text-primary-700 dark:text-gray-400 dark:hover:text-white" ActiveClass="text-primary-700 dark:text-primary-500" Match="NavLinkMatch.All">
+ Emails
+ </NavLink>
</ul>
</div>
</div>
+
+ <!-- New search box -->
+ <div class="flex-grow mx-4">
+ <SearchWidget />
+ </div>
+
<div class="flex justify-end items-center lg:order-2">
<CreateNewIdentityWidget />
diff --git a/src/AliasVault.Client/Services/JsInteropService.cs b/src/AliasVault.Client/Services/JsInteropService.cs
index 978137d64..8d6c583b8 100644
--- a/src/AliasVault.Client/Services/JsInteropService.cs
+++ b/src/AliasVault.Client/Services/JsInteropService.cs
@@ -44,6 +44,22 @@ public class JsInteropService(IJSRuntime jsRuntime)
public async Task DownloadFileFromStream(string filename, byte[] blob) =>
await jsRuntime.InvokeVoidAsync("downloadFileFromStream", filename, blob);
+ /// <summary>
+ /// Focus an element by its ID.
+ /// </summary>
+ /// <param name="elementId">The element ID to focus.</param>
+ /// <returns>Task.</returns>
+ public async Task FocusElementById(string elementId) =>
+ await jsRuntime.InvokeVoidAsync("focusElement", elementId);
+
+ /// <summary>
+ /// Blur (defocus) an element by its ID.
+ /// </summary>
+ /// <param name="elementId">The element ID to focus.</param>
+ /// <returns>Task.</returns>
+ public async Task BlurElementById(string elementId) =>
+ await jsRuntime.InvokeVoidAsync("blurElement", elementId);
+
/// <summary>
/// Copy a string to the browsers clipboard.
/// </summary>
diff --git a/src/AliasVault.Client/wwwroot/css/tailwind.css b/src/AliasVault.Client/wwwroot/css/tailwind.css
index babf97f1c..462b0ac64 100644
--- a/src/AliasVault.Client/wwwroot/css/tailwind.css
+++ b/src/AliasVault.Client/wwwroot/css/tailwind.css
@@ -566,6 +566,10 @@ video {
border-width: 0;
}
+.static {
+ position: static;
+}
+
.fixed {
position: fixed;
}
@@ -628,6 +632,10 @@ video {
z-index: 50;
}
+.z-10 {
+ z-index: 10;
+}
+
.col-span-2 {
grid-column: span 2 / span 2;
}
@@ -755,6 +763,10 @@ video {
margin-top: 2rem;
}
+.mt-1 {
+ margin-top: 0.25rem;
+}
+
.block {
display: block;
}
@@ -907,6 +919,10 @@ video {
flex-shrink: 0;
}
+.flex-grow {
+ flex-grow: 1;
+}
+
.transform {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
diff --git a/src/AliasVault.Client/wwwroot/js/utilities.js b/src/AliasVault.Client/wwwroot/js/utilities.js
index c9ba67c81..db8ed8a01 100644
--- a/src/AliasVault.Client/wwwroot/js/utilities.js
+++ b/src/AliasVault.Client/wwwroot/js/utilities.js
@@ -47,6 +47,13 @@ window.focusElement = (elementId) => {
}
};
+window.blurElement = (elementId) => {
+ const element = document.getElementById(elementId);
+ if (element) {
+ element.blur();
+ }
+};
+
function initDarkModeSwitcher() {
const themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');