diff --git a/index.html b/index.html index f815781..dcf956b 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ -
+
diff --git a/src/App.vue b/src/App.vue index 6e47dee..7f3aa80 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ diff --git a/src/components/TreeNav.vue b/src/components/TreeNav.vue index 0a32ea3..1cd171d 100644 --- a/src/components/TreeNav.vue +++ b/src/components/TreeNav.vue @@ -5,20 +5,33 @@ import { filterToTreeNode } from '../services/filter'; import * as A from 'fp-ts/lib/Array'; import { pipe } from 'fp-ts/function' import { Tree } from 'primevue' +import { match } from 'ts-pattern'; const props = defineProps<{ filters: Filter[] }>() -const nodes = computed(() => pipe( - props.filters, - A.map(filterToTreeNode), -)) +const nodes = computed(() => { + return pipe( + props.filters, + A.map(filterToTreeNode), + ) +}) const selectedKey = ref() + +function nodeIcon(filter: Filter): string { + const icon = match(filter) + .with({ type: 'leaf' }, (f) => f.show ? "eye" : "eye-slash") + .with({ type: 'group' }, () => "folder") + .exhaustive() + return `p-tree-node-icon pi pi-fw pi-${icon}`; +} diff --git a/src/main.ts b/src/main.ts index 076d25e..bae096e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,7 +2,6 @@ import PrimeVue from 'primevue/config' import './style.css' import './assets/tailwind.css' import 'primeicons/primeicons.css' -import './base.css' import { createApp } from 'vue' import { createPinia } from 'pinia' diff --git a/src/models/index.ts b/src/models/index.ts index 1a8935c..511393e 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -26,8 +26,7 @@ export type ItemClass = any; // Replace with actual type definition export type ItemBaseType = any; // Replace with actual type definition export type Op = any; // Replace with actual type definition export type Level = RangedNumber<1, 100>; // Replace with actual type definition -export type ItemRarity = 'Normal' | 'Magic' | 'Rare' | 'Unique'; // Replace with actual type definition -export type Color = any; // Replace with actual type definition +export type ItemRarity = string; // Replace with actual type definition export type GameColor = any; // Replace with actual type definition export type MinimapIconShape = any; // Replace with actual type definition @@ -37,26 +36,32 @@ export interface RangedNumber { max: U; } +export interface Color { + r: number, + g: number, + b: number +} + export interface FilterRule { - class?: ItemClass[]; - base_type?: ItemBaseType[]; - area_level?: [Op, Level]; - drop_level?: [Op, Level]; - item_level?: [Op, Level]; - rarity?: [Op, ItemRarity]; - sockets?: [Op, number]; - quality?: [Op, number]; - stack_size?: [Op, number]; + class?: string[]; // + base_type?: string[]; // + area_level?: [string, number]; // + drop_level?: [string, number]; // + item_level?: [string, number]; // + rarity?: [string, string]; // + sockets?: [string, number]; // + quality?: [string, number]; // + stack_size?: [string, number]; // // waystones - waystone_tier?: [Op, RangedNumber<1, 16>]; + waystone_tier?: [string, number]; // // effects - set_font_size?: RangedNumber<1, 45>; - set_text_color?: Color; - set_border_color?: Color; - set_background_color?: Color; - play_alert_sound?: [RangedNumber<1, 16>, RangedNumber<0, 300>]; - play_effect?: GameColor; - minimap_icon?: [RangedNumber<0, 2>, GameColor, MinimapIconShape]; + set_font_size?: number; // + set_text_color?: Color;// + set_border_color?: Color;// + set_background_color?: Color;// + play_alert_sound?: [number, number];// + play_effect?: string;// + minimap_icon?: [number, string, string]; // } diff --git a/src/services/filter.ts b/src/services/filter.ts index 33a9d19..cdd0323 100644 --- a/src/services/filter.ts +++ b/src/services/filter.ts @@ -8,16 +8,11 @@ export function filterToTreeNode(filter: Filter): TreeNode { .with({ type: 'group' }, (filter) => filter.filters.map(filterToTreeNode)) .exhaustive() - let icon = match(filter) - .with({ type: 'leaf' }, () => "file") - .with({ type: 'group' }, () => "folder") - .exhaustive() return { key: filter.id, data: filter, - label: filter.id, + label: filter.name || filter.id, children, - icon: `pi pi-${icon}` } } diff --git a/src/style.css b/src/style.css index 25523aa..c2b623d 100644 --- a/src/style.css +++ b/src/style.css @@ -72,3 +72,19 @@ --p-text-hover-muted-color: var(--p-surface-300); } /* } */ + +body { + margin: 0px; + min-height: 100%; + overflow-x: hidden; + overflow-y: auto; + background-color: var(--p-primary-contrast-color); + font-weight: normal; + color: var(--p-text-color); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.p-colorpicker-panel { + z-index: 10 !important; +}