lucide icons

This commit is contained in:
vcoppe
2024-04-15 10:33:47 +02:00
parent add887af7f
commit 87c62544bd
7 changed files with 82 additions and 72 deletions

View File

@@ -2,7 +2,18 @@
import * as Menubar from '$lib/components/ui/menubar/index.js'; import * as Menubar from '$lib/components/ui/menubar/index.js';
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import Logo from './Logo.svelte'; import Logo from './Logo.svelte';
import { HeartHandshake } from 'lucide-svelte'; import {
Plus,
Upload,
Copy,
Download,
Undo2,
Redo2,
Trash2,
HeartHandshake
} from 'lucide-svelte';
import Fa from 'svelte-fa';
import { faGoogleDrive } from '@fortawesome/free-brands-svg-icons';
let distanceUnits = 'metric'; let distanceUnits = 'metric';
let velocityUnits = 'speed'; let velocityUnits = 'speed';
@@ -20,17 +31,29 @@
<Menubar.Trigger>File</Menubar.Trigger> <Menubar.Trigger>File</Menubar.Trigger>
<Menubar.Content> <Menubar.Content>
<Menubar.Item> <Menubar.Item>
New GPX file <Menubar.Shortcut>⌘N</Menubar.Shortcut> <Plus size="16" class="mr-1" /> New <Menubar.Shortcut>⌘N</Menubar.Shortcut>
</Menubar.Item> </Menubar.Item>
<Menubar.Item> <Menubar.Item>
Load GPX file(s)... <Menubar.Shortcut>⌘O</Menubar.Shortcut> <Upload size="16" class="mr-1" /> Load from desktop... <Menubar.Shortcut
>⌘O</Menubar.Shortcut
>
</Menubar.Item>
<Menubar.Item>
<Fa icon={faGoogleDrive} class="h-4 w-4 mr-1" />
Load from Google Drive...</Menubar.Item
>
<Menubar.Separator />
<Menubar.Item>
<Copy size="16" class="mr-1" /> Duplicate <Menubar.Shortcut>⌘D</Menubar.Shortcut>
</Menubar.Item> </Menubar.Item>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item> <Menubar.Item>
Export... <Menubar.Shortcut>⌘S</Menubar.Shortcut> <Download size="16" class="mr-1" /> Export... <Menubar.Shortcut>⌘S</Menubar.Shortcut>
</Menubar.Item> </Menubar.Item>
<Menubar.Item> <Menubar.Item>
Export all... <Menubar.Shortcut>⇧⌘S</Menubar.Shortcut> <Download size="16" class="mr-1" /> Export all... <Menubar.Shortcut
>⇧⌘S</Menubar.Shortcut
>
</Menubar.Item> </Menubar.Item>
</Menubar.Content> </Menubar.Content>
</Menubar.Menu> </Menubar.Menu>
@@ -38,14 +61,20 @@
<Menubar.Trigger>Edit</Menubar.Trigger> <Menubar.Trigger>Edit</Menubar.Trigger>
<Menubar.Content> <Menubar.Content>
<Menubar.Item> <Menubar.Item>
Undo <Menubar.Shortcut>⌘Z</Menubar.Shortcut> <Undo2 size="16" class="mr-1" /> Undo <Menubar.Shortcut>⌘Z</Menubar.Shortcut>
</Menubar.Item> </Menubar.Item>
<Menubar.Item> <Menubar.Item>
Redo <Menubar.Shortcut>⇧⌘Z</Menubar.Shortcut> <Redo2 size="16" class="mr-1" /> Redo <Menubar.Shortcut>⇧⌘Z</Menubar.Shortcut>
</Menubar.Item> </Menubar.Item>
<Menubar.Separator /> <Menubar.Separator />
<Menubar.Item>Delete <Menubar.Shortcut>⌘D</Menubar.Shortcut></Menubar.Item> <Menubar.Item
<Menubar.Item>Delete all<Menubar.Shortcut>⇧⌘D</Menubar.Shortcut></Menubar.Item> ><Trash2 size="16" class="mr-1" /> Delete <Menubar.Shortcut>⌘K</Menubar.Shortcut
></Menubar.Item
>
<Menubar.Item class="text-destructive data-[highlighted]:text-destructive"
><Trash2 size="16" class="mr-1" /> Delete all<Menubar.Shortcut>⇧⌘K</Menubar.Shortcut
></Menubar.Item
>
</Menubar.Content> </Menubar.Content>
</Menubar.Menu> </Menubar.Menu>
<Menubar.Menu> <Menubar.Menu>
@@ -97,7 +126,7 @@
href="https://ko-fi.com/gpxstudio" href="https://ko-fi.com/gpxstudio"
target="_blank" target="_blank"
class="cursor-default h-fit rounded-sm" class="cursor-default h-fit rounded-sm"
>Donate <HeartHandshake size="18" class="ml-1" /></Button >Donate <HeartHandshake size="16" class="ml-1" /></Button
> >
</div> </div>
</div> </div>

