refactor(stories): refactor stories

This commit is contained in:
Sergey Krylov 2023-08-09 21:48:35 +03:00
parent 282b1fb827
commit 0fc37cfb21
9 changed files with 362 additions and 266 deletions

View File

@ -62,7 +62,7 @@ const egerJarDesktopImage = path.join(imageRootDir, '/stories/eger/desktop/plot/
const faraonPlotScrollDesktopImage = path.join(imageRootDir, '/stories/faraon/desktop/plot/scroll.png'); const faraonPlotScrollDesktopImage = path.join(imageRootDir, '/stories/faraon/desktop/plot/scroll.png');
const faraonPlotKeysDesktopImage = path.join(imageRootDir, '/stories/faraon/desktop/plot/keys.png'); const faraonPlotKeysDesktopImage = path.join(imageRootDir, '/stories/faraon/desktop/plot/keys.png');
const multPlotPlantDesktopImage = path.join(imageRootDir, '/stories/mult/desktop/plot/plant.png'); const multPlotPlantDesktopImage = path.join(imageRootDir, '/stories/mu-lt/desktop/plot/plant.png');
const multPlotStarDesktopImage = path.join(imageRootDir, '/stories/mult/desktop/plot/star.png'); const multPlotStarDesktopImage = path.join(imageRootDir, '/stories/mult/desktop/plot/star.png');
const multPlotTreeDesktopImage = path.join(imageRootDir, '/stories/mult/desktop/plot/tree.png'); const multPlotTreeDesktopImage = path.join(imageRootDir, '/stories/mult/desktop/plot/tree.png');
@ -171,15 +171,19 @@ export type QuestItemType = {
const egerStories: StoryType[] = [ const egerStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Сюжет',
mobileSrc: egerPlotMobileImage,
src: egerPlotImage,
},
size: { height: 240, width: 380 },
title: 'Сюжет',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Сюжет',
src: egerPlotImage,
},
imgMobile: {
alt: 'Сюжет',
src: egerPlotMobileImage,
},
modal: { modal: {
content: { content: {
background: { background: {
@ -265,43 +269,48 @@ const egerStories: StoryType[] = [
}, },
type: 'questPlot', type: 'questPlot',
}, },
title: 'Сюжет',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: egerFeedbackMobileImage,
src: egerFeedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: egerFeedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: egerFeedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: egerGalleryMobileImage,
src: egerGalleryImage,
},
size: { height: 240, width: 380 },
title: 'Фотографии\\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: egerGalleryImage,
},
imgMobile: {
alt: 'Фотографии и видео',
src: egerGalleryMobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\\n и видео',
}, },
]; ];
export const egerQuest: QuestItemType = { export const egerQuest: QuestItemType = {
@ -363,15 +372,19 @@ export const egerQuest: QuestItemType = {
const faraonStories: StoryType[] = [ const faraonStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Сюжет',
mobileSrc: faraonPlotMobileImage,
src: faraonPlotImage,
},
size: { height: 240, width: 380 },
title: 'Сюжет',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Сюжет',
src: faraonPlotImage,
},
imgMobile: {
alt: 'Сюжет',
src: faraonPlotMobileImage,
},
modal: { modal: {
content: { content: {
background: { background: {
@ -460,43 +473,48 @@ const faraonStories: StoryType[] = [
}, },
type: 'questPlot', type: 'questPlot',
}, },
title: 'Сюжет',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: faraonFeedbackMobileImage,
src: faraonFeedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: faraonFeedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: faraonFeedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: faraonGalleryMobileImage,
src: faraonGalleryImage,
},
size: { height: 240, width: 380 },
title: 'Фотографии\\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: faraonGalleryImage,
},
imgMobile: {
alt: 'Фотографии и видео',
src: faraonGalleryMobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\\n и видео',
}, },
]; ];
export const faraonQuest: QuestItemType = { export const faraonQuest: QuestItemType = {
@ -577,15 +595,19 @@ export const faraonQuest: QuestItemType = {
const multStories: StoryType[] = [ const multStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Сюжет',
mobileSrc: multPlotMobileImage,
src: multPlotImage,
},
size: { height: 240, width: 380 },
title: 'Сюжет',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Сюжет',
src: multPlotImage,
},
imgMobile: {
alt: 'Сюжет',
src: multPlotMobileImage,
},
modal: { modal: {
content: { content: {
background: { background: {
@ -674,43 +696,48 @@ const multStories: StoryType[] = [
}, },
type: 'questPlot', type: 'questPlot',
}, },
title: 'Сюжет',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: multFeedbackMobileImage,
src: multFeedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: multFeedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: multFeedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: multGalleryMobileImage,
src: multGalleryImage,
},
size: { height: 240, width: 380 },
title: 'Фотографии\\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: multGalleryImage,
},
imgMobile: {
alt: 'Фотографии и видео',
src: multGalleryMobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\\n и видео',
}, },
]; ];
export const multQuest: QuestItemType = { export const multQuest: QuestItemType = {

View File

@ -24,6 +24,8 @@ const example3 = path.join(imageRootDir, 'example3.png');
const example4 = path.join(imageRootDir, 'example4.png'); const example4 = path.join(imageRootDir, 'example4.png');
const example5 = path.join(imageRootDir, 'example5.png'); const example5 = path.join(imageRootDir, 'example5.png');
const HomePageVulpesImg = path.join(imageRootDir, 'vulpes/homepage.png');
const gallery1Image = path.join(galleryRootDir, '/1.png'); const gallery1Image = path.join(galleryRootDir, '/1.png');
const gallery2Image = path.join(galleryRootDir, '/2.png'); const gallery2Image = path.join(galleryRootDir, '/2.png');
const gallery3Image = path.join(galleryRootDir, '/3.png'); const gallery3Image = path.join(galleryRootDir, '/3.png');
@ -73,20 +75,7 @@ export type StoryQuestPlotModalType = {
title: string; title: string;
}; };
export type StoryModalContent = StoryFaqModalType | export type StoryCardCardContentType = {
StoryFeedbackModalType |
StoryGalleryModalType |
StoryInfoModalType |
StoryQuestPlotModalType;
export type StoryModalType = 'faq' | 'feedback' | 'gallery' | 'info' | 'questPlot';
export type StoryImageType = {
alt: string;
height?: number;
src: string;
width?: number;
};
export type StoryType = {
border?: { border?: {
inner?: { inner?: {
color: string; color: string;
@ -95,14 +84,45 @@ export type StoryType = {
color: string; color: string;
}; };
}; };
image: ImageType;
size?: {
height?: number;
mobileHeight?: number;
mobileWidth?: number;
width?: number;
};
title: string;
};
export type StoryVulpesContentType = {
image: ImageType;
size?: {
height?: number;
mobileHeight?: number;
mobileWidth?: number;
width?: number;
};
};
export type StoryCardContent = StoryCardCardContentType | StoryVulpesContentType;
export type StoryModalContent = StoryFaqModalType |
StoryFeedbackModalType |
StoryGalleryModalType |
StoryInfoModalType |
StoryQuestPlotModalType;
export type StoryModalType = 'faq' | 'feedback' | 'gallery' | 'info' | 'questPlot';
export type StoryContentType = 'card' | 'vulpes';
export type StoryType = {
card: {
content: StoryCardContent;
type: StoryContentType;
};
id: string; id: string;
img: StoryImageType; modal?: {
imgMobile?: StoryImageType;
modal: {
content?: StoryModalContent; content?: StoryModalContent;
type: StoryModalType; type: StoryModalType;
}; };
title: string;
}; };
const feedbacks = [ const feedbacks = [
@ -153,15 +173,19 @@ const gallery: ImageType[] = [
const birthdayPageStories: StoryType[] = [ const birthdayPageStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Ответы на вопросы',
mobileSrc: faqMobileImage,
src: faqImage,
},
size: { height: 240, width: 380 },
title: 'Ответы\\n на вопросы',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Ответы на вопросы',
src: faqImage,
},
imgMobile: {
alt: 'Ответы на вопросы',
src: faqMobileImage,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -185,56 +209,65 @@ const birthdayPageStories: StoryType[] = [
}, },
type: 'faq', type: 'faq',
}, },
title: 'Ответы\\n на вопросы',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: feedbackMobileImage,
src: feedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: feedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: feedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: photoMobileImage,
src: photoImage,
},
size: { height: 240, width: 380 },
title: 'Фотографии\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: photoImage,
},
imgMobile: {
alt: 'Фотографии и видео',
src: photoMobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\n и видео',
}, },
]; ];
const graduationPageStories: StoryType[] = [ const graduationPageStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Ответы на вопросы',
mobileSrc: faqMobileImage,
src: faqImage,
},
size: { height: 240, width: 380 },
title: 'Ответы\\n на вопросы',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Ответы на вопросы',
src: faqImage,
},
imgMobile: {
alt: 'Ответы на вопросы',
src: faqMobileImage,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -258,56 +291,65 @@ const graduationPageStories: StoryType[] = [
}, },
type: 'faq', type: 'faq',
}, },
title: 'Ответы\\n на вопросы',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: feedbackMobileImage,
src: feedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: feedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: feedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: photo2MobileImage,
src: photo2Image,
},
size: { height: 240, width: 380 },
title: 'Фотографии\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: photo2Image,
},
imgMobile: {
alt: 'Фотографии и видео',
src: photo2MobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\n и видео',
}, },
]; ];
const outdoorsPageStories: StoryType[] = [ const outdoorsPageStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Ответы на вопросы',
mobileSrc: faqMobileImage,
src: faqImage,
},
size: { height: 240, width: 380 },
title: 'Ответы\\n на вопросы',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Ответы на вопросы',
src: faqImage,
},
imgMobile: {
alt: 'Ответы на вопросы',
src: faqMobileImage,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -331,57 +373,64 @@ const outdoorsPageStories: StoryType[] = [
}, },
type: 'faq', type: 'faq',
}, },
title: 'Ответы\\n на вопросы',
}, },
{ {
card: {
content: {
image: {
alt: 'Отзывы наших клиентов',
mobileSrc: feedbackMobileImage,
src: feedbackImage,
},
size: { height: 240, width: 380 },
title: 'Отзывы\\n наших клиентов',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Отзывы наших клиентов',
src: feedbackImage,
},
imgMobile: {
alt: 'Отзывы наших клиентов',
src: feedbackMobileImage,
},
modal: { modal: {
content: { content: {
feedbacks, feedbacks,
}, },
type: 'feedback', type: 'feedback',
}, },
title: 'Отзывы\\n наших клиентов',
}, },
{ {
card: {
content: {
image: {
alt: 'Фотографии и видео',
mobileSrc: photo2MobileImage,
src: photo2Image,
},
size: { height: 240, width: 380 },
title: 'Фотографии\n и видео',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Фотографии и видео',
src: photo2Image,
},
imgMobile: {
alt: 'Фотографии и видео',
src: photo2MobileImage,
},
modal: { modal: {
content: { content: {
gallery, gallery,
}, },
type: 'gallery', type: 'gallery',
}, },
title: 'Фотографии\n и видео',
}, },
]; ];
const homePageStories: StoryType[] = [ const homePageStories: StoryType[] = [
{ {
card: {
content: {
image: {
alt: 'Рекомендации по квестам',
src: example,
},
title: 'Рекомендации\\n по квестам',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Рекомендации по квестам',
src: example,
},
imgMobile: {
alt: 'Рекомендации по квестам',
src: example,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -406,54 +455,34 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'Рекомендации\\n по квестам',
}, },
{ {
id: uuid(), card: {
img: {
alt: 'День Рождения в Arkids парке',
src: example2,
},
imgMobile: {
alt: 'День Рождения в Arkids парке',
src: example2,
},
modal: {
content: { content: {
button: {
link: PAGE_LINK.HOME,
text: 'И кнопка ещё будет',
},
image: { image: {
alt: 'example', alt: 'fenek',
src: faqStoryImage, height: 218,
src: HomePageVulpesImg,
width: 180,
}, },
text: 'А здесь будет текст, но пока оставлю здесь' title: '',
+ 'текст-рыбу, сорри'
+ '\\n\\n'
+ 'Lorem ipsum dolor sit amet, consectetur\\n'
+ 'adipiscing elit, sed do eiusmod tempor incididunt'
+ 'ut labore et dolore magna aliqua'
+ '\\n\\n'
+ 'Ut enim ad minim veniam, quis nostrud exercitation'
+ 'ullamco laboris nisi ut aliquip ex ea commodo'
+ 'consequat',
title: 'Это будет заголовок истории',
}, },
type: 'info', type: 'vulpes',
}, },
title: 'День Рождения\\n в Arkids парке', id: uuid(),
}, },
{ {
card: {
content: {
image: {
alt: 'День Рождения в Аркидс парке',
src: example2,
},
title: 'День Рождения\\n в Аркидс парке',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Новые программы для праздника',
src: example3,
},
imgMobile: {
alt: 'Новые программы для праздника',
src: example,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -478,18 +507,19 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'Новые программы\\n для праздника',
}, },
{ {
card: {
content: {
image: {
alt: 'Новые программы для праздника',
src: example3,
},
title: 'Новые программы\\n для праздника',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Рекомендации по квестам',
src: example4,
},
imgMobile: {
alt: 'Рекомендации по квестам',
src: example,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -514,18 +544,19 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'Рекомендации\\n по квестам',
}, },
{ {
card: {
content: {
image: {
alt: 'Рекомендации по квестам',
src: example4,
},
title: 'Рекомендации\\n по квестам',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'День Рождения в Arkids парке',
src: example5,
},
imgMobile: {
alt: 'День Рождения в Arkids парке',
src: example2,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -550,18 +581,19 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'День Рождения\\n в Arkids парке',
}, },
{ {
card: {
content: {
image: {
alt: 'День Рождения в Аркидс парке',
src: example5,
},
title: 'День Рождения\\n в Аркидс парке',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Новые программы для праздника',
src: example,
},
imgMobile: {
alt: 'Новые программы для праздника',
src: example,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -586,18 +618,56 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'Новые программы\\n для праздника',
}, },
{ {
card: {
content: {
image: {
alt: 'Новые программы для праздника',
src: example,
},
title: 'Новые программы\\n для праздника',
},
type: 'card',
},
id: uuid(),
modal: {
content: {
button: {
link: PAGE_LINK.HOME,
text: 'И кнопка ещё будет',
},
image: {
alt: 'example',
src: faqStoryImage,
},
text: 'А здесь будет текст, но пока оставлю здесь'
+ 'текст-рыбу, сорри'
+ '\\n\\n'
+ 'Lorem ipsum dolor sit amet, consectetur\\n'
+ 'adipiscing elit, sed do eiusmod tempor incididunt'
+ 'ut labore et dolore magna aliqua'
+ '\\n\\n'
+ 'Ut enim ad minim veniam, quis nostrud exercitation'
+ 'ullamco laboris nisi ut aliquip ex ea commodo'
+ 'consequat',
title: 'Это будет заголовок истории',
},
type: 'info',
},
},
{
card: {
content: {
image: {
alt: 'Новые программы для праздника',
src: example2,
},
title: 'Новые программы\\n для праздника',
},
type: 'card',
},
id: uuid(), id: uuid(),
img: {
alt: 'Новые программы для праздника',
src: example2,
},
imgMobile: {
alt: 'Новые программы для праздника',
src: example,
},
modal: { modal: {
content: { content: {
button: { button: {
@ -622,7 +692,6 @@ const homePageStories: StoryType[] = [
}, },
type: 'info', type: 'info',
}, },
title: 'Новые программы\\n для праздника',
}, },
]; ];

View File

@ -39,7 +39,7 @@ const contactsTitleText = {
}; };
const aboutTitleText = { const aboutTitleText = {
description: 'История открытия и развития Arkids Парка\\n и то, что мы делаем для Вас сегодня', description: 'История открытия и развития Аркидс Парка\\n и то, что мы делаем для Вас сегодня',
title: 'Информация о парке', title: 'Информация о парке',
}; };
@ -181,7 +181,7 @@ const parkInfo = {
text: '- интерактивный парк нового поколения,\n' text: '- интерактивный парк нового поколения,\n'
+ ' объединяющий популярные услуги\n' + ' объединяющий популярные услуги\n'
+ ' и развлечения для детей и взрослых', + ' и развлечения для детей и взрослых',
title: 'Arkids Парк', title: 'Аркидс Парк',
}; };
export const getTitle = (req: Request, res: Response) => { export const getTitle = (req: Request, res: Response) => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB