diff --git a/lib/api/quizRelase.ts b/lib/api/quizRelase.ts index c576894..09a1869 100644 --- a/lib/api/quizRelase.ts +++ b/lib/api/quizRelase.ts @@ -78,7 +78,7 @@ export async function getData(quizId: string): Promise<{ error?: AxiosError; }> { try { - const { data, headers } = await axios(domain + `/answer/settings${window.location.search}`, { + const { data, headers } = await axios(domain + `/answer/v1.0.0/settings${window.location.search}`, { method: "POST", headers: { "X-Sessionkey": SESSIONS, diff --git a/lib/utils/defineDomain.ts b/lib/utils/defineDomain.ts index b331d81..3086db4 100644 --- a/lib/utils/defineDomain.ts +++ b/lib/utils/defineDomain.ts @@ -5,10 +5,9 @@ let domain = "https://hbpn.link"; const currentDomain = location.hostname; +//туризм больше не в исключениях if ( currentDomain === "s.hbpn.link" || - //Исключение - туризм. Он на стейджинговом квизе и на чужом для публикации домене - currentDomain === "tourism.pena.digital" || currentDomain.includes("localhost") || currentDomain.includes("127.0.0.1") ) diff --git a/src/widgets/banner/QuizBanner.tsx b/src/widgets/banner/QuizBanner.tsx index e65b43a..0f17ef7 100644 --- a/src/widgets/banner/QuizBanner.tsx +++ b/src/widgets/banner/QuizBanner.tsx @@ -7,6 +7,7 @@ import { createPortal } from "react-dom"; import BannerIcon from "../shared/BannerIcon"; import QuizDialog from "../shared/QuizDialog"; import RunningStripe from "../shared/RunningStripe"; +import { colorArrayToHex, darkenColor, parseColor } from "../shared/colorUtils"; import { useAutoOpenTimer } from "../shared/useAutoOpenTimer"; const PADDING = 10; @@ -86,6 +87,12 @@ export default function QuizBanner({ const isQuizCompleted = quizData.settings.cfg.antifraud ? quizData.recentlyCompleted : false; const showButtonFlash = isQuizCompleted && isFlashEnabled; + let hoverBackgroundColor = buttonBackgroundColor; + if (buttonBackgroundColor) { + const color = parseColor(buttonBackgroundColor); + if (color) hoverBackgroundColor = colorArrayToHex(darkenColor(color, 0.7)); + } + return createPortal( @@ -154,6 +161,9 @@ export default function QuizBanner({ backgroundColor: buttonBackgroundColor, borderRadius: rounded && !bannerFullWidth ? "8px" : 0, justifyContent: "start", + ":hover": { + backgroundColor: hoverBackgroundColor, + }, }, withShadow && { boxShadow: "0px 0px 12px 0px rgba(0, 0, 0, 0.7)", diff --git a/src/widgets/button/OpenQuizButton.tsx b/src/widgets/button/OpenQuizButton.tsx index 1e8f202..cbd6690 100644 --- a/src/widgets/button/OpenQuizButton.tsx +++ b/src/widgets/button/OpenQuizButton.tsx @@ -5,6 +5,7 @@ import { Button, ThemeProvider, useMediaQuery } from "@mui/material"; import { useEffect, useRef, useState } from "react"; import QuizDialog from "../shared/QuizDialog"; import RunningStripe from "../shared/RunningStripe"; +import { colorArrayToHex, darkenColor, parseColor } from "../shared/colorUtils"; export default function OpenQuizButton({ quizId, @@ -75,6 +76,12 @@ export default function OpenQuizButton({ const isQuizCompleted = quizData.settings.cfg.antifraud ? quizData.recentlyCompleted : false; const showButtonFlash = isQuizCompleted && isFlashEnabled; + let hoverBackgroundColor = buttonBackgroundColor; + if (buttonBackgroundColor) { + const color = parseColor(buttonBackgroundColor); + if (color) hoverBackgroundColor = colorArrayToHex(darkenColor(color, 0.7)); + } + return (