Styling and usability fixes
This commit is contained in:
1 parent
2fb0947077
commit
6d0897e756
13 files changed
+140
-109
No files matched your search
@@ -1,12 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { bookmarks_save, bookmarks_store } from "lib/Bookmarks";
|
||||
import { fs_encode_path } from "lib/FilesystemAPI.svelte";
|
||||
import { fs_encode_path, fs_thumbnail_url } from "lib/FilesystemAPI.svelte";
|
||||
import { highlight_current_page } from "lib/HighlightCurrentPage";
|
||||
import MenuEntry from "./MenuEntry.svelte";
|
||||
import { flip } from "svelte/animate";
|
||||
|
||||
let { menu_collapsed }: { menu_collapsed: boolean } = $props();
|
||||
|
||||
let editing = $state(false)
|
||||
|
||||
const toggle_edit = async () => {
|
||||
@@ -76,7 +74,7 @@ const drop = (e: DragEvent, drop_idx: number) => {
|
||||
</script>
|
||||
|
||||
{#if $bookmarks_store.length !== 0}
|
||||
<MenuEntry id="bookmarks" collapsed={menu_collapsed}>
|
||||
<MenuEntry id="bookmarks">
|
||||
{#snippet title()}
|
||||
<div class="title">Bookmarks</div>
|
||||
<button onclick={toggle_edit} class:button_highlight={editing} class="button flat">
|
||||
@@ -116,8 +114,8 @@ const drop = (e: DragEvent, drop_idx: number) => {
|
||||
</button>
|
||||
{:else}
|
||||
<a class="button" href="/d{fs_encode_path(bookmark.path)}" use:highlight_current_page>
|
||||
<i class="icon">{bookmark.icon}</i>
|
||||
<span class:hide={menu_collapsed}>{bookmark.label}</span>
|
||||
<img src={fs_thumbnail_url(bookmark.path, 32, 32)} class="thumbnail" alt="Bookmark icon" />
|
||||
<span>{bookmark.label}</span>
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -145,11 +143,13 @@ const drop = (e: DragEvent, drop_idx: number) => {
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
.highlight {
|
||||
box-shadow: 0 0 0px 1px var(--highlight_color);
|
||||
text-decoration: none;
|
||||
}
|
||||
.thumbnail {
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
border-radius: 2px;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user