upd
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# NEXT_PUBLIC_API=http://192.168.1.250:3001/
|
||||
NEXT_PUBLIC_API=https://graff.estate/api/
|
||||
NEXT_PUBLIC_API=http://192.168.1.250:3003/
|
||||
# NEXT_PUBLIC_API=https://graff.estate/api/
|
||||
NEXT_PUBLIC_S3_BUCKET=https://storage.yandexcloud.net/dult-faib-knac-fint/
|
||||
NEXT_PUBLIC_TINYMCE_API_KEY=2vf68779upg45y46o6g5gaxldy9gzr399eyaaqa0ki3mj2h2
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"prettier.configPath": "",
|
||||
"prettier.prettierPath": "",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "explicit",
|
||||
"source.sortMembers": "explicit"
|
||||
},
|
||||
"postman.settings.dotenv-detection-notification-visibility": false
|
||||
}
|
||||
+5
-1
@@ -151,9 +151,13 @@ html {
|
||||
}
|
||||
|
||||
@utility text-gradient {
|
||||
/* -webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
@apply bg-gradient-to-r from-[#798FFF] to-[#D375FF] bg-clip-text; */
|
||||
background: linear-gradient(87deg, #798fff 15%, #d375ff 100%);
|
||||
background-clip: text;
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
@apply bg-gradient-to-r from-[#798FFF] to-[#D375FF] bg-clip-text;
|
||||
}
|
||||
|
||||
@utility bg-gradient {
|
||||
|
||||
@@ -16,7 +16,7 @@ export function ArticleFormActions({
|
||||
<>
|
||||
<div className="space-y-2 absolute left-7 top-5 z-[2]">
|
||||
<button
|
||||
className="flex items-center gap-2 lg:py-[0.556vw] lg:px-[0.833vw] py-2 px-3 bg-gradient disabled:bg-[#232425] disabled:bg-none lg:rounded-[0.833vw] rounded-xl cursor-pointer"
|
||||
className="flex items-center gap-2 lg:py-[0.556vw] lg:px-[0.833vw] py-2 px-3 bg-gradient disabled:bg-[#232425] group disabled:bg-none lg:rounded-[0.833vw] rounded-xl cursor-pointer"
|
||||
disabled={disabled}
|
||||
onClick={() => handleSave(false)}
|
||||
>
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Title } from '@/ui/Title';
|
||||
import { useInView, useMotionValueEvent, useScroll } from 'framer-motion';
|
||||
import { useRef, useState } from 'react';
|
||||
import { PrimeProgressItem } from '../../PrimePage/PrimePage';
|
||||
// import { ThreeDTour } from '../../PrimePage/ThreeDTour';
|
||||
import { Engine } from './Engine';
|
||||
import { Infrastructure } from './Infrastructure';
|
||||
import { Insolation } from './Insolation';
|
||||
@@ -50,7 +51,7 @@ export function PresentationDesktop() {
|
||||
<div className="absolute top-0 w-full h-full overflow-hidden">
|
||||
<VideoLayer scroll={scrollYProgress} />
|
||||
<SearchAndSelect scroll={scrollYProgress} />
|
||||
<ThreeDTour scroll={scrollYProgress} />
|
||||
<ThreeDTour scroll={scrollYProgress} page="main" />
|
||||
<Infrastructure scroll={scrollYProgress} />
|
||||
<Insolation scroll={scrollYProgress} />
|
||||
<Engine scroll={scrollYProgress} />
|
||||
|
||||
@@ -6,13 +6,19 @@ import { motion, MotionValue, useTransform } from 'framer-motion';
|
||||
export function ThreeDTour({
|
||||
scroll,
|
||||
top,
|
||||
page,
|
||||
}: {
|
||||
scroll: MotionValue<number>;
|
||||
top?: number;
|
||||
page: 'main' | 'prime';
|
||||
}) {
|
||||
const opacity = useTransform(scroll, [0, 1 / 5, 2 / 5], [0, 1, 0]);
|
||||
const opacityMain = useTransform(scroll, [0, 1 / 5, 2 / 5], [0, 1, 0]);
|
||||
|
||||
const x = useTransform(scroll, [1 / 5, 2 / 5], ['0%', '-100%']);
|
||||
const opacityPrime = useTransform(scroll, [0, 1 / 6], [1, 0]);
|
||||
|
||||
const xMain = useTransform(scroll, [1 / 5, 2 / 5], ['0%', '-100%']);
|
||||
|
||||
const xPrime = useTransform(scroll, [0, 1 / 6], ['0%', '100%']);
|
||||
|
||||
const y = useTransform(scroll, [0, 1 / 5], ['100%', '0%']);
|
||||
|
||||
@@ -21,7 +27,11 @@ export function ThreeDTour({
|
||||
return (
|
||||
<>
|
||||
<motion.div
|
||||
style={{ opacity, y, x }}
|
||||
style={{
|
||||
opacity: page === 'main' ? opacityMain : opacityPrime,
|
||||
y: page === 'main' ? y : undefined,
|
||||
x: page === 'main' ? xMain : xPrime,
|
||||
}}
|
||||
className="p-[1.667vw] max-lg:hidden rounded-[1.111vw] bg-radial-[at_100%_100%] from-[#7A7A7A66] backdrop-blur-[500px] aspect-[340/368] flex flex-col justify-between gap-[4.444vw] absolute w-[23.611vw]"
|
||||
>
|
||||
<p className="heading2 font-medium">
|
||||
@@ -34,8 +44,8 @@ export function ThreeDTour({
|
||||
<img
|
||||
src={src}
|
||||
alt={title}
|
||||
className="lg:rounded-[1.111vw] rounded-2xl !relative aspect-square"
|
||||
sizes="(min-width: 1440px) 4.444vw"
|
||||
className="rounded-[1.111vw] !relative aspect-square"
|
||||
sizes="4.444vw"
|
||||
/>
|
||||
</div>
|
||||
<p className="text2">{title}</p>
|
||||
@@ -44,7 +54,7 @@ export function ThreeDTour({
|
||||
</div>
|
||||
</motion.div>
|
||||
<motion.div
|
||||
style={!!top ? { opacity: opacityMini, top } : { opacity }}
|
||||
style={!!top ? { opacity: opacityMini, top } : { opacity: opacityMain }}
|
||||
className="md:space-y-6 max-lg:sticky lg:hidden sm:space-y-7 space-y-2 px-4 xs:py-6 py-4 rounded-2xl bg-radial-[at_100%_100%] from-[#7A7A7A66] backdrop-blur-[500px]"
|
||||
>
|
||||
<p className="heading2 md:text-center font-medium">3D-тур</p>
|
||||
|
||||
@@ -14,7 +14,7 @@ export function Favorites({ scroll }: { scroll: MotionValue<number> }) {
|
||||
className="p-[1.667vw] backdrop-blur-xs rounded-2xl bg-[radial-gradient(ellipse_at_right,#7A7A7A66,transparent)] absolute h-full w-[23.611vw] flex flex-col justify-between gap-6"
|
||||
>
|
||||
<p className="heading2 font-medium">Формирование списка избранного</p>
|
||||
<div className="rounded-full aspect-square w-[58.824%] self-center bg-[#D375FF] bg-[url(/img/pages/prime/favorite.png),url(/img/pages/prime/favorite.png),url(/img/pages/prime/favorite.png)] bg-no-repeat bg-[length:29%,35%,29%] bg-[position:-3.5%,center,right_-3.5%_center]" />
|
||||
<div className="rounded-full aspect-square w-[58.824%] self-center bg-[#D375FF] bg-[url(/img/pages/prime/favorite.jpg),url(/img/pages/prime/favorite.jpg),url(/img/pages/prime/favorite.jpg)] bg-no-repeat bg-[length:29%,35%,29%] bg-[position:-3.5%,center,right_-3.5%_center]" />
|
||||
<p className="text1">
|
||||
При нажатии «Добавить в избранное» квартира попадает в отдельный
|
||||
спискок.
|
||||
|
||||
@@ -11,7 +11,8 @@ import { Infrastructure } from './Infrastructure';
|
||||
import { Insolation } from './Insolation';
|
||||
import { IntegrationCRM } from './IntegrationCRM';
|
||||
import { SearchAndSelect } from './SearchAndSelect';
|
||||
import { ThreeDTour } from './ThreeDTour';
|
||||
// import { ThreeDTour } from './ThreeDTour';
|
||||
import { ThreeDTour } from '../MainPage/Presentation/ThreeDTour';
|
||||
import { VideoLayer } from './VideoLayer';
|
||||
|
||||
export function Prime() {
|
||||
@@ -49,7 +50,7 @@ export function Prime() {
|
||||
</div>
|
||||
<div className="absolute inset-0 overflow-hidden">
|
||||
<VideoLayer scroll={scrollYProgress} />
|
||||
<ThreeDTour scroll={scrollYProgress} />
|
||||
<ThreeDTour scroll={scrollYProgress} page="prime" />
|
||||
<SearchAndSelect scroll={scrollYProgress} />
|
||||
<Infrastructure scroll={scrollYProgress} />
|
||||
<Favorites scroll={scrollYProgress} />
|
||||
@@ -58,22 +59,24 @@ export function Prime() {
|
||||
<CommercialOffer scroll={scrollYProgress} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex absolute p-[0.556vw] rounded-[1.875vw] bg-[#37393B99] backdrop-blur-[20px] left-1/2 -translate-1/2">
|
||||
{primeVideos.map(({ src, anchorImg }, index) => (
|
||||
<PrimeProgressItem
|
||||
onClick={() => {
|
||||
container.current?.scrollTo({
|
||||
top:
|
||||
(index * container.current?.scrollHeight) /
|
||||
primeVideos.length,
|
||||
});
|
||||
}}
|
||||
active={index === slide}
|
||||
src={anchorImg}
|
||||
title={src}
|
||||
key={src}
|
||||
/>
|
||||
))}
|
||||
<div className="relative h-full">
|
||||
<div className="flex absolute p-[0.556vw] rounded-[1.875vw] bg-[#37393B99] backdrop-blur-[20px] left-1/2 -translate-x-1/2">
|
||||
{primeVideos.map(({ src, anchorImg }, index) => (
|
||||
<PrimeProgressItem
|
||||
onClick={() => {
|
||||
container.current?.scrollTo({
|
||||
top:
|
||||
(index * container.current?.scrollHeight) /
|
||||
primeVideos.length,
|
||||
});
|
||||
}}
|
||||
active={index === slide}
|
||||
src={anchorImg}
|
||||
title={src}
|
||||
key={src}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,7 @@ export const primeVideos = [
|
||||
anchorImg: '/img/pages/prime/infra.jpg',
|
||||
},
|
||||
{
|
||||
src: '',
|
||||
src: '3_infrastructure',
|
||||
anchorImg: '/img/pages/prime/favorites.jpg',
|
||||
},
|
||||
{
|
||||
@@ -38,5 +38,5 @@ export const primeVideos = [
|
||||
src: '4_insolation',
|
||||
anchorImg: '/img/pages/prime/insolation.jpg',
|
||||
},
|
||||
{ src: '', anchorImg: '/img/pages/prime/cp.jpg' },
|
||||
{ src: '4_insolation', anchorImg: '/img/pages/prime/cp.jpg' },
|
||||
];
|
||||
|
||||
@@ -16,9 +16,6 @@ export function Figure({
|
||||
}) {
|
||||
const inView = useInView(root, { margin: '-200px', once: true });
|
||||
|
||||
// const { isXs } = useMediaQueries();
|
||||
|
||||
// !isXs ?
|
||||
return (
|
||||
<motion.div
|
||||
ref={root}
|
||||
@@ -35,17 +32,4 @@ export function Figure({
|
||||
</p>
|
||||
</motion.div>
|
||||
);
|
||||
// : (
|
||||
// <div
|
||||
// className={
|
||||
// 'bg-[linear-gradient(to_top_left,#7a7a7a50,transparent)] lg:p-[1.667vw] p-6 rounded-2xl flex flex-col justify-between [will-change:opacity,transform] ' +
|
||||
// className
|
||||
// }
|
||||
// >
|
||||
// <p className="text1">{text}</p>
|
||||
// <p className="accent font-medium">
|
||||
// <span className="line1 font-medium">{percent}</span>%
|
||||
// </p>
|
||||
// </div>
|
||||
// );
|
||||
}
|
||||
|
||||
+58
-58
@@ -1,64 +1,64 @@
|
||||
'use server';
|
||||
import { api } from '@/api';
|
||||
import { mockCompanies } from '@/consts/mockCompanies';
|
||||
import { ICompany } from '@/types/ICompany';
|
||||
import { readFileSync } from 'fs';
|
||||
import { cookies } from 'next/headers';
|
||||
// 'use server';
|
||||
// import { api } from '@/api';
|
||||
// import { mockCompanies } from '@/consts/mockCompanies';
|
||||
// import { ICompany } from '@/types/ICompany';
|
||||
// import { readFileSync } from 'fs';
|
||||
// import { cookies } from 'next/headers';
|
||||
|
||||
export async function addCompanies() {
|
||||
const newCompanies: ICompany[] = [];
|
||||
for (const { color, logo, title, mapIcon } of mockCompanies) {
|
||||
const formData = new FormData();
|
||||
formData.append('dest', 'projects');
|
||||
// export async function addCompanies() {
|
||||
// const newCompanies: ICompany[] = [];
|
||||
// for (const { color, logo, title, mapIcon } of mockCompanies) {
|
||||
// const formData = new FormData();
|
||||
// formData.append('dest', 'projects');
|
||||
|
||||
if (logo)
|
||||
formData.append(
|
||||
'files',
|
||||
new File([readFileSync('./public' + logo)], logo)
|
||||
);
|
||||
// if (logo)
|
||||
// formData.append(
|
||||
// 'files',
|
||||
// new File([readFileSync('./public' + logo)], logo)
|
||||
// );
|
||||
|
||||
if (mapIcon)
|
||||
formData.append(
|
||||
'files',
|
||||
new File([readFileSync('./public' + mapIcon)], mapIcon)
|
||||
);
|
||||
// if (mapIcon)
|
||||
// formData.append(
|
||||
// 'files',
|
||||
// new File([readFileSync('./public' + mapIcon)], mapIcon)
|
||||
// );
|
||||
|
||||
let paths;
|
||||
// let paths;
|
||||
|
||||
if (formData.has('files')) {
|
||||
paths = await api
|
||||
.post('upload', {
|
||||
body: formData,
|
||||
hooks: {
|
||||
beforeRequest: [
|
||||
async (request) => {
|
||||
request.headers.set('Cookie', cookies().toString());
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
.json<string[]>();
|
||||
}
|
||||
// if (formData.has('files')) {
|
||||
// paths = await api
|
||||
// .post('upload', {
|
||||
// body: formData,
|
||||
// hooks: {
|
||||
// beforeRequest: [
|
||||
// async (request) => {
|
||||
// request.headers.set('Cookie', cookies().toString());
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// })
|
||||
// .json<string[]>();
|
||||
// }
|
||||
|
||||
newCompanies.push(
|
||||
await api
|
||||
.post('companies', {
|
||||
json: {
|
||||
color,
|
||||
logo: paths ? paths[0] : undefined,
|
||||
title,
|
||||
mapIcon: paths && paths.length == 2 ? paths[1] : undefined,
|
||||
},
|
||||
hooks: {
|
||||
beforeRequest: [
|
||||
async (request) => {
|
||||
request.headers.set('Cookie', cookies().toString());
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
.json<ICompany>()
|
||||
);
|
||||
}
|
||||
return JSON.parse(JSON.stringify(newCompanies));
|
||||
}
|
||||
// newCompanies.push(
|
||||
// await api
|
||||
// .post('companies', {
|
||||
// json: {
|
||||
// color,
|
||||
// logo: paths ? paths[0] : undefined,
|
||||
// title,
|
||||
// mapIcon: paths && paths.length == 2 ? paths[1] : undefined,
|
||||
// },
|
||||
// hooks: {
|
||||
// beforeRequest: [
|
||||
// async (request) => {
|
||||
// request.headers.set('Cookie', cookies().toString());
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// })
|
||||
// .json<ICompany>()
|
||||
// );
|
||||
// }
|
||||
// return JSON.parse(JSON.stringify(newCompanies));
|
||||
// }
|
||||
|
||||
+45
-45
@@ -1,50 +1,50 @@
|
||||
import { api } from '@/api';
|
||||
import { mockProjects } from '@/consts/mockProjects';
|
||||
import { ICompany } from '@/types/ICompany';
|
||||
import { parse } from 'date-fns';
|
||||
import ky from 'ky';
|
||||
// import { api } from '@/api';
|
||||
// import { mockProjects } from '@/consts/mockProjects';
|
||||
// import { ICompany } from '@/types/ICompany';
|
||||
// import { parse } from 'date-fns';
|
||||
// import ky from 'ky';
|
||||
|
||||
export async function addProjects() {
|
||||
for (const {
|
||||
devices,
|
||||
company,
|
||||
releaseDate,
|
||||
image,
|
||||
...project
|
||||
} of mockProjects) {
|
||||
const buffer = await ky
|
||||
.get('https://graff.estate/api/upload/' + image)
|
||||
.arrayBuffer();
|
||||
// export async function addProjects() {
|
||||
// for (const {
|
||||
// devices,
|
||||
// company,
|
||||
// releaseDate,
|
||||
// image,
|
||||
// ...project
|
||||
// } of mockProjects) {
|
||||
// const buffer = await ky
|
||||
// .get('https://graff.estate/api/upload/' + image)
|
||||
// .arrayBuffer();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('files', new File([buffer], image));
|
||||
formData.append('dest', 'projects');
|
||||
// const formData = new FormData();
|
||||
// formData.append('files', new File([buffer], image));
|
||||
// formData.append('dest', 'projects');
|
||||
|
||||
const [file] = await api
|
||||
.post('upload', {
|
||||
body: formData,
|
||||
})
|
||||
.json<string[]>();
|
||||
// const [file] = await api
|
||||
// .post('upload', {
|
||||
// body: formData,
|
||||
// })
|
||||
// .json<string[]>();
|
||||
|
||||
const res = await api
|
||||
.get(`companies?title=${company ? decodeURIComponent(company) : ''}`)
|
||||
.json<ICompany[]>();
|
||||
// const res = await api
|
||||
// .get(`companies?title=${company ? decodeURIComponent(company) : ''}`)
|
||||
// .json<ICompany[]>();
|
||||
|
||||
await api
|
||||
.post('projects', {
|
||||
json: {
|
||||
...project,
|
||||
image: file,
|
||||
companyId: res.length === 1 ? res[0].id : undefined,
|
||||
releaseDate: parse(
|
||||
releaseDate.split('T')[0],
|
||||
'yyyy-MM-dd',
|
||||
new Date()
|
||||
),
|
||||
tags: [],
|
||||
description: '',
|
||||
},
|
||||
})
|
||||
.json();
|
||||
}
|
||||
}
|
||||
// await api
|
||||
// .post('projects', {
|
||||
// json: {
|
||||
// ...project,
|
||||
// image: file,
|
||||
// companyId: res.length === 1 ? res[0].id : undefined,
|
||||
// releaseDate: parse(
|
||||
// releaseDate.split('T')[0],
|
||||
// 'yyyy-MM-dd',
|
||||
// new Date()
|
||||
// ),
|
||||
// tags: [],
|
||||
// description: '',
|
||||
// },
|
||||
// })
|
||||
// .json();
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user