View File

@@ -1,76 +1,60 @@
<script lang="ts"> <script lang="ts">
import ToolbarItem from './ToolbarItem.svelte'; import ToolbarItem from './ToolbarItem.svelte';
import Fa from 'svelte-fa';
import { import {
faPencil, ArrowRightLeft,
faStopwatch, Group,
faExchange, CalendarClock,
faPlusCircle, Pencil,
faListUl, SquareDashedMousePointer,
faCopy, Ungroup,
faMapMarkerAlt, MapPin,
faCompressAlt, Shrink,
faVectorSquare, Palette,
faEyeSlash, FolderTree
faPalette, } from 'lucide-svelte';
faFolderTree,
faTrashAlt
} from '@fortawesome/free-solid-svg-icons';
</script> </script>
<div class="absolute top-0 bottom-0 left-0 z-10 flex flex-col justify-center pointer-events-none"> <div class="absolute top-0 bottom-0 left-0 z-10 flex flex-col justify-center pointer-events-none">
<div class="flex flex-col p-1 gap-1 bg-background rounded-md pointer-events-auto shadow-md"> <div class="flex flex-col p-1 gap-1 bg-background rounded-md pointer-events-auto shadow-md">
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faPencil} /> <Pencil slot="icon" size="18" />
<span slot="tooltip">Edit the track points</span> <span slot="tooltip">Edit the track points</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faStopwatch} /> <CalendarClock slot="icon" size="18" />
<span slot="tooltip">Change time and speed data</span> <span slot="tooltip">Change time and speed data</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faExchange} /> <ArrowRightLeft slot="icon" size="18" />
<span slot="tooltip">Reverse the order of the track points</span> <span slot="tooltip">Reverse the order of the track points</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faPlusCircle} /> <Group slot="icon" size="18" />
<span slot="tooltip">Merge with another file</span> <span slot="tooltip">Merge with another file</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faListUl} /> <Ungroup slot="icon" size="18" />
<span slot="tooltip">Extract the tracks or track segments to new files</span> <span slot="tooltip">Extract the tracks or track segments to new files</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faCopy} /> <MapPin slot="icon" size="18" />
<span slot="tooltip">Duplicate the file</span>
</ToolbarItem>
<ToolbarItem>
<Fa slot="icon" icon={faMapMarkerAlt} />
<span slot="tooltip">Create a new point of interest</span> <span slot="tooltip">Create a new point of interest</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faCompressAlt} /> <Shrink slot="icon" size="18" />
<span slot="tooltip">Reduce the number of track points</span> <span slot="tooltip">Reduce the number of track points</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faVectorSquare} /> <SquareDashedMousePointer slot="icon" size="18" />
<span slot="tooltip">Clean track points and POIs with a rectangle selection</span> <span slot="tooltip">Clean track points and POIs with a rectangle selection</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faEyeSlash} /> <Palette slot="icon" size="18" />
<span slot="tooltip">Hide/unhide the trace</span>
</ToolbarItem>
<ToolbarItem>
<Fa slot="icon" icon={faPalette} />
<span slot="tooltip">Change the styling of the trace</span> <span slot="tooltip">Change the styling of the trace</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem> <ToolbarItem>
<Fa slot="icon" icon={faFolderTree} /> <FolderTree slot="icon" size="18" />
<span slot="tooltip">Manage the file structure</span> <span slot="tooltip">Manage the file structure</span>
</ToolbarItem> </ToolbarItem>
<ToolbarItem>
<Fa slot="icon" icon={faTrashAlt} />
<span slot="tooltip">Delete the file</span>
</ToolbarItem>
</div> </div>
</div> </div>

