Merge branch 'staging' into 'main'

Staging

See merge request frontend/squzanswerer!183
This commit is contained in:
Nastya 2024-12-28 23:27:07 +00:00
commit da25702a76
22 changed files with 241 additions and 31 deletions

@ -24,9 +24,6 @@ import "moment/dist/locale/ru";
moment.locale("ru"); moment.locale("ru");
const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText;
console.log(localeText);
console.log(moment);
type Props = { type Props = {
quizSettings?: QuizSettings; quizSettings?: QuizSettings;
quizId: string; quizId: string;
@ -128,7 +125,6 @@ function QuizAnswererInner({
</QuizViewContext.Provider> </QuizViewContext.Provider>
); );
} }
export default function QuizAnswerer(props: Props) { export default function QuizAnswerer(props: Props) {
return ( return (
<HelmetProvider> <HelmetProvider>
@ -142,6 +138,19 @@ export default function QuizAnswerer(props: Props) {
preventDuplicate={true} preventDuplicate={true}
style={{ backgroundColor: lightTheme.palette.brightPurple.main }} style={{ backgroundColor: lightTheme.palette.brightPurple.main }}
> >
<Box
id="hideoverlay"
sx={{
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
background: "black",
zIndex: 999,
opacity: 0,
}}
/>
<QuizAnswererInner {...props} /> <QuizAnswererInner {...props} />
</SnackbarProvider> </SnackbarProvider>
</ThemeProvider> </ThemeProvider>

@ -42,7 +42,7 @@ export const Question = ({
}: Props) => { }: Props) => {
const theme = useTheme(); const theme = useTheme();
const { settings, show_badge, quizId } = useQuizSettings(); const { settings, show_badge, quizId } = useQuizSettings();
console.log(theme);
return ( return (
<Box <Box
sx={{ sx={{

@ -183,6 +183,7 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
}} }}
onClick={(event) => event.preventDefault()}
> >
<img <img
alt="resultImage" alt="resultImage"

@ -87,6 +87,7 @@ const StandartLayout = ({ alignType, quizHeaderBlock, quizMainBlock, backgroundB
justifyContent: "center", justifyContent: "center",
"& > img": { width: "100%", borderRadius: "12px" }, "& > img": { width: "100%", borderRadius: "12px" },
}} }}
onClick={(event) => event.preventDefault()}
> >
{backgroundBlock} {backgroundBlock}
</Box> </Box>
@ -204,6 +205,7 @@ const CenteredLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock }: Lay
justifyContent: "center", justifyContent: "center",
"& > img": { width: "100%", borderRadius: "12px" }, "& > img": { width: "100%", borderRadius: "12px" },
}} }}
onClick={(event) => event.preventDefault()}
> >
{backgroundBlock} {backgroundBlock}
</Box> </Box>

@ -73,6 +73,7 @@ const StandartMobileLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock
borderRadius: "12px", borderRadius: "12px",
}, },
}} }}
onClick={(event) => event.preventDefault()}
> >
{backgroundBlock} {backgroundBlock}
</Box> </Box>
@ -154,6 +155,7 @@ const ExpandedMobileLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock
minHeight: "100%", minHeight: "100%",
}, },
}} }}
onClick={(event) => event.preventDefault()}
> >
{backgroundBlock} {backgroundBlock}
</Box> </Box>
@ -205,6 +207,7 @@ const CenteredMobileLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock
overflow: "hidden", overflow: "hidden",
"& > img": { width: "100%", borderRadius: "12px" }, "& > img": { width: "100%", borderRadius: "12px" },
}} }}
onClick={(event) => event.preventDefault()}
> >
{backgroundBlock} {backgroundBlock}
</Box> </Box>

