From e301761fc8d71c8360731cf07dc25db23232d361 Mon Sep 17 00:00:00 2001 From: andrepat0 Date: Fri, 18 Oct 2024 09:31:21 +0200 Subject: [PATCH] feat: removed scroll beahviour for ZOOMED FULL BODY --- src/components/layouts/ZoomedFullBody.tsx | 11 ++++- src/components/layouts/zoomed-full-body.css | 2 +- src/context/visemeContext.tsx | 4 +- src/index.stories.tsx | 47 +++++++++++++++++++-- 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/components/layouts/ZoomedFullBody.tsx b/src/components/layouts/ZoomedFullBody.tsx index 0d1f268..77608e4 100644 --- a/src/components/layouts/ZoomedFullBody.tsx +++ b/src/components/layouts/ZoomedFullBody.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import Spin from '../ui/Spin'; import { LayoutProps } from '../MemoriWidget/MemoriWidget'; @@ -21,6 +21,15 @@ const ZoomedFullBodyLayout: React.FC = ({ loading = false, poweredBy, }) => { + + useEffect(() => { + document.body.style.overflow = 'hidden'; + return () => { + document.body.style.overflow = ''; + }; + }, []); + + return ( <> {integrationStyle} diff --git a/src/components/layouts/zoomed-full-body.css b/src/components/layouts/zoomed-full-body.css index e848288..ff4c052 100644 --- a/src/components/layouts/zoomed-full-body.css +++ b/src/components/layouts/zoomed-full-body.css @@ -12,7 +12,7 @@ } .memori--grid-column--zoomed-full-body { - max-height: calc(100% - 80px) !important; + max-height: calc(100% - 110px) !important; } .memori.memori-widget.memori-layout-zoomed_full_body .memori--grid { diff --git a/src/context/visemeContext.tsx b/src/context/visemeContext.tsx index b85f181..a2b06f7 100644 --- a/src/context/visemeContext.tsx +++ b/src/context/visemeContext.tsx @@ -55,8 +55,8 @@ const VISEME_MAP: { [key: number]: string } = { const DEFAULT_VISEME_DURATION = 0.04; //0; // Reduced from 0.4 for smoother transitions const VISEME_OVERLAP = 0.02; // Slightly increased from 0.04 for more overlap const SMOOTHING_FACTOR = 0.35; // New constant for weight smoothing -const TIME_OFFSET = -0.02; // Adjust this value as needed (in seconds) -const PRELOAD_TIME = 0.5; // Preload visemes 0.5 seconds in advance +const TIME_OFFSET = 0; // Adjust this value as needed (in seconds) +const PRELOAD_TIME = 1; // Preload visemes 0.5 seconds in advance export const VisemeProvider: React.FC<{ children: React.ReactNode }> = ({ children, diff --git a/src/index.stories.tsx b/src/index.stories.tsx index c07a78b..a741763 100644 --- a/src/index.stories.tsx +++ b/src/index.stories.tsx @@ -28,12 +28,25 @@ export const Anonymous = Template.bind({}); Anonymous.args = { ownerUserName: 'nzambello', memoriName: 'Nicola', - tenantID: 'aisuru.com', + tenantID: 'www.aisuru.com', + engineURL: 'https://engine.memori.ai', apiURL: 'https://backend.memori.ai', baseURL: 'https://www.aisuru.com', - uiLang: 'it', - showShare: true, - showSettings: true, + uiLang: 'IT', + spokenLang: 'IT', + layout: 'ZOOMED_FULL_BODY', + showInstruct: 'false', + showSettings: 'true', + showClear: 'false', + showAIicon: 'true', + showWhyThisAnswer: 'true', + showTypingText: 'false', + showOnlyLastMessages: 'false', + showTranslationOriginal: 'false', + showCopyButton: 'false', + showShare: 'true', + showLogin: 'false', + enableAudio: 'true', }; export const Localhost = Template.bind({}); @@ -138,6 +151,32 @@ GiovannaProva.args = { initialQuestion: 'inizio simulazione', }; +export const NunzioFiore = Template.bind({}); +NunzioFiore.args = { + ownerUserName: 'nunzio.fiore', + memoriName: 'Nunzio', + tenantID: 'www.aisuru.com', + engineURL: 'https://engine.memori.ai', + apiURL: 'https://backend.memori.ai', + baseURL: 'https://www.aisuru.com', + uiLang: 'IT', + spokenLang: 'IT', + layout: 'ZOOMED_FULL_BODY', + showInstruct: 'false', + showSettings: 'true', + showClear: 'false', + showAIicon: 'true', + showWhyThisAnswer: 'true', + showTypingText: 'false', + showOnlyLastMessages: 'false', + showTranslationOriginal: 'false', + showCopyButton: 'false', + showShare: 'true', + showLogin: 'false', + enableAudio: 'true', +}; + + const TemplateWithBatchButton: Story = args => (