View File

@@ -8,8 +8,7 @@
import { Separator } from '$lib/components/ui/separator'; import { Separator } from '$lib/components/ui/separator';
import { ScrollArea } from '$lib/components/ui/scroll-area/index.js'; import { ScrollArea } from '$lib/components/ui/scroll-area/index.js';
import Fa from 'svelte-fa'; import { Layers } from 'lucide-svelte';
import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
import { import {
basemaps, basemaps,
@@ -31,7 +30,7 @@
<div <div
class="flex flex-row justify-center items-center w-[29px] h-[29px] delay-100 transition-[opacity height] duration-0 group-hover:opacity-0 group-hover:h-0 group-hover:delay-0" class="flex flex-row justify-center items-center w-[29px] h-[29px] delay-100 transition-[opacity height] duration-0 group-hover:opacity-0 group-hover:h-0 group-hover:delay-0"
> >
<Fa icon={faLayerGroup} size="1.4x" /> <Layers size="20" />
</div> </div>
<div <div
class="transition-[grid-template-rows grid-template-cols] grid grid-rows-[0fr] grid-cols-[0fr] duration-150 group-hover:grid-rows-[1fr] group-hover:grid-cols-[1fr]" class="transition-[grid-template-rows grid-template-cols] grid grid-rows-[0fr] grid-cols-[0fr] duration-150 group-hover:grid-rows-[1fr] group-hover:grid-cols-[1fr]"

View File

@@ -7,8 +7,7 @@
import * as Sheet from '$lib/components/ui/sheet'; import * as Sheet from '$lib/components/ui/sheet';
import * as Accordion from '$lib/components/ui/accordion'; import * as Accordion from '$lib/components/ui/accordion';
import Fa from 'svelte-fa'; import { Settings } from 'lucide-svelte';
import { faGear } from '@fortawesome/free-solid-svg-icons';
import { import {
basemaps, basemaps,
@@ -22,8 +21,8 @@
<Sheet.Root> <Sheet.Root>
<Sheet.Trigger class="w-full"> <Sheet.Trigger class="w-full">
<Button variant="secondary" class="w-full px-1 py-1.5"> <Button variant="ghost" class="w-full px-1 py-1.5">
<Fa icon={faGear} class="mr-2" /> <Settings size="18" class="mr-2" />
Manage layers Manage layers
</Button> </Button>
</Sheet.Trigger> </Sheet.Trigger>
@@ -31,13 +30,14 @@
<Sheet.Header class="h-full"> <Sheet.Header class="h-full">
<Sheet.Title>Layer settings</Sheet.Title> <Sheet.Title>Layer settings</Sheet.Title>
<Sheet.Description> <Sheet.Description>
Select the map layers you want to show in the interface and adjust their settings. Select the map layers you want to show in the interface, add custom ones, and adjust their
settings.
</Sheet.Description> </Sheet.Description>
<Accordion.Root class="flex flex-col overflow-hidden"> <Accordion.Root class="flex flex-col overflow-hidden">
<Accordion.Item value="item-1" class="flex flex-col overflow-hidden"> <Accordion.Item value="item-1" class="flex flex-col overflow-hidden">
<Accordion.Trigger>Layer selection</Accordion.Trigger> <Accordion.Trigger>Layer selection</Accordion.Trigger>
<Accordion.Content class="grow flex flex-col"> <Accordion.Content class="grow flex flex-col border rounded">
<ScrollArea class="pr-4"> <ScrollArea class="py-2 pr-2">
<LayerTree <LayerTree
layerTree={basemapTree} layerTree={basemapTree}
label="Basemaps" label="Basemaps"
@@ -48,8 +48,8 @@
}} }}
/> />
</ScrollArea> </ScrollArea>
<Separator class="my-2" /> <Separator />
<ScrollArea class="pr-4"> <ScrollArea class="py-2 pr-2">
<LayerTree <LayerTree
layerTree={overlayTree} layerTree={overlayTree}
label="Overlays" label="Overlays"
@@ -63,17 +63,17 @@
</Accordion.Content> </Accordion.Content>
</Accordion.Item> </Accordion.Item>
<Accordion.Item value="item-2"> <Accordion.Item value="item-2">
<Accordion.Trigger>Custom layer</Accordion.Trigger> <Accordion.Trigger>Custom layers</Accordion.Trigger>
<Accordion.Content> <Accordion.Content>
<ScrollArea>TODO custom layer form</ScrollArea> <ScrollArea>TODO custom layer list + new custom layer form</ScrollArea>
</Accordion.Content> </Accordion.Content>
</Accordion.Item> </Accordion.Item>
<Accordion.Item value="item-3"> <Accordion.Item value="item-3">
<Accordion.Trigger>Heatmap settings</Accordion.Trigger> <Accordion.Trigger>Heatmap</Accordion.Trigger>
<Accordion.Content></Accordion.Content> <Accordion.Content></Accordion.Content>
</Accordion.Item> </Accordion.Item>
<Accordion.Item value="item-4"> <Accordion.Item value="item-4">
<Accordion.Trigger>POIs settings</Accordion.Trigger> <Accordion.Trigger>Points of interest</Accordion.Trigger>
<Accordion.Content></Accordion.Content> <Accordion.Content></Accordion.Content>
</Accordion.Item> </Accordion.Item>
</Accordion.Root> </Accordion.Root>

