From 588175d30c3a17bab4a84e6006f7c5f4453483d7 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Tue, 9 Apr 2024 18:46:01 +0200 Subject: [PATCH] toolbar --- website/package-lock.json | 44 +++++++++++ website/package.json | 3 + website/src/lib/components/Menu.svelte | 31 +++++--- website/src/lib/components/Toolbar.svelte | 76 +++++++++++++++++++ website/src/lib/components/ToolbarItem.svelte | 15 ++++ .../src/lib/components/ui/tooltip/index.ts | 15 ++++ .../ui/tooltip/tooltip-content.svelte | 28 +++++++ website/src/routes/+page.svelte | 2 + 8 files changed, 204 insertions(+), 10 deletions(-) create mode 100644 website/src/lib/components/Toolbar.svelte create mode 100644 website/src/lib/components/ToolbarItem.svelte create mode 100644 website/src/lib/components/ui/tooltip/index.ts create mode 100644 website/src/lib/components/ui/tooltip/tooltip-content.svelte diff --git a/website/package-lock.json b/website/package-lock.json index b602feef..9f551a1d 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -8,12 +8,15 @@ "name": "website", "version": "0.0.1", "dependencies": { + "@fortawesome/free-brands-svg-icons": "^6.5.2", + "@fortawesome/free-solid-svg-icons": "^6.5.2", "@maplibre/maplibre-gl-geocoder": "^1.5.0", "bits-ui": "^0.21.2", "clsx": "^2.1.0", "gpx": "file:../gpx", "lucide-svelte": "^0.365.0", "maplibre-gl": "^4.1.2", + "svelte-fa": "^4.0.2", "tailwind-merge": "^2.2.2", "tailwind-variants": "^0.2.1" }, @@ -544,6 +547,39 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, + "node_modules/@fortawesome/fontawesome-common-types": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.2.tgz", + "integrity": "sha512-gBxPg3aVO6J0kpfHNILc+NMhXnqHumFxOmjYCFfOiLZfwhnnfhtsdA2hfJlDnj+8PjAs6kKQPenOTKj3Rf7zHw==", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-brands-svg-icons": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.5.2.tgz", + "integrity": "sha512-zi5FNYdmKLnEc0jc0uuHH17kz/hfYTg4Uei0wMGzcoCL/4d3WM3u1VMc0iGGa31HuhV5i7ZK8ZlTCQrHqRHSGQ==", + "hasInstallScript": true, + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.5.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-solid-svg-icons": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.2.tgz", + "integrity": "sha512-QWFZYXFE7O1Gr1dTIp+D6UcFUF0qElOnZptpi7PBUMylJh+vFmIedVe1Ir6RM1t2tEQLLSV1k7bR4o92M+uqlw==", + "hasInstallScript": true, + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.5.2" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -4352,6 +4388,14 @@ } } }, + "node_modules/svelte-fa": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/svelte-fa/-/svelte-fa-4.0.2.tgz", + "integrity": "sha512-lza8Jfii6jcpMQB73mBStONxaLfZsUS+rKJ/hH6WxsHUd+g68+oHIL9yQTk4a0uY9HQk78T/CPvQnED0msqJfg==", + "peerDependencies": { + "svelte": "^4.0.0" + } + }, "node_modules/svelte-hmr": { "version": "0.15.3", "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", diff --git a/website/package.json b/website/package.json index b7ffe09f..e4229bb1 100644 --- a/website/package.json +++ b/website/package.json @@ -37,12 +37,15 @@ }, "type": "module", "dependencies": { + "@fortawesome/free-brands-svg-icons": "^6.5.2", + "@fortawesome/free-solid-svg-icons": "^6.5.2", "@maplibre/maplibre-gl-geocoder": "^1.5.0", "bits-ui": "^0.21.2", "clsx": "^2.1.0", "gpx": "file:../gpx", "lucide-svelte": "^0.365.0", "maplibre-gl": "^4.1.2", + "svelte-fa": "^4.0.2", "tailwind-merge": "^2.2.2", "tailwind-variants": "^0.2.1" } diff --git a/website/src/lib/components/Menu.svelte b/website/src/lib/components/Menu.svelte index 3c3f7c43..d59b4991 100644 --- a/website/src/lib/components/Menu.svelte +++ b/website/src/lib/components/Menu.svelte @@ -11,9 +11,9 @@
-
- - +
+ + File @@ -86,20 +86,31 @@ -
- +
+ + diff --git a/website/src/lib/components/Toolbar.svelte b/website/src/lib/components/Toolbar.svelte new file mode 100644 index 00000000..2f4092bd --- /dev/null +++ b/website/src/lib/components/Toolbar.svelte @@ -0,0 +1,76 @@ + + +
+
+ + + Edit the track points + + + + Change time and speed data + + + + Reverse the order of the track points + + + + Merge with another file + + + + Extract the tracks or track segments to new files + + + + Duplicate the file + + + + Create a new point of interest + + + + Reduce the number of track points + + + + Clean track points and POIs with a rectangle selection + + + + Hide/unhide the trace + + + + Change the styling of the trace + + + + Manage the file structure + + + + Delete the file + +
+
diff --git a/website/src/lib/components/ToolbarItem.svelte b/website/src/lib/components/ToolbarItem.svelte new file mode 100644 index 00000000..084b1862 --- /dev/null +++ b/website/src/lib/components/ToolbarItem.svelte @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/website/src/lib/components/ui/tooltip/index.ts b/website/src/lib/components/ui/tooltip/index.ts new file mode 100644 index 00000000..7d0444da --- /dev/null +++ b/website/src/lib/components/ui/tooltip/index.ts @@ -0,0 +1,15 @@ +import { Tooltip as TooltipPrimitive } from "bits-ui"; +import Content from "./tooltip-content.svelte"; + +const Root = TooltipPrimitive.Root; +const Trigger = TooltipPrimitive.Trigger; + +export { + Root, + Trigger, + Content, + // + Root as Tooltip, + Content as TooltipContent, + Trigger as TooltipTrigger, +}; diff --git a/website/src/lib/components/ui/tooltip/tooltip-content.svelte b/website/src/lib/components/ui/tooltip/tooltip-content.svelte new file mode 100644 index 00000000..3c00a4e9 --- /dev/null +++ b/website/src/lib/components/ui/tooltip/tooltip-content.svelte @@ -0,0 +1,28 @@ + + + + + diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index c187dd5c..0205fa64 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -1,11 +1,13 @@
+
Test