Try fix 3d view
This commit is contained in:
@@ -100,13 +100,12 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
}
|
||||
};
|
||||
|
||||
// --- Улучшенная функция копирования ---
|
||||
// --- Функция копирования ---
|
||||
const handleShare = async () => {
|
||||
const url = generateShareUrl(config, splits);
|
||||
let success = false;
|
||||
|
||||
try {
|
||||
// 1. Пробуем современный API
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
await navigator.clipboard.writeText(url);
|
||||
success = true;
|
||||
@@ -114,7 +113,6 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
throw new Error('Clipboard API unavailable');
|
||||
}
|
||||
} catch (err) {
|
||||
// 2. Fallback для HTTP
|
||||
try {
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = url;
|
||||
@@ -142,7 +140,7 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
{/* Верхняя панель: Размеры + Поделиться */}
|
||||
{/* Верхняя панель */}
|
||||
<div className="flex flex-col md:flex-row justify-between items-center bg-slate-800/80 p-4 rounded-xl border border-slate-700 mb-4 gap-4 backdrop-blur-sm shadow-lg">
|
||||
|
||||
<div className="flex items-center gap-6">
|
||||
@@ -150,8 +148,6 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
<Ruler className="text-primary" size={20} />
|
||||
<span className="font-medium text-sm uppercase tracking-wide opacity-70">Размеры ящика:</span>
|
||||
</div>
|
||||
|
||||
{/* ЗДЕСЬ ИЗМЕНЕНИЯ: Ш, Г, В */}
|
||||
<div className="flex gap-4 font-mono text-lg font-bold text-white">
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="text-slate-500 text-xs">Ш:</span> {config.drawer.width}
|
||||
@@ -195,7 +191,16 @@ export const PreviewStep: React.FC<Props> = ({ parts, config, splits }) => {
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<Canvas shadows dpr={[1, 2]} camera={{ position: [config.drawer.width * 1.5, config.drawer.height * 3, config.drawer.depth * 1.5], fov: 45 }}>
|
||||
<Canvas
|
||||
shadows
|
||||
dpr={[1, 2]}
|
||||
camera={{
|
||||
position: [config.drawer.width * 1.5, config.drawer.height * 3, config.drawer.depth * 1.5],
|
||||
fov: 45,
|
||||
near: 1, // Исправлено: не режем вблизи
|
||||
far: 20000 // Исправлено: видим очень далеко (для больших размеров в мм)
|
||||
}}
|
||||
>
|
||||
<Suspense fallback={null}>
|
||||
<color attach="background" args={['#0f172a']} />
|
||||
<ambientLight intensity={0.7} />
|
||||
|
||||
Reference in New Issue
Block a user