View File

@@ -5,8 +5,7 @@
import * as Collapsible from '$lib/components/ui/collapsible'; import * as Collapsible from '$lib/components/ui/collapsible';
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import Fa from 'svelte-fa'; import { ChevronDown, ChevronUp } from 'lucide-svelte';
import { faChevronDown, faChevronLeft } from '@fortawesome/free-solid-svg-icons';
export let layerTree: LayerTreeType; export let layerTree: LayerTreeType;
export let label: string; export let label: string;
@@ -27,9 +26,9 @@
> >
<span class="mr-2">{label}</span> <span class="mr-2">{label}</span>
{#if open} {#if open}
<Fa icon={faChevronDown} size="xs" /> <ChevronDown size="16" />
{:else} {:else}
<Fa icon={faChevronLeft} size="xs" /> <ChevronUp size="16" />
{/if} {/if}
</Button></Collapsible.Trigger </Button></Collapsible.Trigger
> >

View File

@@ -4,8 +4,7 @@
import { Button } from '$lib/components/ui/button'; import { Button } from '$lib/components/ui/button';
import * as Collapsible from '$lib/components/ui/collapsible'; import * as Collapsible from '$lib/components/ui/collapsible';
import Fa from 'svelte-fa'; import { ChevronDown, ChevronUp } from 'lucide-svelte';
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
import { type LayerTreeType } from '$lib/assets/layers'; import { type LayerTreeType } from '$lib/assets/layers';
@@ -71,9 +70,9 @@
> >
<span class="mr-2">{id}</span> <span class="mr-2">{id}</span>
{#if open[id]} {#if open[id]}
<Fa icon={faChevronUp} size="xs" /> <ChevronUp size="16" />
{:else} {:else}
<Fa icon={faChevronDown} size="xs" /> <ChevronDown size="16" />
{/if} {/if}
</Button></Collapsible.Trigger </Button></Collapsible.Trigger
> >

View File

@@ -14,7 +14,7 @@
</script> </script>
<AccordionPrimitive.Content <AccordionPrimitive.Content
class={cn('overflow-hidden text-sm transition-all pb-4', className)} class={cn('overflow-hidden text-sm transition-all mb-4', className)}
{transition} {transition}
{transitionConfig} {transitionConfig}
{...$$restProps} {...$$restProps}