@ -105,6 +105,7 @@ export const StartPageViewPublication = () => {
? "center" ? "center"
: undefined, : undefined,
}} }}
onClick={(event) => event.preventDefault()}
> >
{settings.cfg.startpage.logo && ( {settings.cfg.startpage.logo && (
<img <img
@ -220,6 +221,7 @@ export const StartPageViewPublication = () => {
color: settings.cfg.startpageType === "expanded" ? "white" : "black", color: settings.cfg.startpageType === "expanded" ? "white" : "black",
}} }}
onClick={(event) => event.preventDefault()}
> >
<QuizPreviewLayoutByType <QuizPreviewLayoutByType
quizHeaderBlock={quizHeaderBlock} quizHeaderBlock={quizHeaderBlock}

@ -18,6 +18,7 @@ import { ResultForm } from "./ResultForm";
import { StartPageViewPublication } from "./StartPageViewPublication"; import { StartPageViewPublication } from "./StartPageViewPublication";
import NextButton from "./tools/NextButton"; import NextButton from "./tools/NextButton";
import PrevButton from "./tools/PrevButton"; import PrevButton from "./tools/PrevButton";
import unscreen from "@/ui_kit/unscreen";
export default function ViewPublicationPage() { export default function ViewPublicationPage() {
const { settings, recentlyCompleted, quizId, preview, changeFaviconAndTitle, questions } = useQuizSettings(); const { settings, recentlyCompleted, quizId, preview, changeFaviconAndTitle, questions } = useQuizSettings();
@ -38,6 +39,16 @@ export default function ViewPublicationPage() {
useYandexMetrics(settings?.cfg?.yandexMetricsNumber, preview); useYandexMetrics(settings?.cfg?.yandexMetricsNumber, preview);
useVKMetrics(settings?.cfg?.vkMetricsNumber, preview); useVKMetrics(settings?.cfg?.vkMetricsNumber, preview);
useEffect(() => {
const root = document.getElementById("root");
const overlay = document.getElementById("hideoverlay");
if (root !== null && overlay !== null && settings.cfg?.isUnSc) {
overlay.style.cssText = "pointerEvents = auto;";
unscreen(overlay, root);
}
}, []);
useEffect( useEffect(
function setFaviconAndTitle() { function setFaviconAndTitle() {
if (!changeFaviconAndTitle) return; if (!changeFaviconAndTitle) return;

@ -11,7 +11,7 @@ import { useRootContainerSize } from "@/contexts/RootContainerWidthContext";
type DateProps = { type DateProps = {
currentQuestion: QuizQuestionDate; currentQuestion: QuizQuestionDate;
}; };
console.log(moment.locale());
export default ({ currentQuestion }: DateProps) => { export default ({ currentQuestion }: DateProps) => {
const theme = useTheme(); const theme = useTheme();
const isMobile = useRootContainerSize() < 690; const isMobile = useRootContainerSize() < 690;

@ -187,25 +187,25 @@ export const EmojiVariant = ({
<FormControlLabel <FormControlLabel
key={variant.id} key={variant.id}
sx={{ sx={{
textAlign: "center",
color: theme.palette.text.primary,
margin: 0, margin: 0,
padding: "15px", padding: "15px",
color: theme.palette.text.primary,
display: "flex", display: "flex",
gap: "10px",
alignItems: variant.answer.length <= 60 ? "center" : "flex-start", alignItems: variant.answer.length <= 60 ? "center" : "flex-start",
position: "relative", position: "relative",
height: "80px", height: "80px",
overflow: "auto",
justifyContent: "center", justifyContent: "center",
"& .MuiFormControlLabel-label": { "& .MuiFormControlLabel-label": {
wordBreak: "break-word", wordBreak: "break-word",
height: variant.answer.length <= 60 ? undefined : "60px", height: variant.answer.length <= 60 ? "100%" : "60px",
overflow: "auto", overflow: "auto",
"&::-webkit-scrollbar": { width: "4px" }, "&::-webkit-scrollbar": { width: "4px" },
"&::-webkit-scrollbar-thumb": { "&::-webkit-scrollbar-thumb": {
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
}, },
scrollbarColor: theme.palette.primary.main, scrollbarColor: theme.palette.primary.main,
width: "100%",
}, },
"& .MuiFormControlLabel-label.Mui-disabled": { "& .MuiFormControlLabel-label.Mui-disabled": {
color: theme.palette.text.primary, color: theme.palette.text.primary,

@ -28,7 +28,11 @@ export const File = ({ currentQuestion }: FileProps) => {
return ( return (
<Box> <Box>
<Typography variant="h5" color={theme.palette.text.primary} sx={{ wordBreak: "break-word" }}> <Typography
variant="h5"
color={theme.palette.text.primary}
sx={{ wordBreak: "break-word" }}
>
{currentQuestion.title} {currentQuestion.title}
</Typography> </Typography>
<Box <Box
@ -39,9 +43,13 @@ export const File = ({ currentQuestion }: FileProps) => {
marginTop: "20px", marginTop: "20px",
maxWidth: answer?.split("|")[0] ? "640px" : "600px", maxWidth: answer?.split("|")[0] ? "640px" : "600px",
}} }}
onClick={(event) => event.preventDefault()}
> >
{answer?.split("|")[0] ? ( {answer?.split("|")[0] ? (
<UploadedFile currentQuestion={currentQuestion} setIsSending={setIsSending} /> <UploadedFile
currentQuestion={currentQuestion}
setIsSending={setIsSending}
/>
) : ( ) : (
<UploadFile <UploadFile
currentQuestion={currentQuestion} currentQuestion={currentQuestion}
@ -51,7 +59,11 @@ export const File = ({ currentQuestion }: FileProps) => {
/> />
)} )}
{answer && currentQuestion.content.type === "picture" && ( {answer && currentQuestion.content.type === "picture" && (
<img src={answer.split("|")[1]} style={{ marginTop: "15px", maxWidth: "300px", maxHeight: "300px" }} alt="" /> <img
src={answer.split("|")[1]}
style={{ marginTop: "15px", maxWidth: "300px", maxHeight: "300px" }}
alt=""
/>
)} )}
{answer && currentQuestion.content.type === "video" && ( {answer && currentQuestion.content.type === "video" && (
<video <video
@ -65,7 +77,10 @@ export const File = ({ currentQuestion }: FileProps) => {
/> />
)} )}
</Box> </Box>
<Modal open={modalWarningType !== null} onClose={() => setModalWarningType(null)}> <Modal
open={modalWarningType !== null}
onClose={() => setModalWarningType(null)}
>
<Box <Box
sx={{ sx={{
position: "absolute", position: "absolute",

@ -6,7 +6,7 @@ import { useQuizViewStore } from "@stores/quizView";
import RadioCheck from "@ui_kit/RadioCheck"; import RadioCheck from "@ui_kit/RadioCheck";
import RadioIcon from "@ui_kit/RadioIcon"; import RadioIcon from "@ui_kit/RadioIcon";
import { quizThemes } from "@utils/themes/Publication/themePublication"; import { quizThemes } from "@utils/themes/Publication/themePublication";
import { useMemo, type MouseEvent } from "react"; import { useMemo, type MouseEvent, useRef, useEffect } from "react";
import { useRootContainerSize } from "@contexts/RootContainerWidthContext"; import { useRootContainerSize } from "@contexts/RootContainerWidthContext";
type ImagesProps = { type ImagesProps = {
@ -99,6 +99,9 @@ export const ImageVariant = ({
const isMobile = useRootContainerSize() < 450; const isMobile = useRootContainerSize() < 450;
const isTablet = useRootContainerSize() < 850; const isTablet = useRootContainerSize() < 850;
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const containerCanvasRef = useRef<HTMLDivElement | null>(null);
const onVariantClick = async (event: MouseEvent<HTMLDivElement>) => { const onVariantClick = async (event: MouseEvent<HTMLDivElement>) => {
event.preventDefault(); event.preventDefault();
@ -130,6 +133,23 @@ export const ImageVariant = ({
} }
}, []); }, []);
useEffect(() => {
if (canvasRef.current !== null) {
const canvas = canvasRef.current;
const ctx = canvas.getContext("2d");
if (ctx !== null) {
const img = new Image();
img.src = choiceImgUrl;
img.onload = () => {
canvas.width = img.width;
canvas.height = img.height;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
};
}
}
}, []);
return ( return (
<Box <Box
sx={{ sx={{
@ -151,9 +171,8 @@ export const ImageVariant = ({
<Box sx={{ display: "flex", alignItems: "center", gap: "10px" }}> <Box sx={{ display: "flex", alignItems: "center", gap: "10px" }}>
<Box sx={{ width: "100%", height: "300px" }}> <Box sx={{ width: "100%", height: "300px" }}>
{variant.extendedText && ( {variant.extendedText && (
<img <canvas
src={choiceImgUrl} ref={canvasRef}
alt=""
style={{ style={{
display: "block", display: "block",
width: "100%", width: "100%",
@ -162,6 +181,18 @@ export const ImageVariant = ({
borderRadius: "12px 12px 0 0", borderRadius: "12px 12px 0 0",
}} }}
/> />
// <img
// src={choiceImgUrl}
// alt=""
// style={{
// display: "block",
// width: "100%",
// height: "100%",
// objectFit: "cover",
// borderRadius: "12px 12px 0 0",
// }}
// />
)} )}
</Box> </Box>
</Box> </Box>
@ -209,7 +240,6 @@ export const ImageVariant = ({
control={ control={
isMulti ? ( isMulti ? (
<Checkbox <Checkbox
id="cock"
checked={!!answer?.includes(variant.id)} checked={!!answer?.includes(variant.id)}
checkedIcon={<RadioCheck color={theme.palette.primary.main} />} checkedIcon={<RadioCheck color={theme.palette.primary.main} />}
icon={<RadioIcon />} icon={<RadioIcon />}

@ -21,7 +21,10 @@ export const Page = ({ currentQuestion }: PageProps) => {
> >
{currentQuestion.title} {currentQuestion.title}
</Typography> </Typography>
<Typography color={theme.palette.text.primary} sx={{ wordBreak: "break-word" }}> <Typography
color={theme.palette.text.primary}
sx={{ wordBreak: "break-word" }}
>
{currentQuestion.content.text} {currentQuestion.content.text}
</Typography> </Typography>
<Box <Box
@ -40,6 +43,7 @@ export const Page = ({ currentQuestion }: PageProps) => {
border: "1px solid #9A9AAF", border: "1px solid #9A9AAF",
overflow: "hidden", overflow: "hidden",
}} }}
onClick={(event) => event.preventDefault()}
> >
<img <img
key={currentQuestion.id} key={currentQuestion.id}

@ -37,6 +37,7 @@ export const TextNormal = ({ currentQuestion, answer }: TextNormalProps) => {
return currentQuestion.content.back; return currentQuestion.content.back;
} }
}, [currentQuestion]); }, [currentQuestion]);
let isCrutch23022025 = window.location.pathname === "/bf8cae3a-e150-479d-befa-7f264087b223";
return ( return (
<Box> <Box>
<Typography <Typography
@ -51,7 +52,7 @@ export const TextNormal = ({ currentQuestion, answer }: TextNormalProps) => {
display: "flex", display: "flex",
width: "100%", width: "100%",
marginTop: "20px", marginTop: "20px",
flexDirection: isMobile ? "column-reverse" : undefined, flexDirection: isCrutch23022025 ? "column" : isMobile ? "column-reverse" : undefined,
alignItems: "center", alignItems: "center",
}} }}
> >
@ -74,11 +75,12 @@ export const TextNormal = ({ currentQuestion, answer }: TextNormalProps) => {
{choiceImgUrlQuestion && choiceImgUrlQuestion !== " " && choiceImgUrlQuestion !== null && ( {choiceImgUrlQuestion && choiceImgUrlQuestion !== " " && choiceImgUrlQuestion !== null && (
<Box <Box
sx={{ sx={{
maxWidth: "400px", maxWidth: isCrutch23022025 ? undefined : "400px",
width: "100%", width: isCrutch23022025 ? "auto" : "100%",
height: "300px", height: isCrutch23022025 ? "auto" : "300px",
margin: "15px", margin: "15px",
}} }}
onClick={(event) => event.preventDefault()}
> >
<img <img
key={currentQuestion.id} key={currentQuestion.id}

@ -81,7 +81,10 @@ export const TextSpecial = ({ currentQuestion, answer, stepNumber }: TextSpecial
{currentQuestion.title} {currentQuestion.title}
</Typography> </Typography>
{isHorizontal && currentQuestion.content.back && currentQuestion.content.back !== " " && ( {isHorizontal && currentQuestion.content.back && currentQuestion.content.back !== " " && (
<Box sx={{ margin: "30px", width: "50vw", maxHeight: "550px" }}> <Box
sx={{ margin: "30px", width: "50vw", maxHeight: "550px" }}
onClick={(event) => event.preventDefault()}
>
<img <img
key={currentQuestion.id} key={currentQuestion.id}
src={currentQuestion.content.back} src={currentQuestion.content.back}
@ -119,7 +122,10 @@ export const TextSpecial = ({ currentQuestion, answer, stepNumber }: TextSpecial
} }
</Box> </Box>
{!isHorizontal && currentQuestion.content.back && currentQuestion.content.back !== " " && ( {!isHorizontal && currentQuestion.content.back && currentQuestion.content.back !== " " && (
<Box sx={{ margin: "15px", width: "40vw" }}> <Box
sx={{ margin: "15px", width: "40vw" }}
onClick={(event) => event.preventDefault()}
>
<img <img
key={currentQuestion.id} key={currentQuestion.id}
src={currentQuestion.content.back} src={currentQuestion.content.back}

@ -32,7 +32,7 @@ const OwnInput = ({ questionId, variant, largeCheck, ownPlaceholder }: OwnInputP
const { updateOwnVariant } = useQuizViewStore((state) => state); const { updateOwnVariant } = useQuizViewStore((state) => state);
const ownAnswer = ownVariants[ownVariants.findIndex((v) => v.id === variant.id)]?.variant.answer || ""; const ownAnswer = ownVariants[ownVariants.findIndex((v) => v.id === variant.id)]?.variant.answer || "";
console.log(theme);
return largeCheck ? ( return largeCheck ? (
<TextareaAutosize <TextareaAutosize
placeholder={ownPlaceholder || "|"} placeholder={ownPlaceholder || "|"}

@ -13,6 +13,35 @@ type VariantProps = {
currentQuestion: QuizQuestionVariant; currentQuestion: QuizQuestionVariant;
}; };
// 23.02.2025
const crutchlist = {
115048: { x: 629, y: 491 },
115101: { x: 979, y: 980 },
115109: { x: 746, y: 745 },
115122: { x: 959, y: 960 },
115132: { x: 541, y: 541 },
115142: { x: 834, y: 544 },
115178: { x: 1127, y: 1127 },
115191: { x: 1106, y: 1106 },
115207: { x: 905, y: 906 },
115254: { x: 637, y: 637 },
115270: { x: 702, y: 703 },
115287: { x: 714, y: 715 },
115329: { x: 915, y: 916 },
115348: { x: 700, y: 701 },
115368: { x: 400, y: 300 },
115389: { x: 839, y: 840 },
115411: { x: 612, y: 610 },
115434: { x: 474, y: 473 },
115462: { x: 385, y: 385 },
115487: { x: 676, y: 677 },
115515: { x: 341, y: 341 },
115547: { x: 402, y: 403 },
115575: { x: 502, y: 503 },
115612: { x: 400, y: 300 },
115642: { x: 603, y: 603 },
};
export const Variant = ({ currentQuestion }: VariantProps) => { export const Variant = ({ currentQuestion }: VariantProps) => {
const theme = useTheme(); const theme = useTheme();
const isMobile = useRootContainerSize() < 650; const isMobile = useRootContainerSize() < 650;
@ -26,6 +55,8 @@ export const Variant = ({ currentQuestion }: VariantProps) => {
const Group = currentQuestion.content.multi ? FormGroup : RadioGroup; const Group = currentQuestion.content.multi ? FormGroup : RadioGroup;
//let isCrutch23022025Question = isCrutch23022025 && crutchlist.hasOwnProperty(currentQuestion.id)
useEffect(() => { useEffect(() => {
if (!ownVariant) { if (!ownVariant) {
updateOwnVariant(currentQuestion.id, ""); updateOwnVariant(currentQuestion.id, "");
@ -55,6 +86,7 @@ export const Variant = ({ currentQuestion }: VariantProps) => {
{currentQuestion.title} {currentQuestion.title}
</Typography> </Typography>
<Box <Box
id="batya"
sx={{ sx={{
display: "flex", display: "flex",
gap: "20px", gap: "20px",
@ -105,7 +137,14 @@ export const Variant = ({ currentQuestion }: VariantProps) => {
</Box> </Box>
</Group> </Group>
{choiceImgUrlQuestion && choiceImgUrlQuestion !== " " && choiceImgUrlQuestion !== null && ( {choiceImgUrlQuestion && choiceImgUrlQuestion !== " " && choiceImgUrlQuestion !== null && (
<Box sx={{ maxWidth: "400px", width: "100%", height: "300px" }}> <Box
sx={{
maxWidth: "400px",
width: "100%",
height: "300px",
}}
onClick={(event) => event.preventDefault()}
>
<img <img
key={currentQuestion.id} key={currentQuestion.id}
src={choiceImgUrlQuestion} src={choiceImgUrlQuestion}

@ -134,6 +134,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => {
color: theme.palette.text.primary, color: theme.palette.text.primary,
textAlign: "center", textAlign: "center",
}} }}
onClick={(event) => event.preventDefault()}
> >
{answer ? ( {answer ? (
choiceImgUrlAnswer ? ( choiceImgUrlAnswer ? (

@ -61,6 +61,7 @@ export type QuizSettings = {
}; };
export interface QuizConfig { export interface QuizConfig {
isUnSc?: boolean;
spec: undefined | true; spec: undefined | true;
type: QuizType; type: QuizType;
noStartPage: boolean; noStartPage: boolean;

@ -6,6 +6,7 @@ export interface SideWidgetComponentProps {
dialogDimensions?: { width: string; height: string }; dialogDimensions?: { width: string; height: string };
fullScreen?: boolean; fullScreen?: boolean;
buttonFlash?: boolean; buttonFlash?: boolean;
buttonText?: string;
/** /**
* Показывать виджет через X секунд * Показывать виджет через X секунд
*/ */

79
lib/ui_kit/unscreen.ts Normal file

@ -0,0 +1,79 @@
function addOverlay(overlay: HTMLElement) {
// const overlay = document.getElementById('overlay');
overlay.style.opacity = "1"; // Затемнено
overlay.style.pointerEvents = "auto"; // Включить клики
}
function removeOverlay(overlay: HTMLElement) {
overlay.style.opacity = "0"; // Вернуть в исходное состояние
overlay.style.pointerEvents = "none"; // Игнорировать клики
}
function addRemoveOverlayTimer(overlay: HTMLElement, time = 1000) {
addOverlay(overlay);
setTimeout(() => {
removeOverlay(overlay);
}, time); // 1 секунда затемнения
}
// Флаги для отслеживания состояния
let isMouseInside = true;
let isWindowFocused = true;
export default function unscreen(overlay: HTMLElement, root: HTMLElement) {
let focusTimeout: NodeJS.Timeout | undefined;
// Проверка состояния и выполнение нужного действия
function checkFocusAndMouse() {
if (!isWindowFocused || !isMouseInside) {
// ИЛИ
addOverlay(overlay);
} else if (isWindowFocused && isMouseInside) {
// И
removeOverlay(overlay);
}
}
// Добавляем обработчики событий
window.addEventListener("blur", () => {
console.log("blur");
isWindowFocused = false;
checkFocusAndMouse(); // Проверяем состояние
}); // Когда окно теряет фокус
window.addEventListener("focus", () => {
console.log("focus");
isWindowFocused = true;
checkFocusAndMouse(); // Проверяем состояние
}); // Когда окно получает фокус
window.addEventListener("mouseleave", () => {
console.log("mouseleave");
isMouseInside = false;
checkFocusAndMouse(); // Проверяем состояние
}); // Когда мышка покидает окно
window.addEventListener("mouseenter", () => {
console.log("mouseenter");
isMouseInside = true;
checkFocusAndMouse(); // Проверяем состояние
}); // Когда мышка возвращается в окно
root.addEventListener("contextmenu", (event) => event.preventDefault());
window.addEventListener("keydown", function (event) {
event.preventDefault();
if (event.key === "PrintScreen" || (event.ctrlKey && event.key === "p")) {
addRemoveOverlayTimer(overlay);
}
});
// Проверка для мобильных устройств
root.addEventListener("touchstart", function (event) {
// Пример: если есть более чем один жест
if (event.touches.length > 1) {
addRemoveOverlayTimer(overlay);
}
});
window.addEventListener("beforeprint", function () {
addRemoveOverlayTimer(overlay);
});
}

@ -1,6 +1,6 @@
{ {
"name": "@frontend/squzanswerer", "name": "@frontend/squzanswerer",
"version": "1.0.56", "version": "1.0.57",
"type": "module", "type": "module",
"main": "./dist-package/index.js", "main": "./dist-package/index.js",
"module": "./dist-package/index.js", "module": "./dist-package/index.js",

@ -19,6 +19,7 @@ export default function QuizSideButton({
buttonTextColor, buttonTextColor,
dialogDimensions, dialogDimensions,
fullScreen = false, fullScreen = false,
buttonText,
buttonFlash = false, buttonFlash = false,
autoShowWidgetTime = 0, autoShowWidgetTime = 0,
autoShowQuizTime = null, autoShowQuizTime = null,
@ -89,7 +90,10 @@ export default function QuizSideButton({
}, },
]} ]}
/> />
<Fade in={!isWidgetHidden} timeout={400}> <Fade
in={!isWidgetHidden}
timeout={400}
>
<Button <Button
className="pena-quiz-widget-button" className="pena-quiz-widget-button"
variant="contained" variant="contained"
@ -116,7 +120,7 @@ export default function QuizSideButton({
}, },
]} ]}
> >
Пройти квиз {buttonText || "Пройти квиз"}
{showButtonFlash && <RunningStripe />} {showButtonFlash && <RunningStripe />}
</Button> </Button>
</Fade> </Fade>