diff --git a/src/app/components.d.ts b/src/app/components.d.ts index 2bef6d082259dcafb5c742ec5543b073d7485710..df565292d4f5081e553a4cccdba79edd930c4ba8 100644 --- a/src/app/components.d.ts +++ b/src/app/components.d.ts @@ -30,13 +30,14 @@ declare module 'vue' { ImageSizeMenu: typeof import('./../components/entities/image/ImageSizeMenu.vue')['default'] ImageStateMenu: typeof import('./../components/entities/image/ImageStateMenu.vue')['default'] LogoAndLabel: typeof import('./../components/LogoAndLabel.vue')['default'] + page: typeof import('./../modules/Home page.vue')['default'] PageBackgroundMenu: typeof import('./../modules/PageBackgroundMenu.vue')['default'] + PageHeader: typeof import('./../modules/PageHeader.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] SheetPage: typeof import('./../pages/[uuid]/SheetPage.vue')['default'] SpeedDial: typeof import('primevue/speeddial')['default'] - Splitter: typeof import('primevue/splitter')['default'] - SplitterPanel: typeof import('primevue/splitterpanel')['default'] + TelegramSection: typeof import('./../modules/TelegramSection.vue')['default'] TextFontMenu: typeof import('./../components/entities/share/TextFontMenu.vue')['default'] TextItem: typeof import('./../modules/entities/TextItem.vue')['default'] TextMenu: typeof import('./../modules/entities/menu/TextMenu.vue')['default'] diff --git a/src/app/helpers/index.ts b/src/app/helpers/index.ts index 252d449dadb7a715ee7151633fba19996323f007..5bb4a9d0e8ec18bdf214e15982eecd1c8826be0e 100644 --- a/src/app/helpers/index.ts +++ b/src/app/helpers/index.ts @@ -120,25 +120,25 @@ export const getImageSpeedDialSizeBiggerLabelsToRemove = (entity: IImage) => { } if ( initialImageWidth >= 960 || - initialImageHeight >= 960 || + initialImageHeight >= 560 || (initialImageWidth >= 640 && entity.text_position) ) { elementsLabelsToRemove.push('x1.25'); if ( initialImageWidth >= 800 || - initialImageHeight >= 800 || + initialImageHeight >= 467 || (initialImageWidth >= 533 && entity.text_position) ) { elementsLabelsToRemove.push('x1.5'); if ( initialImageWidth >= 685 || - initialImageHeight >= 685 || + initialImageHeight >= 400 || (initialImageWidth >= 457 && entity.text_position) ) { elementsLabelsToRemove.push('x1.75'); if ( initialImageWidth >= 600 || - initialImageHeight >= 600 || + initialImageHeight >= 350 || (initialImageWidth >= 400 && entity.text_position) ) { elementsLabelsToRemove.push('x2'); diff --git a/src/app/main.ts b/src/app/main.ts index b61cec809f84be9d41071d18c73f86a17541de5e..dd3a5c7f283145f238d02269ec0f64910415cc5f 100644 --- a/src/app/main.ts +++ b/src/app/main.ts @@ -6,14 +6,34 @@ import PrimeVue from 'primevue/config'; import App from './App.vue'; import router from './router'; import Aura from '@primevue/themes/aura'; +import { definePreset } from '@primevue/themes'; const app = createApp(App); - +const theme = 'sky'; +const MyPreset = definePreset(Aura, { + semantic: { + primary: { + 50: `{${theme}.50}`, + 100: `{${theme}.100}`, + 200: `{${theme}.200}`, + 300: `{${theme}.300}`, + 400: `{${theme}.400}`, + 500: `{${theme}.500}`, + 600: `{${theme}.600}`, + 700: `{${theme}.700}`, + 800: `{${theme}.800}`, + 900: `{${theme}.900}`, + 950: `{${theme}.950}` + } + } +}); app .use(PrimeVue, { theme: { - preset: Aura, - options: {} + preset: MyPreset, + options: { + // darkModeSelector: '.darkModeToggle' + } } }) .use(createPinia()) diff --git a/src/app/stores/data.ts b/src/app/stores/data.ts index c19d38965f5e4589fc433aab6cc0bc3285193bca..0e3b2e99ba6071d89c9de63bacaf1547b0dcb13d 100644 --- a/src/app/stores/data.ts +++ b/src/app/stores/data.ts @@ -57,6 +57,7 @@ export const useDataStore = defineStore('dataStore', () => { function editHomeEntities(newState: IEntity) { homeEntities.value = newState; + console.log('homeEntities.value', homeEntities.value); } function setHomeEntities(entities: IEntity[]) { diff --git a/src/app/stores/websocket.ts b/src/app/stores/websocket.ts index 6135d337eb3965574beef216398e03d828dc6d04..1cc5d245c0f3676ac48a13dab2a84e50c70db469 100644 --- a/src/app/stores/websocket.ts +++ b/src/app/stores/websocket.ts @@ -122,7 +122,9 @@ export const useWebsocketStore = defineStore('websocketStore', () => { watch([filesBufferLength, homeEntities], () => { if ( - (homeEntities.value.length && filesBufferLength.value === imageEntitiesCount.value) || + (homeEntities.value.length && + filesBufferLength.value === imageEntitiesCount.value && + imageEntitiesCount.value) || (isInitialAddUrlsToImageEntitiesFinished.value && filesBufferLength.value) ) { const entitiesAddedUrls = addUrlsToImageEntities(homeEntities.value); diff --git a/src/components/CreateEntityMenu.vue b/src/components/CreateEntityMenu.vue index 6c5db931fb5d72d46fafd27c9c6d6d2aee02bc5e..e8a699352cf7201e2991258dd49b4bf461fe199b 100644 --- a/src/components/CreateEntityMenu.vue +++ b/src/components/CreateEntityMenu.vue @@ -27,10 +27,16 @@ const addImage = async (files: FileList) => { const buffer = await blob.arrayBuffer(); const { width: windowWidth } = useWindowSize(); const maxWidth = windowWidth.value - 128; + const maxHeight = 700; if (image.width > maxWidth) { - image.height = Math.floor(maxWidth / image.width) * image.height; + image.height = Math.floor((maxWidth / image.width) * image.height); image.width = maxWidth; } + if (image.height > maxHeight) { + image.width = Math.floor((maxHeight / image.height) * image.width); + console.log('image.width', image.width); + image.height = maxHeight; + } emit('createEntity', { entity_type: 'image', entity_uuid: imageUuid, @@ -112,7 +118,7 @@ const speedDialItems = ref([